chore(lsp): update tower-lsp-server to 0.24.0-rc.1 - #26574
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
|
6849304 to
b2ce755
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Unresolved URI-scheme handling regressions affect worker and formatter workflows.
Pull request overview
Migrates Oxc’s LSP integrations to tower-lsp-server 0.24.0-rc.1 and gen-lsp-types, replacing the removed UriExt helpers.
Changes:
- Updates LSP types, capabilities, diagnostics, code actions, and handlers.
- Adds repository-owned URI/path conversion utilities.
- Refreshes dependencies, tests, and LSP snapshots.
File summaries
| File | Reviewed change |
|---|---|
crates/oxc_language_server/src/worker.rs |
Migrates worker LSP types and handling. |
crates/oxc_language_server/src/worker_manager.rs |
Updates URI handling and worker management. |
crates/oxc_language_server/src/uri_utils.rs |
Adds URI/path conversion helpers and tests. |
crates/oxc_language_server/src/tool.rs |
Updates tool code-action types. |
crates/oxc_language_server/src/tool_params.rs |
Migrates tool parameter types. |
crates/oxc_language_server/src/tests.rs |
Updates LSP test requests and assertions. |
crates/oxc_language_server/src/position.rs |
Migrates position types. |
crates/oxc_language_server/src/options.rs |
Updates URI and option handling. |
crates/oxc_language_server/src/lib.rs |
Exposes URI utilities and new types. |
crates/oxc_language_server/src/file_system.rs |
Uses shared URI conversion. |
crates/oxc_language_server/src/capabilities.rs |
Migrates server capabilities. |
crates/oxc_language_server/src/backend.rs |
Updates backend handlers and diagnostics. |
crates/oxc_language_server/Cargo.toml |
Updates dependencies and features. |
Cargo.toml |
Updates the LSP server dependency. |
Cargo.lock |
Refreshes dependency resolution. |
apps/oxlint/src/lsp/utils.rs |
Migrates LSP range types. |
apps/oxlint/src/lsp/tester.rs |
Updates LSP test utilities. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint@no-floating-promises__index.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_tsgolint_type_aware_config@test-with-lsp-config.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected]_nested__test.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_ts_path_alias@deep__src__dep-a.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_multiple_suggestions@forward_ref.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_issue_22758_apps_api@app__auth__guard__firebase.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected]_invalid.vue.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected]_another_config__not-ignored-file.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_frameworks@astro__debugger.astro_vue__debugger.vue_svelte__debugger.svelte_nextjs__[[..rest]]__debugger.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/fixtures_lsp_deny_no_console@hello_world.js.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected]_folder__folder-dep-a.ts.snap |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/snapshots/[email protected] |
Refreshes the generated snapshot. |
apps/oxlint/src/lsp/server_linter.rs |
Migrates linter LSP APIs and URI handling. |
apps/oxlint/src/lsp/error_with_position.rs |
Updates diagnostic representations. |
apps/oxlint/src/lsp/code_actions.rs |
Migrates code-action types. |
apps/oxlint/Cargo.toml |
Updates LSP feature configuration. |
apps/oxfmt/src/lsp/server_formatter.rs |
Migrates formatter APIs and URI handling. |
apps/oxfmt/src/lsp/mod.rs |
Updates formatter URI imports. |
apps/oxfmt/Cargo.toml |
Updates LSP feature configuration. |
Review details
Suppressed comments (6)
apps/oxfmt/src/lsp/server_formatter.rs:241
- This textual prefix check changes the previous scheme-based behavior: a valid
file:/path/to/file.jsURI takes the in-memory formatting branch, which can fail withIn-memory formatting requires content, instead of reading and formatting the file. Test the parsed URI scheme here rather than matching onlyfile://.
let (result, source_text) = if document.uri.as_ref().starts_with("file://") {
crates/oxc_language_server/src/backend.rs:684
- The single-file worker is now created only for strings beginning with
file://. For a validfile:/path/to/file.jsURI,did_openskips worker creation, so the file is stored but never linted or formatted through a workspace. Check the parsed URI scheme instead of requiring this exact textual prefix.
crates/oxc_language_server/src/uri_utils.rs:82 - This changes the common URI-to-path conversion from the removed
UriExt's borrowedCow<Path>result to an ownedPathBuf, so every unescaped file URI now allocates. The helper is used on frequent lint/format requests and workspace lookups; please preserve the borrowed fast path (allocating only when decoding or platform conversion requires it), or otherwise measure and justify this regression.
crates/oxc_language_server/src/uri_utils.rs:108 - This documentation says
Noneis returned when the file does not exist, but absolute paths bypassstrict_canonicalizeat lines 111-113 and are converted even when they do not exist; only relative paths are checked. Please document the actual behavior or add an existence check for absolute paths if that contract is intended.
crates/oxc_language_server/src/uri_utils.rs:109 - This adds a second non-trivial path-to-URI encoder alongside the existing
from_file_pathimplementation incrates/oxc_diagnostics/src/service.rs:251-310. Maintaining both copies makes future URI/path fixes—especially platform-specific encoding changes—easy to apply in one subsystem but not the other; please centralize the shared conversion logic in a lower-level module.
crates/oxc_language_server/src/worker_manager.rs:225 - This replaces the parsed scheme check with a raw
file://prefix check. A valid URI with thefilescheme but a single-slash form such asfile:/path/to/file.jsis now treated as non-file and routed to the fallback worker, changing the previous behavior. Use the parsed URI scheme here, and apply the same correction to the single-file and formatter checks.
- Files reviewed: 47/48 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
b2ce755 to
01f029d
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The broad breaking LSP migration warrants final human validation.
Review details
Suppressed comments (3)
crates/oxc_language_server/src/uri_utils.rs:76
- Returning an owned
PathBufhere loses theCow<Path>behavior of the removedUriExt: ordinary unescaped URIs could previously borrow their path. This helper is used on per-file lint/format and worker-lookup paths, so the migration now allocates for every URI conversion; preserve a borrowedCowreturn and materialize only where ownership is required.
crates/oxc_language_server/src/uri_utils.rs:3 - Please fix the grammar in this new module comment (
this util functions).
crates/oxc_language_server/src/worker.rs:517 - The fallback panic still names the removed
GlobPattern::Stringvariant, so a failed assertion now reports the wrong expected variant. Update the message toGlobPattern::Patternto match the branch above.
- Files reviewed: 47/48 changed files
- Comments generated: 1
- Review effort level: Lite
01f029d to
51af350
Compare

This is a (draft) PR for the upcoming
tower-lsp-serverversion.The new version has many breaking changes like:
gen-lsp-typeUriExtChanges
gen_lsp_typeUriExtinto aoxc_language_server.https://github.com/tower-lsp-community/ls-types/blob/a6feea6c723b3314d80c69e66b452978f62f6afb/src/uri.rs