From 989345d0438429ae719287f9c7343f87b558f7e3 Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Wed, 19 Jan 2022 23:44:50 +0100 Subject: Remove the failed idea of making request tasks --- src/server/documents.odin | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/server/documents.odin') 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; -- cgit v1.2.3