From baf9cbeec062fd13432ebc31b51cba76487ca6d7 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 8 Oct 2024 07:06:01 -0400 Subject: [PATCH 1/2] don't show keymap `@error` for hints Revert "don't show keymap `@error` for hints" This reverts commit dd5751f6a75d41420f2adc771e3db69b0d1d2e2e. Update LineEdit.jl --- stdlib/REPL/src/LineEdit.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index 5af03e0df9b6d..286c25d12c266 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -382,7 +382,13 @@ function check_for_hint(s::MIState) # Requires making space for them earlier in refresh_multi_line return clear_hint(st) end - completions, partial, should_complete = complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool} + + completions, partial, should_complete = try + complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool} + catch e + @debug "error completing line for hint" e=e,catch_backtrace() + return clear_hint(st) + end isempty(completions) && return clear_hint(st) # Don't complete for single chars, given e.g. `x` completes to `xor` if length(partial) > 1 && should_complete From a921ad581dd5454ed8eec8c6c3e1f60f275f61c4 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 8 Oct 2024 09:01:19 -0400 Subject: [PATCH 2/2] use exception stack --- stdlib/REPL/src/LineEdit.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index 286c25d12c266..c92dca8c8e015 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -385,8 +385,8 @@ function check_for_hint(s::MIState) completions, partial, should_complete = try complete_line(st.p.complete, st, s.active_module; hint = true)::Tuple{Vector{String},String,Bool} - catch e - @debug "error completing line for hint" e=e,catch_backtrace() + catch + @debug "error completing line for hint" exception=current_exceptions() return clear_hint(st) end isempty(completions) && return clear_hint(st)