-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Provide better interactive method definition info #7536
Comments
We can actually use lines of the history file although that complicates the internal repl flow a bit. |
IJulia calls Things are a bit different for the REPL, compared to IJulia, because the REPL has to decide dynamically when the input is finished (i.e. when an expression is complete), and hence it needs to call However, it seems like it would be straightforward to make a version of I'm still unclear on what "filename" label you want, however. One option would be to change the REPL to number the input/output lines, like IPython's console interface and like IJulia notebooks. Is that something people would like? (I don't see what this has to do with the history. What is in the history file is irrelevant; all that matters is what definitions you actually evaluated in the REPL in the current session.) |
The reason the history file would be relevant is that later if you want to debug code entered into the REPL, the history file happens to be a place where that code is saved. So, for example, if you do julia> function foo()
# do stuff
# and things
# or whatnot
end
foo (generic function with 1 method)
julia> @edit foo()
ERROR: could not find function definition
in functionlocs at reflection.jl:153
in edit at interactiveutil.jl:55 instead of showing that error, it could actually open up the history file at that function definition. |
I guess I've never actually used I'm skeptical that you would actually want to open up the history file in an editor during a live REPL session, though. |
This now shows: julia> methods(hey)
# 1 method for generic function "hey":
hey(x, y) in Main at REPL[3]:2 which seems to be along the line of the requested. Tentatively closing, please reopen if there is more to do here. |
Currently when methods are defined at the REPL, you don't get much information:
Whereas methods from files and even IJulia provide much better info.
With all the new fancy REPL/history machinery, could we make this better somehow? Maybe provide the timestamp from history where the method was defined?
Not only would this help in better discerning where a method definition is coming from, but this would also provide a mechanism for #2625 without having to keep the original method definition string somewhere.
The text was updated successfully, but these errors were encountered: