Description
There should be an editor-agnostic way of configuring language servers. We can do this using a custom file, .language-servers.toml
, the format of which will be explained below
Example use-case
Today, I wanted to use nightly rustfmt with stable rust, and have my editor (Helix) automatically format Rust files using nightly rustfmt. To do this, I have to add +nightly
to rustfmt argument in the rust-analyzer
language server as follows:
[language-server.rust-analyzer.config]
rustfmt.extraArgs = "+nightly"
Contributors to my project will need to have a custom config file created for them (e.g. .vscode/*
, .zed/*
) to configure rust-analyzer
in a similar fashion to how it is done in Helix
In the end we will need to have a separate config file for every editor to properly work. This is pretty cumbersome, so it would be nice to have a single file that any editor can read.
.language-servers.toml
file
Example format:
[rust-analyzer.config]
rustfmt.extraArgs = "+nightly"
The editor will then pass the config to the appropriate language server.
All configuration options are listed under the [${language-server}.config]
field