366
366
# Prompt Completions & Hints
367
367
function complete_line (s:: MIState )
368
368
set_action! (s, :complete_line )
369
- if complete_line (state (s), s. key_repeats, s. active_module)
369
+ # suppress stderr/stdout prints during completion computation
370
+ # i.e. ambiguous qualification warnings that are printed to stderr
371
+ # TODO : remove this suppression once such warnings are better handled
372
+ # TODO : but before that change Pipe to devnull once devnull redirects work for JL_STDERR etc.
373
+ completions_exist = redirect_stdio (;stderr = Pipe (), stdout = Pipe ()) do
374
+ complete_line (state (s), s. key_repeats, s. active_module)
375
+ end
376
+ if completions_exist
370
377
return refresh_line (s)
371
378
else
372
379
beep (s)
@@ -384,7 +391,13 @@ function check_for_hint(s::MIState)
384
391
end
385
392
386
393
completions, partial, should_complete = try
387
- complete_line (st. p. complete, st, s. active_module; hint = true ):: Tuple{Vector{String},String,Bool}
394
+ # suppress stderr/stdout prints during completion computation
395
+ # i.e. ambiguous qualification warnings that are printed to stderr
396
+ # TODO : remove this suppression once such warnings are better handled
397
+ # TODO : but before that change Pipe to devnull once devnull redirects work for JL_STDERR etc.
398
+ completions, partial, should_complete = redirect_stdio (;stderr = Pipe (), stdout = Pipe ()) do
399
+ complete_line (st. p. complete, st, s. active_module; hint = true ):: Tuple{Vector{String},String,Bool}
400
+ end
388
401
catch
389
402
@debug " error completing line for hint" exception= current_exceptions ()
390
403
return clear_hint (st)
0 commit comments