Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions stdlib/REPL/src/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions stdlib/REPL/test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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