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

Add hint for :quit to REPL.REPLCompletions.UndefVarError_hint #41990

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

mkitti
Copy link
Contributor

@mkitti mkitti commented Aug 24, 2021

This addresses #38522 (comment) by providing a hint when a user types quit or quit() into the REPL.

It follows on the heels of #41754 that added support for when the user types help.

julia> using Revise, REPL

julia> Revise.track(REPL)

julia> quit
ERROR: UndefVarError: quit not defined
suggestion: To exit Julia, use Ctrl-D, or type exit() and press enter.

julia> quit()
ERROR: UndefVarError: quit not defined
suggestion: To exit Julia, use Ctrl-D, or type exit() and press enter.
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

julia> quit = 2
2

julia> quit
2

julia> quit()
ERROR: MethodError: objects of type Int64 are not callable
Maybe you forgot to use an operator such as *, ^, %, / etc. ?
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

@DilumAluthge
Copy link
Member

This is really nice!

@mkitti
Copy link
Contributor Author

mkitti commented Nov 2, 2021

Bumping this. It's a straightforward addition to the REPL when a user tries to "quit".

@DilumAluthge
Copy link
Member

I think this is good to go.

@DilumAluthge DilumAluthge merged commit b4552e7 into JuliaLang:master Nov 2, 2021
@DilumAluthge
Copy link
Member

Let's merge this. If there are further tweaks to make, we can do so in a follow-up PR.

@DilumAluthge DilumAluthge added REPL Julia's REPL (Read Eval Print Loop) error messages Better, more actionable error messages labels Nov 2, 2021
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Better, more actionable error messages REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants