aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-01-27 19:19:11 +0100
committerDanielGavin <danielgavin5@hotmail.com>2024-01-27 19:19:11 +0100
commit0ec5ed35af349f4a5f6ab5497da1b8e3029132e1 (patch)
tree9461ff01b23e30ed8e8e008462b04812b79e6880 /src
parent4e7714ec85b7067d6c0ede25c4c66c7517210bc9 (diff)
Handle parser not returning valid global decls.
Diffstat (limited to 'src')
-rw-r--r--src/server/analysis.odin22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 0789736..a92599b 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1253,8 +1253,8 @@ internal_resolve_type_identifier :: proc(
for imp in ast_context.imports {
if strings.compare(imp.base, node.name) == 0 {
symbol := Symbol {
- type = .Package,
- pkg = imp.name,
+ type = .Package,
+ pkg = imp.name,
value = SymbolPackageValue{},
}
@@ -1510,8 +1510,8 @@ internal_resolve_type_identifier :: proc(
//right now we replace the package ident with the absolute directory name, so it should have '/' which is not a valid ident character
if strings.contains(node.name, "/") {
symbol := Symbol {
- type = .Package,
- pkg = node.name,
+ type = .Package,
+ pkg = node.name,
value = SymbolPackageValue{},
}
@@ -1528,8 +1528,8 @@ internal_resolve_type_identifier :: proc(
for imp in ast_context.imports {
if strings.compare(imp.base, node.name) == 0 {
symbol := Symbol {
- type = .Package,
- pkg = imp.name,
+ type = .Package,
+ pkg = imp.name,
value = SymbolPackageValue{},
}
@@ -3567,6 +3567,10 @@ resolve_entire_file :: proc(
symbols := make(map[uintptr]SymbolAndNode, 10000, allocator)
for decl in document.ast.decls {
+ if _, is_value := decl.derived.(^ast.Value_Decl); !is_value {
+ continue
+ }
+
resolve_entire_decl(
&ast_context,
document,
@@ -4509,10 +4513,10 @@ fallback_position_context_completion :: proc(
}
p := parser.Parser {
- err = common.parser_warning_handler, //empty
- warn = common.parser_warning_handler, //empty
+ err = common.parser_warning_handler, //empty
+ warn = common.parser_warning_handler, //empty
flags = {.Optional_Semicolons},
- file = &position_context.file,
+ file = &position_context.file,
}
tokenizer.init(