-
-
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
Extended side effect error messages #18418
Extended side effect error messages #18418
Conversation
- refactored `markSideEffect` - refactored string interpolations - single message - skip diagnostics in `system.compiles` context Other: - started a test of diagnostic messages [ci skip] Tests aren't updated yet because messaging isn't nailed down.
I just found nim-lang/RFCs#323 and nim-lang/RFCs#324. I'm not sure what to apply from those discussions. |
* added float32 schubfach algorithm; wip * fixes nim-lang#18418
- Tried to clarify the reasons.
tests/effects/tdiagnostic_messages.nim: var globalVar = 0
proc indirectCallViaVarParam(call: var proc(): int {.nimcall.}): int =
call()
proc indirectCallViaPointer(call: pointer): int =
cast[ptr proc(): int](call)[]()
proc callWithSideEffects(): int =
var p = proc (): int {.nimcall.} = 0
discard indirectCallViaVarParam(p)
discard indirectCallViaPointer(addr p)
echo ""
globalVar
func a: int =
discard callWithSideEffects() Here is the current state of rendering: Terminal:
VSCode: |
The terminal rendering's structure gives context to the hints about what |
- moved collection of side effects from TSym to TContext - used pragma shorthand form `.sideEffect` and `.noSideEffect` in messages - added leading '>' to structured messages for readability - changed `sempass2.markSideEffect` to a proc - replaced `system.echo` in the test to make the test compatible with Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, excellent addition
please rather look at https://github.com/saem/vscode-nim as it's error parsing code has gotten some fixes (and also feature additions). https://github.com/pragmagic/vscode-nim is somewhat dead. |
Don't merge. I just notice a small bug. Give me a minute. |
@timotheecour @RSDuck |
This reverts commit ff20342.
I don't know why the checks failed:
|
Me neither, I'm investigating... |
retry now that #18427 was merged |
Don't merge. I getting an exception while using nimsuggest:
|
@Araq is there anything else blocking this PR to be merged? there has been no pending review comment since 8 days ago Leaving PRs open for a long time guarantees bitrot and eventual demotivation from PR author, eventually joining the train of the 200+ open abandoned PRs where original author gave up, despite being in a mergeable state at some point. the concern regarding "how costly is this" was answered in #18418 (comment) |
Sorry, it said
Will test it on my machine wrt memory consumption and then merge it. |
that was fixed in the "fixed double string formatting bug" commit; |
Can confirm that the memory and CPU consumption is acceptable. |
Btw this needs a changelog entry. |
* added float32 schubfach algorithm; wip * fixes nim-lang#18418
* Extended side effect error messages * Applied feedback: - refactored `markSideEffect` - refactored string interpolations - single message - skip diagnostics in `system.compiles` context Other: - started a test of diagnostic messages [ci skip] Tests aren't updated yet because messaging isn't nailed down. * - Added hints of where for side effect call locations. - Tried to clarify the reasons. * fix tests * Applied PR review feedback: - moved collection of side effects from TSym to TContext - used pragma shorthand form `.sideEffect` and `.noSideEffect` in messages - added leading '>' to structured messages for readability - changed `sempass2.markSideEffect` to a proc - replaced `system.echo` in the test to make the test compatible with Windows * Applied NEP1 formatting suggestion Co-authored-by: quantimnot <[email protected]>
Fixes #4210
Fixes #10712
Is this the right approach?
Any desired changes to make the messages clearer?
All feedback is welcome.