-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add --declaredlocs to show symbol declaration location in message
#15666
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
Conversation
|
Superb work, thanks! |
|
I think this is a bit too verbose. Would a works? It'd be more uniform like this IMO. EDIT: lol Araq merged right after I post my feedback. |
|
you don't have to turn it on by default, but when you're trying to debug some error, the declared locations help, even for the types (as done here: https://github.com/nim-lang/Nim/pull/15660/files#diff-083ab8ee8fb7c645dd951c50f3b05f3fbb27605001375f4870a1a0ddc21b7e04R233 where code was instrumented). That said, I'd be happy with adding this: which is less verbose. Note that |
|
I was looking for a more uniforming style via the use of hints since it'd allows editors that integrate with Nim's output to easily implements jumps-to-file. |
that's a separate issue, and IMO editors whose jump-to-file depends on presence of a hint/hint-like formatting should be fixed, and wouldn't even work with some other messages eg assert failures: Require a location in messages to only appear at start of a line would also prevent showing declarations for types in an effective way as shown above. Editors should handle location everywhere, not just at beginning of line, that being said, see #690 on the topic of making jump-to-file easier on editors. |
too verbose by default but very useful when you need to figure out where symbols are declared without guesswork.
(also avoids having to instrument compiler when chasing those things, eg see https://github.com/nim-lang/Nim/pull/15660/files#diff-083ab8ee8fb7c645dd951c50f3b05f3fbb27605001375f4870a1a0ddc21b7e04R233)
example
nim r --listfullpaths --declaredlocs main
note:
honors
--listfullpaths(ie same logic as what's used in listfullpaths is used to display paths; note that the logic used for listfullpaths could be improved but that's out of scope for this PR)future work
type mismatch: got <...errors, eg:=> #15673