ruff/crates/ruff_server
Brent Westbrook d6009eb942
Unify Message variants (#18051)
## Summary

This PR unifies the ruff `Message` enum variants for syntax errors and
rule violations into a single `Message` struct consisting of a shared
`db::Diagnostic` and some additional, optional fields used for some rule
violations.

This version of `Message` is nearly a drop-in replacement for
`ruff_diagnostics::Diagnostic`, which is the next step I have in mind
for the refactor.

I think this is also a useful checkpoint because we could possibly add
some of these optional fields to the new `Diagnostic` type. I think
we've previously discussed wanting support for `Fix`es, but the other
fields seem less relevant, so we may just need to preserve the `Message`
wrapper for a bit longer.

## Test plan

Existing tests

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-19 13:34:04 -04:00
..
assets Update documentation for ruff server with new migration guide (#11499) 2024-05-22 14:36:33 -07:00
docs Add docs for Ruff language server (#12344) 2024-07-18 17:41:43 +05:30
resources/test/fixtures Expand ruff.configuration to allow inline config (#16296) 2025-02-26 10:17:11 +05:30
src Unify Message variants (#18051) 2025-05-19 13:34:04 -04:00
tests Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
Cargo.toml Fallback to requires-python in certain cases when target-version is not found (#16721) 2025-03-14 09:36:51 +01:00
CONTRIBUTING.md High-level project overview and contributing guide for ruff server (#10565) 2024-03-25 23:08:37 -07:00
README.md Add docs for Ruff language server (#12344) 2024-07-18 17:41:43 +05:30

The Ruff Language Server

ruff server is a language server that powers Ruff's editor integrations.

The job of the language server is to listen for requests from the client (in this case, the code editor of your choice) and call into Ruff's linter and formatter crates to construct real-time diagnostics or formatted code, which is then sent back to the client. It also tracks configuration files in your editor's workspace, and will refresh its in-memory configuration whenever those files are modified.

Refer to the documentation for more information on how to set up the language server with your editor and configure it to your liking.

Contributing

Contributions are welcome and highly appreciated. To get started, check out the contributing guidelines.

You can also join us on Discord.