feat: make project_manager use configurable file types

This commit is contained in:
CJ van den Berg 2025-07-14 13:26:18 +02:00
parent bffc56b618
commit 6df9391b50
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 3 additions and 3 deletions

View file

@ -505,7 +505,7 @@ pub fn build_exe(
.{ .name = "thespian", .module = thespian_mod }, .{ .name = "thespian", .module = thespian_mod },
.{ .name = "Buffer", .module = Buffer_mod }, .{ .name = "Buffer", .module = Buffer_mod },
.{ .name = "tracy", .module = tracy_mod }, .{ .name = "tracy", .module = tracy_mod },
.{ .name = "syntax", .module = syntax_mod }, .{ .name = "file_type_config", .module = file_type_config_mod },
.{ .name = "dizzy", .module = dizzy_dep.module("dizzy") }, .{ .name = "dizzy", .module = dizzy_dep.module("dizzy") },
.{ .name = "fuzzig", .module = fuzzig_dep.module("fuzzig") }, .{ .name = "fuzzig", .module = fuzzig_dep.module("fuzzig") },
.{ .name = "git", .module = git_mod }, .{ .name = "git", .module = git_mod },

View file

@ -3,7 +3,7 @@ const tp = @import("thespian");
const cbor = @import("cbor"); const cbor = @import("cbor");
const log = @import("log"); const log = @import("log");
const tracy = @import("tracy"); const tracy = @import("tracy");
const FileType = @import("syntax").FileType; const file_type_config = @import("file_type_config");
const root = @import("root"); const root = @import("root");
const Buffer = @import("Buffer"); const Buffer = @import("Buffer");
const builtin = @import("builtin"); const builtin = @import("builtin");
@ -137,7 +137,7 @@ pub fn delete_task(task: []const u8) (ProjectManagerError || ProjectError)!void
return send(.{ "delete_task", project, task }); return send(.{ "delete_task", project, task });
} }
pub fn did_open(file_path: []const u8, file_type: *const FileType, version: usize, text: []const u8, ephemeral: bool) (ProjectManagerError || ProjectError)!void { pub fn did_open(file_path: []const u8, file_type: file_type_config, version: usize, text: []const u8, ephemeral: bool) (ProjectManagerError || ProjectError)!void {
if (ephemeral) return; if (ephemeral) return;
const project = tp.env.get().str("project"); const project = tp.env.get().str("project");
if (project.len == 0) if (project.len == 0)