diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-08-15 13:31:13 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-08-15 13:31:13 +0200 |
| commit | 440af34d87e4e92bd9968f677c1fd552054f476e (patch) | |
| tree | cd3df39e0db3510ef70c07845fbca6d5a33a6e3d /src/server/analysis.odin | |
| parent | 1063fa3a6556bc15f374318d901e68e16526a14f (diff) | |
Fix hover and go to issue where selector base was the same name as field.
Diffstat (limited to 'src/server/analysis.odin')
| -rw-r--r-- | src/server/analysis.odin | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index f82b907..0873be4 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1361,27 +1361,30 @@ resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ident) -> (S value = SymbolPackageValue {}, } - return symbol, true - } else { - //part of the ast so we check the imports of the document - for imp in ast_context.imports { - if strings.compare(imp.base, node.name) == 0 { - symbol := Symbol { - type = .Package, - pkg = imp.name, - value = SymbolPackageValue {}, - } + try_build_package(symbol.pkg) - return symbol, true - } - } - } + return symbol, true + } //last option is to check the index if symbol, ok := lookup(node.name, ast_context.current_package); ok { return resolve_symbol_return(ast_context, symbol) } + for imp in ast_context.imports { + if strings.compare(imp.base, node.name) == 0 { + symbol := Symbol { + type = .Package, + pkg = imp.name, + value = SymbolPackageValue {}, + } + + try_build_package(symbol.pkg) + + return symbol, true + } + } + //If we are resolving a symbol that is in the document package, then we'll check the builtin packages. if ast_context.current_package == ast_context.document_package { if symbol, ok := lookup(node.name, "$builtin"); ok { |