aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2020-12-18 15:09:30 +0100
committerDanielGavin <danielgavin5@hotmail.com>2020-12-18 15:09:30 +0100
commitbf9e093d9f4f0d5aaa6cd14d751a3ba6f775bf00 (patch)
tree96179b015b114ca0ac56b63d68d425dd11108d22 /src
parent53887066c915c0e332871c867beb500fd8b407e9 (diff)
fixed crash after updating Odin
Diffstat (limited to 'src')
-rw-r--r--src/index/build.odin6
-rw-r--r--src/server/documents.odin6
-rw-r--r--src/server/requests.odin2
3 files changed, 13 insertions, 1 deletions
diff --git a/src/index/build.odin b/src/index/build.odin
index bf1536a..890de2b 100644
--- a/src/index/build.odin
+++ b/src/index/build.odin
@@ -59,9 +59,15 @@ build_static_index :: proc(allocator := context.allocator, config: ^common.Confi
warn = no_warning_handler,
};
+ //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;
+ pkg.fullpath = fullpath;
+
file := ast.File {
fullpath = fullpath,
src = data,
+ pkg = pkg,
};
ok = parser.parse_file(&p, &file);
diff --git a/src/server/documents.odin b/src/server/documents.odin
index 7e9aa67..bf8a04f 100644
--- a/src/server/documents.odin
+++ b/src/server/documents.odin
@@ -386,9 +386,15 @@ parse_document :: proc(document: ^Document, config: ^common.Config) -> ([] Parse
context.allocator = 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;
+ pkg.fullpath = document.uri.path;
+
document.ast = ast.File {
fullpath = document.uri.path,
src = document.text[:document.used_text],
+ pkg = pkg,
};
parser.parse_file(&p, &document.ast);
diff --git a/src/server/requests.odin b/src/server/requests.odin
index 97c17ef..f9f986c 100644
--- a/src/server/requests.odin
+++ b/src/server/requests.odin
@@ -857,7 +857,7 @@ request_semantic_token_range :: proc(task: ^common.Task) {
symbols: SemanticTokens;
- if config.enable_semantic_tokens {
+ if false && config.enable_semantic_tokens {
symbols = get_semantic_tokens(document, semantic_params.range);
}