feat(vscode): declare rstack.fmt.trace.server for the rs fmt language client - #21
Merged
Conversation
… client The old stdin-based fmt stack logged `Formatting completed in Xms`; that line went away with the move to `rs fmt --lsp`, and the language client had no declared trace setting to fall back on. Align with the other LSP-based formatter extensions instead of re-adding a custom timing log: - Rename the client id to `rstack.fmt` so vscode-languageclient reads (and hot-reloads) `rstack.fmt.trace.server` on its own. - Point `traceOutputChannel` at the stack's output channel so trace lines (`Received response 'textDocument/formatting' in Xms`) land next to the other fmt logs instead of a separate per-folder channel. - Declare the setting in package.json and document it in the README.
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.
Summary
Since fmt moved to
rs fmt --lsp(#12) the oldFormatting completed in Xmsline is gone and there was no way to see how long a format request took: the language client's trace setting was neither declared nor namespaced (rstack-fmt.trace.serverworked only as an undeclared key).Align with how the other LSP-based formatter extensions expose this — a declared
<clientId>.trace.serverwhose trace lands in the main output channel — rather than re-adding a custom timing log:rstack-fmt→rstack.fmt, so vscode-languageclient readsrstack.fmt.trace.serverand hot-reloads it on change (no restart involved).traceOutputChannelto the stack's own channel, soReceived response 'textDocument/formatting - (n)' in Xmsshows up in Rstack: rs fmt next to the other logs instead of a separate per-folder "Trace" channel.rstack.fmt.trace.server(off/messages/verbose, defaultoff, scopewindow) inpackage.json; document it in the README.Verified:
pnpm lint,pnpm test:unit, andVSCODE_CLI=1 pnpm test:e2e vscodeall pass locally.Related Links
Checklist