aboutsummaryrefslogtreecommitdiff
path: root/src/server/documents.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/documents.odin')
-rw-r--r--src/server/documents.odin12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/documents.odin b/src/server/documents.odin
index 94c0cd6..4f5610a 100644
--- a/src/server/documents.odin
+++ b/src/server/documents.odin
@@ -23,7 +23,7 @@ ParserError :: struct {
}
DocumentStorage :: struct {
- documents: map[string] common.Document,
+ documents: map[string]common.Document,
free_allocators: [dynamic]^common.Scratch_Allocator,
}
@@ -224,8 +224,8 @@ document_close :: proc(uri_string: string) -> common.Error {
free_all(common.scratch_allocator(document.allocator));
document_free_allocator(document.allocator);
- document.allocator = nil;
+ document.allocator = nil;
document.client_owned = false;
common.delete_uri(document.uri);
@@ -298,6 +298,12 @@ document_refresh :: proc(document: ^common.Document, config: ^common.Config, wri
}
}
+ //We only resolve the entire file, if we are dealing with the heavy features that require the entire file resolved.
+ //This gives the user a choice to use "fast mode" with only completion and gotos.
+ if config.enable_semantic_tokens || config.enable_inlay_hints {
+ resolve_entire_file(document);
+ }
+
return .None;
}
@@ -324,8 +330,6 @@ parse_document :: proc(document: ^common.Document, config: ^common.Config) -> ([
context.allocator = common.scratch_allocator(document.allocator);
- document.symbol_cache = make(map[int]rawptr, 10, common.scratch_allocator(document.allocator));
-
//have to cheat the parser since it really wants to parse an entire package with the new changes...
pkg := new(ast.Package);
pkg.kind = .Normal;