-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[TODO] [feature] Nim error messages should show line contents, would save lots of debugging time #7586
Comments
Pretty sure |
with
Also, it's doing other stuff too; it's good to keep features orthogonal |
I have to agree, I even think it's very useful to file context visible by default: would that somehow break anything depending on the output? |
|
|
@Araq
(note: as for the error itself, i just filed dom96/jester#138) also tried with: I would expect to see line contents instead, eg smthg like:
|
@timotheecour, strange, I tested it from command line and it worked just fine. It's also enabled with |
NOTE: also, it's verbosity:2 or 3, not 3. EDIT
lol, hadn't seen your comment above, posted that at same time... |
# if msg in errMin..errMax and hintSource in gNotes:
# info.writeSurroundingSrc
info.writeSurroundingSrc
i could try a PR tmrw |
hintsSourceError to print context for errors (ie last entry if compilation aborts on error); adjust these hints in verbosity; minor code clarification
=> #7635 |
hintsSourceError to print context for errors (ie last entry if compilation aborts on error); adjust these hints in verbosity; minor code clarification
this should be closed |
I marked it with "documentation". The documentation has not been improved. |
I had a go at documenting the hints #8625 |
Fixes #7586: Adds documentation for hints
/cc @dom96 could we reopen? the problem is still there: proc foo2[]()=
var foo2: int = 3.0
proc foo1[]()=
foo2()
proc main()=
foo1()
main() nim c --hint:source:on issue_7586.nim
instead of:
it doesn't have to be the default with |
--showLineContext:int
this would save tons of debugging time:
with
--showLineContext:0
(default value), same as current behaviorwith
--showLineContext:1
possible future extension:
--showLineContext:2,3
shows 2 lines above(including self line), 3 lines below (strictly below)
--colorizeLineContext:true
we'd also:(say in blue)(with underscore, so it works with spaces too) column mentioned in error message EDITEDIT nimgrep's logic can be reused for that purpose
The text was updated successfully, but these errors were encountered: