Parse and render stack frames in rwx lint output#369
Merged
Conversation
Parse relatedInformation from LSP diagnostic responses into StackTrace entries on CheckDiagnostic. Render stack frames in multiline output using the same "at name (file:line:col)" format as API error messages. The StackTrace field also appears in JSON output via default marshaling.
f70e0c1 to
570509c
Compare
jmsanders
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goes with rwx-cloud/language-server#30 and #370 (already merged)
Summary
StackTrace []messages.StackEntryfield toCheckDiagnosticrelatedInformationfrom LSP diagnostic responses into stack trace entries (stripsfile://prefix, converts 0-based to 1-based line/column)at name (file:line:col)formatStackTraceappears in JSON output via Go's default PascalCase marshalingContext
Depends on rwx-cloud/language-server#30, which populates
relatedInformationon LSP diagnostics from the parser's stack trace arrays. Without that change, the language server never emitsrelatedInformation, so this CLI code has nothing to parse.Before / After
rwx lint <file>Before
After
rwx lint <file> -o jsonBefore
After
Test plan
go test ./internal/... ./cmd/...passesgolangci-lint run ./...passesrwx lintand verify stack frames appear in multiline outputrwx lint -o jsonand verifyStackTraceappears on diagnosticsrwx lint -o onelineand verify no stack frames (by design)