diff --git a/stdlib/REPL/src/REPLCompletions.jl b/stdlib/REPL/src/REPLCompletions.jl index ad138768f5ae4..7b98720397413 100644 --- a/stdlib/REPL/src/REPLCompletions.jl +++ b/stdlib/REPL/src/REPLCompletions.jl @@ -1132,6 +1132,10 @@ function complete_identifiers!(suggestions::Vector{Completion}, end isexpr(ex, :incomplete) && (ex = nothing) elseif isexpr(ex, (:using, :import)) + if isexpr(ex, :import) + # allow completion for `import Mod.name` (where `name` is not a module) + complete_modules_only = false + end arglast = ex.args[end] # focus on completion to the last argument if isexpr(arglast, :.) # We come here for cases like: diff --git a/stdlib/REPL/test/replcompletions.jl b/stdlib/REPL/test/replcompletions.jl index 62520bfc1bdbd..4890f31fc53b9 100644 --- a/stdlib/REPL/test/replcompletions.jl +++ b/stdlib/REPL/test/replcompletions.jl @@ -2308,3 +2308,18 @@ let s = "TestImplicitUsing.@asse" @test res @test "@assert" in c end + +# JuliaLang/julia#23374: completion for `import Mod.name` +module Issue23374 +global v23374 = nothing +end +let s = "import .Issue23374.v" + c, r, res = test_complete_context(s) + @test res + @test "v23374" in c +end +let s = "using .Issue23374.v" + c, r, res = test_complete_context(s) + @test res + @test isempty(c) +end