ruff/crates/ruff_server/src
Zanie Blue 9cdac2d6fb
Add support for using uv as an alternative formatter backend (#19665)
This adds a new `backend: internal | uv` option to the LSP
`FormatOptions` allowing users to perform document and range formatting
operations though uv. The idea here is to prototype a solution for users
to transition to a `uv format` command without encountering version
mismatches (and consequently, formatting differences) between the LSP's
version of `ruff` and uv's version of `ruff`.

The primarily alternative to this would be to use uv to discover the
`ruff` version used to start the LSP in the first place. However, this
would increase the scope of a minimal `uv format` command beyond "run a
formatter", and raise larger questions about how uv should be used to
coordinate toolchain discovery. I think those are good things to
explore, but I'm hesitant to let them block a `uv format`
implementation. Another downside of using uv to discover `ruff`, is that
it needs to be implemented _outside_ the LSP; e.g., we'd need to change
the instructions on how to run the LSP and implement it in each editor
integration, like the VS Code plugin.

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
2025-09-09 20:39:53 +05:30
..
edit Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
server Add support for using uv as an alternative formatter backend (#19665) 2025-09-09 20:39:53 +05:30
session Add support for using uv as an alternative formatter backend (#19665) 2025-09-09 20:39:53 +05:30
edit.rs Split SourceLocation into LineColumn and SourceLocation (#17587) 2025-04-27 11:27:33 +01:00
fix.rs Consider virtual path for various server actions (#18910) 2025-06-24 12:24:28 +00:00
format.rs Add support for using uv as an alternative formatter backend (#19665) 2025-09-09 20:39:53 +05:30
lib.rs Support cancellation requests (#18627) 2025-06-12 22:08:42 +02:00
lint.rs Move fix suggestion to subdiagnostic (#19464) 2025-07-22 10:03:58 -04:00
logging.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
resolve.rs Root exclusions in the server to project root (#16043) 2025-02-10 04:57:14 +00:00
server.rs Support cancellation requests (#18627) 2025-06-12 22:08:42 +02:00
session.rs Support cancellation requests (#18627) 2025-06-12 22:08:42 +02:00
workspace.rs Centralize client options validation (#18623) 2025-06-12 18:58:30 +02:00