Skip to content

Commit

Permalink
use Pipe for now
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 2, 2024
1 parent a712fe9 commit 68bf8f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,11 @@ end
# Prompt Completions & Hints
function complete_line(s::MIState)
set_action!(s, :complete_line)
# don't allow stderr/stdout prints during completion computation
# suppress stderr/stdout prints during completion computation
# i.e. ambiguous qualification warnings that are printed to stderr
completions_exist = redirect_stdio(;stderr=devnull, stdout=devnull) do
# 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
Expand All @@ -387,9 +389,11 @@ function check_for_hint(s::MIState)
# Requires making space for them earlier in refresh_multi_line
return clear_hint(st)
end
# don't allow stderr/stdout prints during completion computation
# suppress stderr/stdout prints during completion computation
# i.e. ambiguous qualification warnings that are printed to stderr
completions, partial, should_complete = redirect_stdio(;stderr=devnull, stdout=devnull) do
# 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
isempty(completions) && return clear_hint(st)
Expand Down

0 comments on commit 68bf8f1

Please sign in to comment.