diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-04 20:04:43 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-04 20:04:43 +0100 |
| commit | c1fc712b7d6f53e41411ef8587db47f451a4bbb3 (patch) | |
| tree | cd69764315fdca18944df8eb8a6aa139c83f549f | |
| parent | 2d9f5709d74992e0cd485099a5a8cdf12178e80d (diff) | |
give more memory to allocator
| -rw-r--r-- | src/analysis/analysis.odin | 4 | ||||
| -rw-r--r-- | src/server/documents.odin | 8 | ||||
| -rw-r--r-- | src/server/requests.odin | 2 |
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) } |