From f7c57f83d686d6dfc01d82ccc0528be7ecfb331f Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Thu, 6 Nov 2025 23:02:03 -0500 Subject: Don't include package for union selector completions if the package has being 'using'ed --- src/server/analysis.odin | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/server/analysis.odin') 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) } -- cgit v1.2.3