Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ All settings live under the unified `rstack.*` namespace. There are no `rslint.*
| `rstack.rstest.terminalShellPath` | — | Shell used by **Run in Terminal**. |
| `rstack.rstest.terminalShellArgs` | `[]` | Shell args for **Run in Terminal**. |
| `rstack.fmt.enable` | `true` | Enable/disable the formatter integration. |
| `rstack.fmt.trace.server` | `off` | LSP trace level (`off` / `messages` / `verbose`); `messages` logs each formatting request's duration. |

To use `rs fmt` as the formatter for supported documents, opt in through your VS Code settings: `"editor.defaultFormatter": "rstack.rstack"`. The extension never changes `editor.defaultFormatter` itself.

Expand Down
12 changes: 12 additions & 0 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@
"default": true,
"scope": "window",
"markdownDescription": "Enable the `rs fmt` document formatter for detected workspace folders. Requires `#rstack.enable#`. This is a window-level kill switch; which folders are formatted is decided by detection."
},
"rstack.fmt.trace.server": {
"order": 1,
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"scope": "window",
"description": "Traces the communication between VS Code and the rs fmt language server (`messages` also shows how long each formatting request took)"
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion packages/vscode/src/stacks/fmt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,12 @@ class FmtFolderRuntime {
);
this.#owner = owner;
const serverOptions: ServerOptions = async () => owner.start();
// The id doubles as the configuration section vscode-languageclient reads
// `trace.server` from (and hot-reloads on change), so it must equal the
// declared `rstack.fmt.trace.server` prefix — the same pairing Biome
// (`biome.lsp`) and Oxc (`oxc`) rely on.
const client = new FmtLanguageClient(
'rstack-fmt',
'rstack.fmt',
`rs fmt Language Server (${this.folder.name})`,
serverOptions,
this.createClientOptions(),
Expand Down Expand Up @@ -481,6 +485,9 @@ class FmtFolderRuntime {
// rslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
documentSelector as unknown as LanguageClientOptions['documentSelector'],
outputChannel: this.context.output,
// Trace lines land in the stack's own channel next to its other logs
// instead of a separate "... Trace" channel per folder.
traceOutputChannel: this.context.output,
errorHandler,
};
}
Expand Down