aboutsummaryrefslogtreecommitdiff
path: root/src/server/documents.odin
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-08-17 00:31:55 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2022-08-17 00:31:55 +0200
commita9f3f61ef7e0995a2f8ab30c461a502fa2176753 (patch)
tree0fa49881f39929df0969743b47aceb2fb4b5c843 /src/server/documents.odin
parent81e17b2aa1cf54a5a9226f1b3b766810008372d4 (diff)
Fix rare crash with semantic token
Diffstat (limited to 'src/server/documents.odin')
-rw-r--r--src/server/documents.odin8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/documents.odin b/src/server/documents.odin
index d320cf0..d5b0f09 100644
--- a/src/server/documents.odin
+++ b/src/server/documents.odin
@@ -377,9 +377,13 @@ parse_document :: proc(document: ^Document, config: ^common.Config) -> ([]Parser
current_errors = make([dynamic]ParserError, context.temp_allocator)
- free_all(common.scratch_allocator(document.allocator))
+ if document.uri.uri in file_resolve_cache.files {
+ key := file_resolve_cache.files[document.uri.uri]
+ delete_key(&file_resolve_cache.files, document.uri.uri)
+ delete(key)
+ }
- delete_key(&file_resolve_cache.files, document.uri.uri)
+ free_all(common.scratch_allocator(document.allocator))
context.allocator = common.scratch_allocator(document.allocator)