Skip to content

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed May 27, 2024
1 parent 95ee30c commit 6dfdc91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion stdlib/REPL/src/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ end

function filtered_mod_names(ffunc::Function, mod::Module, name::AbstractString; kwargs...)
ssyms = names(mod; kwargs...)
all || filter!(Base.Fix1(Base.isexported, mod), ssyms) # TODO revisit
# all || filter!(Base.Fix1(Base.isexported, mod), ssyms) # TODO revisit
filter!(ffunc, ssyms)
macros = filter(x -> startswith(String(x), "@" * name), ssyms)
syms = String[sprint((io,s)->Base.show_sym(io, s; allow_macroname=true), s) for s in ssyms if completes_global(String(s), name)]
Expand Down
14 changes: 7 additions & 7 deletions stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2270,8 +2270,8 @@ end
use = @eval M module use end
@eval use module def; foo = 42; end

@assert count(==("foo"), test_complete_context1("f", use)) 1
@assert count(==("foo"), test_complete_context1("use.f", M)) 1
@test count(==("foo"), test_complete_context1("f", use)) == 0
@test count(==("foo"), test_complete_context1("use.f", M)) == 0
@eval use using .def: foo
@test count(==("foo"), test_complete_context1("f", use)) == 1
@test count(==("foo"), test_complete_context1("use.f", M)) == 1 # should work for even dot-accessed module context
Expand All @@ -2280,20 +2280,20 @@ end
let # should work for packages
M = Module()

@assert count(==("fuzzyscore"), test_complete_context1("fuzzy", M)) 1
@test count(==("fuzzyscore"), test_complete_context1("fuzzy", M)) == 0
@eval M using REPL: fuzzyscore
@test count(==("fuzzyscore"), test_complete_context1("fuzzy", M)) == 1

@assert count(==("completions"), test_complete_context1("comp", M)) 1
@test count(==("completions"), test_complete_context1("comp", M)) == 0
@eval M using REPL.REPLCompletions: completions
@test count(==("completions"), test_complete_context1("comp", M)) == 1
end

let # should for `Base` binding
M = Module()

@assert count(==("@aggressive_constprop"), test_complete_context1("@aggressive_", M)) 1
@eval M using Base: @aggressive_constprop
@test count(==("@aggressive_constprop"), test_complete_context1("@aggressive_", M)) == 1
@test count(==("@assume_effects"), test_complete_context1("@assume_", M)) 1
@eval M using Base: @assume_effects
@test count(==("@assume_effects"), test_complete_context1("@assume_", M)) == 1
end
end

0 comments on commit 6dfdc91

Please sign in to comment.