Skip to content
Merged
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
17 changes: 15 additions & 2 deletions stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,14 @@ end
# Prompt Completions & Hints
function complete_line(s::MIState)
set_action!(s, :complete_line)
if complete_line(state(s), s.key_repeats, s.active_module)
# suppress stderr/stdout prints during completion computation
# i.e. ambiguous qualification warnings that are printed to stderr
# TODO: remove this suppression once such warnings are better handled
# TODO: but before that change Pipe to devnull once devnull redirects work for JL_STDERR etc.
completions_exist = redirect_stdio(;stderr=Pipe(), stdout=Pipe()) do
complete_line(state(s), s.key_repeats, s.active_module)
end
if completions_exist
return refresh_line(s)
else
beep(s)
Expand All @@ -384,7 +391,13 @@ function check_for_hint(s::MIState)
end

completions, partial, should_complete = try
complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool}
# suppress stderr/stdout prints during completion computation
# i.e. ambiguous qualification warnings that are printed to stderr
# TODO: remove this suppression once such warnings are better handled
# TODO: but before that change Pipe to devnull once devnull redirects work for JL_STDERR etc.
completions, partial, should_complete = redirect_stdio(;stderr=Pipe(), stdout=Pipe()) do
complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool}
end
catch
@debug "error completing line for hint" exception=current_exceptions()
return clear_hint(st)
Expand Down