diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-06-25 17:48:04 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2025-06-25 17:48:04 +0200 |
| commit | 344eea71fbf1863106bc051dbae11534e7dcca74 (patch) | |
| tree | afb93528027d91d2c7febe2b1334f964db8f402e /src/server/analysis.odin | |
| parent | 312a15dd5752e8c90b57ea4911e5fb29525deee1 (diff) | |
Improve use of runtime procedures without importing the actual package.
Diffstat (limited to 'src/server/analysis.odin')
| -rw-r--r-- | src/server/analysis.odin | 12 |
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 { |