aboutsummaryrefslogtreecommitdiff
path: root/src/server/analysis.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-06-25 17:48:04 +0200
committerDanielGavin <danielgavin5@hotmail.com>2025-06-25 17:48:04 +0200
commit344eea71fbf1863106bc051dbae11534e7dcca74 (patch)
treeafb93528027d91d2c7febe2b1334f964db8f402e /src/server/analysis.odin
parent312a15dd5752e8c90b57ea4911e5fb29525deee1 (diff)
Improve use of runtime procedures without importing the actual package.
Diffstat (limited to 'src/server/analysis.odin')
-rw-r--r--src/server/analysis.odin12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 2990fe3..c485a43 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1445,6 +1445,17 @@ internal_resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ide
}
}
+ //This could also be the runtime package, which is not required to be imported, but itself is used with selector expression in runtime functions: `my_runtime_proc :proc(a: runtime.*)`
+ if node.name == "runtime" {
+ symbol := Symbol {
+ type = .Package,
+ pkg = indexer.runtime_package,
+ value = SymbolPackageValue{},
+ }
+
+ return symbol, true
+ }
+
if global, ok := ast_context.globals[node.name];
ast_context.current_package == ast_context.document_package && ok {
is_distinct := false
@@ -1601,7 +1612,6 @@ internal_resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ide
}
for u in ast_context.usings {
- //TODO(Daniel, make into a map, not really required for performance but looks nicer)
for imp in ast_context.imports {
if strings.compare(imp.base, u) == 0 {
if symbol, ok := lookup(node.name, imp.name); ok {