IssueRaiser

rust-analyzer.toml

This is a tracking issue/discussion for a potential `rust-analyzer.toml`. There have been a lot of requests for a per-project configuration in various issues, some clients like VSCode allow specifying settings per workspace, but usually these kinds of settings are not committed in a repo and are therefor usually not meant to necessarily configure r-a for the project specifically (like certain coding style settings, think of import merging etc.). Other related things might be requiring a special built procedure for a cargo project, prime example being https://github.com/rust-lang/rust which currently has a few suggested config lines in the dev guide which a user has to specify manually when they check out the repo locally, see https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc. The idea is for the server to consume this file, so that you do not need a "rust-analyzer capable" LSP client to make use of it. So there is clearly a need for a project config option like this, but here are few open questions. - [x] We could make use of the `Cargo.toml` metadata section instead, but that would only solve the problem for cargo based projects and it feels wrong to have certain settings in there opposed to a `rust-analyzer.toml` I believe. - I believe a `rust-analyzer.toml` to be the correct solution here. - [ ] How does the priority work in regards to other mechanisms that set configurations? Ideally we'd favor a client's settings over

Posted by Veykril on Nov 2, 2022, 12:25 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

github (Sysadmin)

rust-analyzer.toml

VeykrilNov 2, 2022, 12:25 PM

This is a tracking issue/discussion for a potential `rust-analyzer.toml`. There have been a lot of requests for a per-project configuration in various issues, some clients like VSCode allow specifying settings per workspace, but usually these kinds of settings are not committed in a repo and are therefor usually not meant to necessarily configure r-a for the project specifically (like certain coding style settings, think of import merging etc.). Other related things might be requiring a special built procedure for a cargo project, prime example being https://github.com/rust-lang/rust which currently has a few suggested config lines in the dev guide which a user has to specify manually when they check out the repo locally, see https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc. The idea is for the server to consume this file, so that you do not need a "rust-analyzer capable" LSP client to make use of it. So there is clearly a need for a project config option like this, but here are few open questions. - [x] We could make use of the `Cargo.toml` metadata section instead, but that would only solve the problem for cargo based projects and it feels wrong to have certain settings in there opposed to a `rust-analyzer.toml` I believe. - I believe a `rust-analyzer.toml` to be the correct solution here. - [ ] How does the priority work in regards to other mechanisms that set configurations? Ideally we'd favor a client's settings over

Comments (0)

No comments yet. Start the discussion.

Comment on this issue