chore(lsp): introduce LanguageId struct#19285
Conversation
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. |
Merging this PR will not alter performance
Comparing Footnotes
|
64f6abc to
66bb3a7
Compare
66bb3a7 to
4c9346f
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a LanguageId enum to represent LSP languageId values and threads that information through the in-memory LSPFileSystem, enabling tools to pick an appropriate parser strategy even when a file has no extension (e.g., newly created/untitled documents).
Changes:
- Add
LanguageIdenum with string conversions and re-export it from the crate. - Update
LSPFileSystemto store(LanguageId, String)and add APIs to set/get language IDs. - Update backend/worker code paths to accommodate the new file system value type and persist
languageIdontextDocument/didOpen.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_language_server/src/worker.rs | Adjusts diagnostic rerun logic to extract content from (LanguageId, String) tuples. |
| crates/oxc_language_server/src/lib.rs | Wires in the new language_id module and re-exports LanguageId. |
| crates/oxc_language_server/src/language_id.rs | Introduces the LanguageId enum and string-to-enum conversions. |
| crates/oxc_language_server/src/file_system.rs | Changes in-memory storage to include LanguageId and adds language-aware setters/getters. |
| crates/oxc_language_server/src/backend.rs | Stores languageId on didOpen and updates file-content reads to match the new tuple type. |
a67ac66 to
76c4be8
Compare
76c4be8 to
23751ee
Compare
LanguageId enumLanguageId struct
7ac6368 to
ec95217
Compare
Merge activity
|
related oxc-project/oxc-vscode#25 > This PR introduces a `LanguageId` enum to represent LSP `languageId` values and threads that information through the in-memory `LSPFileSystem`, enabling tools to pick an appropriate parser strategy even when a file has no extension (e.g., newly created/untitled documents).
ec95217 to
88ec03e
Compare
related oxc-project/oxc-vscode#25 > This PR introduces a `LanguageId` enum to represent LSP `languageId` values and threads that information through the in-memory `LSPFileSystem`, enabling tools to pick an appropriate parser strategy even when a file has no extension (e.g., newly created/untitled documents).

related oxc-project/oxc-vscode#25