ruff/crates/ruff_server
Jane Lewis 16a1f3cbcc
ruff server: Support setting to prioritize project configuration over editor configuration (#11086)
## Summary

This is intended to address
https://github.com/astral-sh/ruff-vscode/issues/425, and is a follow-up
to https://github.com/astral-sh/ruff/pull/11062.

A new client setting is now supported by the server,
`prioritizeFileConfiguration`. This is a boolean setting (default:
`false`) that, if set to `true`, will instruct the configuration
resolver to prioritize file configuration (aka discovered TOML files)
over configuration passed in by the editor.

A corresponding extension PR has been opened, which makes this setting
available for VS Code:
https://github.com/astral-sh/ruff-vscode/pull/457.

## Test Plan

To test this with VS Code, you'll need to check out [the VS Code
PR](https://github.com/astral-sh/ruff-vscode/pull/457) that adds this
setting.

The test process is similar to
https://github.com/astral-sh/ruff/pull/11062, but in scenarios where the
editor configuration would take priority over file configuration, file
configuration should take priority.
2024-04-26 08:17:28 +00:00
..
docs/setup ruff server: fix Neovim setup guide command (#11021) 2024-04-19 08:24:09 +05:30
resources/test/fixtures ruff server: Introduce settings for directly configuring the linter and formatter (#10984) 2024-04-18 07:53:48 +00:00
src ruff server: Support setting to prioritize project configuration over editor configuration (#11086) 2024-04-26 08:17:28 +00:00
tests ruff server - A new built-in LSP for Ruff, written in Rust (#10158) 2024-03-08 20:57:23 -08:00
Cargo.toml Use crossbeam-channel instead of crossbeam (#11129) 2024-04-24 13:56:55 +00:00
CONTRIBUTING.md High-level project overview and contributing guide for ruff server (#10565) 2024-03-25 23:08:37 -07:00
README.md ruff server: Write a setup guide for Neovim (#10987) 2024-04-18 02:46:30 +00:00

The Ruff Language Server

Welcome! ruff server is a language server that powers editor integrations with Ruff. 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 create 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.

Setup

We have specific setup instructions depending on your editor. If you don't see your editor on this list and would like a setup guide, please open an issue.

  • Visual Studio Code: Install the Ruff extension from the VS Code Marketplace. The language server used by the extension will be, by default, the one in your actively-installed ruff binary. If you don't have ruff installed and haven't provided a path to the extension, it comes with a bundled ruff version that it will use instead. Since the new Ruff language server has not yet been stabilized, you will need to use the pre-release version of the extension and enable the Experimental Server setting.
  • Neovim: See the Neovim setup guide.

Contributing

If you're interested in contributing to ruff server - well, first of all, thank you! Second of all, you might find the contribution guide to be a useful resource. Finally, don't hesitate to reach out on our Discord if you have questions.