From e2267c9dda731b1cb1b43e01bf7b2b776f3e8e8a Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Thu, 14 Dec 2023 21:37:53 +0100 Subject: Fix issue with not using builtin symbols when in another package. --- src/server/analysis.odin | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/server') diff --git a/src/server/analysis.odin b/src/server/analysis.odin index d375911..9430118 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1905,16 +1905,13 @@ internal_resolve_type_identifier :: proc( } } - //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 { + if symbol, ok := lookup(node.name, "$builtin"); ok { + return resolve_symbol_return(ast_context, symbol) + } + for built in indexer.builtin_packages { + if symbol, ok := lookup(node.name, built); ok { return resolve_symbol_return(ast_context, symbol) } - for built in indexer.builtin_packages { - if symbol, ok := lookup(node.name, built); ok { - return resolve_symbol_return(ast_context, symbol) - } - } } for u in ast_context.usings { -- cgit v1.2.3