Skip to content

Commit

Permalink
REPL: hide any prints to stdio during complete_line (#55959)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Oct 10, 2024
1 parent d4ca92c commit 84a2458
Showing 1 changed file with 15 additions and 2 deletions.
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

2 comments on commit 84a2458

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Please sign in to comment.