refactor: store static file types in a StaticStringMap instead of a plain list

This commit is contained in:
CJ van den Berg 2025-07-14 14:40:58 +02:00
parent 6969727e07
commit 54069d1301
3 changed files with 27 additions and 21 deletions

View file

@ -27,7 +27,7 @@ errors_query: *Query,
injections: ?*Query,
tree: ?*treez.Tree = null,
pub fn create(file_type: *const FileType, allocator: std.mem.Allocator, query_cache: *QueryCache) !*Self {
pub fn create(file_type: FileType, allocator: std.mem.Allocator, query_cache: *QueryCache) !*Self {
const query = try query_cache.get(file_type, .highlights);
const errors_query = try query_cache.get(file_type, .errors);
const injections = try query_cache.get(file_type, .injections);