diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-10-04 20:31:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-04 20:31:25 +0200 |
| commit | 317b9b7f34b4876fa0b69591c1d31a3c0cb46f6a (patch) | |
| tree | eb4ccb0e18f73df70ff7c9110e3b8a1c90f491ab /src/server/requests.odin | |
| parent | 55b3900c8fa1e439ea31aac984bedbabb8dcf5b0 (diff) | |
| parent | 9e83bc2dc63f97d57fb02dcb60907493616abd8e (diff) | |
Merge pull request #1074 from thetarnav/inlay-range-improved
Use document range in inlay hints
Diffstat (limited to 'src/server/requests.odin')
| -rw-r--r-- | src/server/requests.odin | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/server/requests.odin b/src/server/requests.odin index ce98931..511832a 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -1212,9 +1212,9 @@ request_semantic_token_range :: proc( tokens_params: SemanticTokensResponseParams if config.enable_semantic_tokens { - symbols := resolve_ranged_file(document, semantic_params.range, context.temp_allocator) + file := resolve_ranged_file_cached(document, semantic_params.range, context.temp_allocator) - tokens := get_semantic_tokens(document, semantic_params.range, symbols) + tokens := get_semantic_tokens(document, semantic_params.range, file.symbols) tokens_params = semantic_tokens_to_response_params(tokens) } @@ -1314,12 +1314,9 @@ request_inlay_hint :: proc( document := document_get(inlay_params.textDocument.uri) if document == nil do return .InternalError - resolve_entire_file_cached(document) + file := resolve_ranged_file_cached(document, inlay_params.range, context.temp_allocator) - file, file_ok := file_resolve_cache.files[document.uri.uri] - if !file_ok do return .InternalError - - hints, hints_ok := get_inlay_hints(document, file.symbols, config) + hints, hints_ok := get_inlay_hints(document, inlay_params.range, file.symbols, config) if !hints_ok do return .InternalError response := make_response_message(params = hints, id = id) |