aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analysis/analysis.odin4
-rw-r--r--src/server/documents.odin8
-rw-r--r--src/server/requests.odin2
3 files changed, 5 insertions, 9 deletions
diff --git a/src/analysis/analysis.odin b/src/analysis/analysis.odin
index b7be73c..b11726a 100644
--- a/src/analysis/analysis.odin
+++ b/src/analysis/analysis.odin
@@ -2422,7 +2422,7 @@ resolve_entire_file :: proc(document: ^common.Document, allocator := context.all
ast_context.current_package = ast_context.document_package
- symbols := make(map[uintptr]index.Symbol, 100, allocator)
+ symbols := make(map[uintptr]index.Symbol, 10000, allocator)
for k, v in ast_context.globals {
resolve_entire_decl(&ast_context, v.expr, &symbols, allocator)
@@ -2512,7 +2512,7 @@ resolve_entire_decl :: proc(ast_context: ^AstContext, decl: ^ast.Expr, symbols:
if v.body == nil {
break
}
-
+
type_position_context: DocumentPositionContext
type_position_context.position = v.end.offset
get_locals_proc_param_and_results(ast_context.file, v^, ast_context, &type_position_context)
diff --git a/src/server/documents.odin b/src/server/documents.odin
index 3bb4a01..9c70035 100644
--- a/src/server/documents.odin
+++ b/src/server/documents.odin
@@ -48,7 +48,7 @@ document_get_allocator :: proc() -> ^common.Scratch_Allocator {
return pop(&document_storage.free_allocators)
} else {
allocator := new(common.Scratch_Allocator)
- common.scratch_allocator_init(allocator, mem.megabytes(1))
+ common.scratch_allocator_init(allocator, mem.megabytes(3))
return allocator
}
}
@@ -299,12 +299,6 @@ 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
}
diff --git a/src/server/requests.odin b/src/server/requests.odin
index 00af132..e5b8254 100644
--- a/src/server/requests.odin
+++ b/src/server/requests.odin
@@ -866,6 +866,8 @@ request_semantic_token_full :: proc (params: json.Value, id: RequestId, config:
symbols: SemanticTokens
if config.enable_semantic_tokens {
+ resolve_entire_file(document)
+
if cache_symbols, ok := file_resolve_cache.files[document.uri.uri]; ok {
symbols = get_semantic_tokens(document, range, cache_symbols)
}