Skip to content

chore(lsp): introduce LanguageId struct#19285

Merged
graphite-app[bot] merged 1 commit intomainfrom
02-11-chore_lsp_introduce_languageid_enum
Feb 17, 2026
Merged

chore(lsp): introduce LanguageId struct#19285
graphite-app[bot] merged 1 commit intomainfrom
02-11-chore_lsp_introduce_languageid_enum

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Feb 11, 2026

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).

@github-actions github-actions bot added the A-editor Area - Editor and Language Server label Feb 11, 2026
Copy link
Member Author

Sysix commented Feb 11, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Feb 11, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 11, 2026

Merging this PR will not alter performance

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing 02-11-chore_lsp_introduce_languageid_enum (ec95217) with main (5707e5c)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (f46c68b) during the generation of this report, so 5707e5c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Sysix Sysix force-pushed the 02-11-chore_lsp_introduce_languageid_enum branch 4 times, most recently from 64f6abc to 66bb3a7 Compare February 11, 2026 22:09
@Sysix Sysix force-pushed the 02-11-chore_lsp_introduce_languageid_enum branch from 66bb3a7 to 4c9346f Compare February 12, 2026 22:05
@Sysix Sysix requested a review from Copilot February 12, 2026 22:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LanguageId enum with string conversions and re-export it from the crate.
  • Update LSPFileSystem to 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 languageId on textDocument/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.

@Sysix Sysix force-pushed the 02-11-chore_lsp_introduce_languageid_enum branch 2 times, most recently from a67ac66 to 76c4be8 Compare February 12, 2026 23:24
@Sysix Sysix marked this pull request as ready for review February 12, 2026 23:27
@Sysix Sysix requested a review from camc314 as a code owner February 12, 2026 23:27
@Sysix Sysix force-pushed the 02-11-chore_lsp_introduce_languageid_enum branch from 76c4be8 to 23751ee Compare February 14, 2026 13:16
@Sysix Sysix changed the title chore(lsp): introduce LanguageId enum chore(lsp): introduce LanguageId struct Feb 14, 2026
@Sysix Sysix force-pushed the 02-11-chore_lsp_introduce_languageid_enum branch 2 times, most recently from 7ac6368 to ec95217 Compare February 16, 2026 18:37
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 17, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 17, 2026

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).
@graphite-app graphite-app bot force-pushed the 02-11-chore_lsp_introduce_languageid_enum branch from ec95217 to 88ec03e Compare February 17, 2026 01:49
@graphite-app graphite-app bot merged commit 88ec03e into main Feb 17, 2026
21 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 17, 2026
@graphite-app graphite-app bot deleted the 02-11-chore_lsp_introduce_languageid_enum branch February 17, 2026 02:12
OskarLebuda pushed a commit to OskarLebuda/oxc that referenced this pull request Feb 17, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments