refactor(oxfmt/lsp): pass LanguageId to run_format#19286
refactor(oxfmt/lsp): pass LanguageId to run_format#19286graphite-app[bot] merged 1 commit intomainfrom
LanguageId to run_format#19286Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
LanguageId to run_formatLanguageId to run_format
Merging this PR will not alter performance
Comparing Footnotes
|
66bb3a7 to
4c9346f
Compare
a9b1aca to
10b8c79
Compare
598a1c1 to
a67ac66
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the language server formatting pipeline so that a document’s LanguageId (from textDocument/didOpen) is propagated down into tool formatting hooks, enabling formatters to make decisions even when file extensions are missing.
Changes:
- Extend the
Tool::run_formathook to accept&LanguageId. - Thread
LanguageIdthroughBackend::formatting→WorkspaceWorker::format_file→Tool::run_format. - Update the oxfmt LSP formatter tool implementation to match the new trait signature.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_language_server/src/tool.rs | Extends Tool::run_format to accept a LanguageId parameter. |
| crates/oxc_language_server/src/worker.rs | Updates format_file to forward LanguageId into run_format. |
| crates/oxc_language_server/src/backend.rs | Fetches (LanguageId, content) from the in-memory FS and passes both into format_file. |
| apps/oxfmt/src/lsp/server_formatter.rs | Adjusts ServerFormatter’s run_format signature to match the updated trait. |
10b8c79 to
bfe263c
Compare
a67ac66 to
76c4be8
Compare
bfe263c to
e4fa5ef
Compare
76c4be8 to
23751ee
Compare
e4fa5ef to
001e002
Compare
23751ee to
7ac6368
Compare
7ac6368 to
ec95217
Compare
001e002 to
5d5aa58
Compare
Merge activity
|
related oxc-project/oxc-vscode#25 > This PR updates the language server formatting pipeline so that a document’s `LanguageId` (from `textDocument/didOpen`) is propagated down into tool formatting hooks, enabling formatters to make decisions even when file extensions are missing.
ec95217 to
88ec03e
Compare
5d5aa58 to
0eb9a2d
Compare
…9286) related oxc-project/oxc-vscode#25 > This PR updates the language server formatting pipeline so that a document’s `LanguageId` (from `textDocument/didOpen`) is propagated down into tool formatting hooks, enabling formatters to make decisions even when file extensions are missing.

related oxc-project/oxc-vscode#25