diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-11-06 23:02:03 -0500 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-11-06 23:02:48 -0500 |
| commit | f7c57f83d686d6dfc01d82ccc0528be7ecfb331f (patch) | |
| tree | b58f7fb2d19633827b8920ec6e86602207418702 /src/server/analysis.odin | |
| parent | e466dde8a720fe8c9653aed200190dcfeb0d640e (diff) | |
Don't include package for union selector completions if the package has being 'using'ed
Diffstat (limited to 'src/server/analysis.odin')
| -rw-r--r-- | src/server/analysis.odin | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 4a1980c..2dfed25 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -3267,6 +3267,16 @@ get_using_packages :: proc(ast_context: ^AstContext) -> []string { return usings } +// Returns whether the provided package is being used with a `using` statement +is_using_package :: proc(ast_context: ^AstContext, pkg: string) -> bool { + for u in ast_context.usings { + if strings.compare(pkg, u.pkg_name) == 0 { + return true + } + } + return false +} + get_symbol_pkg_name :: proc(ast_context: ^AstContext, symbol: ^Symbol) -> string { return get_pkg_name(ast_context, symbol.pkg) } |