From b4ef1f01a66ee0b1fdd3d447226fa048ca789c6a Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Mon, 22 Sep 2025 08:02:51 -0400 Subject: Don't collect globals for ignored files and add more types for workspace symbol kinds --- src/server/ast.odin | 7 +++++-- src/server/collector.odin | 1 + src/server/symbol.odin | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/server/ast.odin b/src/server/ast.odin index edb9007..879693b 100644 --- a/src/server/ast.odin +++ b/src/server/ast.odin @@ -527,11 +527,14 @@ collect_when_body :: proc( } collect_globals :: proc(file: ast.File) -> []GlobalExpr { + file_tags := parser.parse_file_tags(file, context.temp_allocator) + if file_tags.ignore { + return {} + } + exprs := make([dynamic]GlobalExpr, context.temp_allocator) defer shrink(&exprs) - file_tags := parser.parse_file_tags(file, context.temp_allocator) - for decl in file.decls { if value_decl, ok := decl.derived.(^ast.Value_Decl); ok { collect_value_decl(&exprs, file, file_tags, decl, {}) diff --git a/src/server/collector.odin b/src/server/collector.odin index 607521e..bd6d040 100644 --- a/src/server/collector.odin +++ b/src/server/collector.odin @@ -666,6 +666,7 @@ collect_symbols :: proc(collection: ^SymbolCollection, file: ast.File, uri: stri case ^ast.Basic_Lit: token = v^ symbol.value = collect_generic(collection, col_expr, package_map, uri) + token_type = .Unresolved case ^ast.Ident: token = v^ symbol.value = collect_generic(collection, col_expr, package_map, uri) diff --git a/src/server/symbol.odin b/src/server/symbol.odin index 4e6b19f..42e5447 100644 --- a/src/server/symbol.odin +++ b/src/server/symbol.odin @@ -780,7 +780,7 @@ symbol_type_to_completion_kind :: proc(type: SymbolType) -> CompletionItemKind { symbol_kind_to_type :: proc(type: SymbolType) -> SymbolKind { #partial switch type { - case .Function: + case .Function, .Type_Function: return .Function case .Constant: return .Constant @@ -796,6 +796,10 @@ symbol_kind_to_type :: proc(type: SymbolType) -> SymbolKind { return .Key case .Field: return .Field + case .Unresolved: + return .Constant + case .Type: + return .Class case: return .Null } -- cgit v1.2.3