Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix REPL keybinding CTRL-Q for stdlib methods #47637

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

rashidrafeek
Copy link
Contributor

@rashidrafeek rashidrafeek commented Nov 19, 2022

Currently, when editing methods in stdlibs with CTRL-Q from stack traces leads to #26314. For example, for v1.8.3 the following code:

julia> using Printf

julia> @sprintf "%f" "A string"
ERROR: MethodError: no method matching Float64(::String)
Closest candidates are:
  (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
  (::Type{T})(::Base.TwicePrecision) where T<:Number at twiceprecision.jl:266
  (::Type{T})(::Complex) where T<:Real at complex.jl:44
  ...
Stacktrace:
 [1] tofloat(x::String)
   @ Printf ~/.asdf/installs/julia/1.8.3/share/julia/stdlib/v1.8/Printf/src/Printf.jl:389
 [2] fmt
   @ ~/.asdf/installs/julia/1.8.3/share/julia/stdlib/v1.8/Printf/src/Printf.jl:402 [inlined]
 [3] format
   @ ~/.asdf/installs/julia/1.8.3/share/julia/stdlib/v1.8/Printf/src/Printf.jl:734 [inlined]
 [4] format(f::Printf.Format{Base.CodeUnits{UInt8, String}, Tuple{Printf.Spec{Val{'f'}}}}, args::String)
   @ Printf ~/.asdf/installs/julia/1.8.3/share/julia/stdlib/v1.8/Printf/src/Printf.jl:831
 [5] top-level scope
   @ REPL[2]:1

and typing "3[CTRL-Q]" opens the file: "/cache/build/default-amdci5-6/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Printf/src/Printf.jl"

This change fixes it. I tested it by adding a custom keybinding with this fix.

@fredrikekre fredrikekre added backport 1.8 Change should be backported to release-1.8 backport 1.9 Change should be backported to release-1.9 backport 1.6 Change should be backported to release-1.6 labels Nov 19, 2022
@vtjnash
Copy link
Member

vtjnash commented Nov 19, 2022

Will this let us re-land #46420? That had seem to make people upset that they encountered this issue more frequently

@fredrikekre fredrikekre merged commit 7514bcf into JuliaLang:master Nov 28, 2022
KristofferC pushed a commit that referenced this pull request Nov 28, 2022
KristofferC pushed a commit that referenced this pull request Nov 28, 2022
@KristofferC KristofferC mentioned this pull request Dec 14, 2022
26 tasks
KristofferC pushed a commit that referenced this pull request Dec 14, 2022
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Dec 16, 2022
KristofferC pushed a commit that referenced this pull request Dec 21, 2022
KristofferC pushed a commit that referenced this pull request Dec 21, 2022
KristofferC pushed a commit that referenced this pull request Dec 21, 2022
KristofferC pushed a commit that referenced this pull request Dec 21, 2022
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Dec 27, 2022
KristofferC pushed a commit that referenced this pull request Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.6 Change should be backported to release-1.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants