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

Developer friendly errors for undeclared identifiers #2844

Closed
ozra opened this issue May 30, 2015 · 2 comments · Fixed by #16067
Closed

Developer friendly errors for undeclared identifiers #2844

ozra opened this issue May 30, 2015 · 2 comments · Fixed by #16067

Comments

@ozra
Copy link
Contributor

ozra commented May 30, 2015

somefile.nim(13, 6) Error: undeclared identifier: 'somVarName'

Clang is exceptional and a role model in this department. When the compiler has encountered an error, we might spend some extra cycles making it more helpful.

I suggest simply using Levenshtein distance algorithm on the scoped symbols where the error occured. Which in this case could have produced:

somefile.nim(13, 6) Error: undeclared identifier: 'somVarName'. Did you mean 'someVarName'?

Ofcourse if there are several near matches, they can be listed in 'nearest' order.

(I might take this on in a not too far future, if it's liked)

@refi64
Copy link
Contributor

refi64 commented May 30, 2015

What I would really like are colors to help in visually separating hints, errors, and the possible invocations of ambiguous or overloaded functions.

@ozra
Copy link
Contributor Author

ozra commented May 30, 2015

@kirbyfan64 - create an issue if there isn't one. It's free to wish. Or make a PR..

Araq pushed a commit that referenced this issue Mar 16, 2021
…similar spellings on undefined symbol error (#16067)

* add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol errors
* implement --spellsuggest with 0 arguments
ringabout pushed a commit to ringabout/Nim that referenced this issue Mar 22, 2021
…s in scope with similar spellings on undefined symbol error (nim-lang#16067)

* add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol errors
* implement --spellsuggest with 0 arguments
ardek66 pushed a commit to ardek66/Nim that referenced this issue Mar 26, 2021
…s in scope with similar spellings on undefined symbol error (nim-lang#16067)

* add --spellsuggest to suggest symbols in scope with similar spellings on undefined symbol errors
* implement --spellsuggest with 0 arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants