ruff/crates/ruff_server/src
Jane Lewis 632965d0fa
ruff server: Support a custom TOML configuration file (#11140)
## Summary

Closes #10985.

The server now supports a custom TOML configuration file as a client
setting. The setting must be an absolute path to a file. If the file is
called `pyproject.toml`, the server will attempt to parse it as a
pyproject file - otherwise, it will attempt to parse it as a `ruff.toml`
file, even if the file has a name besides `ruff.toml`.

If an option is set in both the custom TOML configuration file and in
the client settings directly, the latter will be used.

## Test Plan

1. Create a `ruff.toml` file outside of the workspace you are testing.
Set an option that is different from the one in the configuration for
your test workspace.
2. Set the path to the configuration in NeoVim:
```lua
require('lspconfig').ruff.setup {
    init_options = {
      settings = {
        configuration = "absolute/path/to/your/configuration"
      }
    }
}
```
3. Confirm that the option in the configuration file is used, regardless
of what the option is set to in the workspace configuration.
4. Add the same option, with a different value, to the NeoVim
configuration directly. For example:
```lua
require('lspconfig').ruff.setup {
    init_options = {
      settings = {
        configuration = "absolute/path/to/your/configuration",
        lint = {
          select = []
        }
      }
    }
}
```
5. Confirm that the option set in client settings is used, regardless of
the value in either the custom configuration file or in the workspace
configuration.
2024-04-26 23:46:07 +00:00
..
edit ruff server now supports source.fixAll source action (#10597) 2024-04-03 16:22:17 +00:00
server ruff server: In 'publish diagnostics' mode, document diagnostics are cleared properly when a file is closed (#11137) 2024-04-24 19:38:54 -07:00
session ruff server: Support a custom TOML configuration file (#11140) 2024-04-26 23:46:07 +00:00
edit.rs ruff server now supports commands for auto-fixing, organizing imports, and formatting (#10654) 2024-04-05 23:27:35 +00:00
fix.rs ruff server now supports source.fixAll source action (#10597) 2024-04-03 16:22:17 +00:00
format.rs ruff server - A new built-in LSP for Ruff, written in Rust (#10158) 2024-03-08 20:57:23 -08:00
lib.rs ruff server: Important errors are now shown as popups (#10951) 2024-04-16 18:32:53 +00:00
lint.rs ruff server now supports commands for auto-fixing, organizing imports, and formatting (#10654) 2024-04-05 23:27:35 +00:00
message.rs ruff server: Important errors are now shown as popups (#10951) 2024-04-16 18:32:53 +00:00
server.rs Implement hover menu support for ruff-server; Issue #10595 (#11096) 2024-04-23 20:16:02 +00:00
session.rs ruff server: Ruff configuration from client settings overrides project configuration (#11062) 2024-04-23 11:19:17 -07:00