analyzer: support selective imports and improve module resolution #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed the parser to correctly recognize selective imports (e.g.,
import foo { Bar }), so "Go to Definition" and highlighting now work for symbols inside the curly braces.Improved module resolution logic, which fixes issues in nested project structures (e.g.,
import barnow correctly resolves tofoo.modules.bar). It also prioritizes workspace modules over the standard library, fixing cases where some symbols would jump to vlib instead of the local implementation.Fixed a symbol shadowing bug. Global variables that share a name with their module are now correctly resolved as variables. Explicitly defined local variables named it are now correctly recognized, instead of being forced to be implicit array iterators.
Enabled indexing for the main function so it now appears in the Document Outline and symbol search. Fixed methods defined on Type Aliases were not resolved (e.g.,
x.bar()wherexis a SumType). Restored broken syntax highlighting for theimplementskeyword. Fixed definition lookup jumping to incorrect global symbols and miss usages in files that imported the module using a shorter path (e.g.import barbut FQN isfoo.modules.bar).Resolves #153, resolves #149, resolves #17, resolves #107, resolves #159, resolves #98, resolves #103, resolves #151, resolves #105.