aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/ast.odin7
-rw-r--r--src/server/collector.odin1
-rw-r--r--src/server/symbol.odin6
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
}