From 720a9070b36266b2c4a415b6cb9b5c9fd80fe054 Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Mon, 14 Oct 2024 14:44:24 +0200 Subject: [PATCH] autocomplete: use `public` over exported when available (#3058) --- .../PlutoRunner/src/ide features/completions.jl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/runner/PlutoRunner/src/ide features/completions.jl b/src/runner/PlutoRunner/src/ide features/completions.jl index 5e7964c89..af8a289ed 100644 --- a/src/runner/PlutoRunner/src/ide features/completions.jl +++ b/src/runner/PlutoRunner/src/ide features/completions.jl @@ -69,15 +69,14 @@ function is_pluto_controlled(m::Module) end function completions_exported(cs::Vector{<:Completion}) - completed_modules = Set{Module}(c.parent for c in cs if c isa ModuleCompletion) - completed_modules_exports = Dict( - m => Set(names(m, all=is_pluto_workspace(m), imported=true)) - for m in completed_modules - ) - map(cs) do c if c isa ModuleCompletion - Symbol(c.mod) ∈ completed_modules_exports[c.parent] + sym = Symbol(c.mod) + @static if isdefined(Base, :ispublic) + Base.ispublic(c.parent, sym) + else + Base.isexported(c.parent, sym) + end else true end