-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read rust-analyzer configuration from Cargo.toml? #6113
Comments
Depending on the priorities, a possible downside here (for open-source projects) is that you might get the settings the project author likes, not what you'd like to use. |
True, and I would suggest it be used sparingly for that reason. I was thinking along the lines of |
Could user specific overrides go into |
Traditionally, |
|
Tough question. On the one hand, this is definitely an upstream issue. Configuration handling in LSP is just a mess, and "ability to share lsp config in an editor-agnostic way" is something that, imo, should be solved at the protocol level. On the other hand, I doubt that this will ever be fixed upstream. So we can do one of the following:
|
I feel like consistency with other Rust tooling would be more useful than consistency with other LSP servers anyway? |
I was just pointed to this issue since we've been having the discussion on the rust-embedded channel. I fully agree with the motivation and would like to second it. Regarding the actual implementation, I'd very much favour:
That'd allow projects to check in a useful configuration (those actually do exist for embedded cases) and in other cases people to create their own preferred configuration without having to work around Cargo.toml modifications all the time. |
Somewhat related, #6776 documents our current configs. |
IMO we should go with |
And maybe a separate setting that enables or disables support for it (to give users the final say, unless the project author overrides it in .vscode/settings.json 😕). |
I do think that editor's preferences should override the |
I really want something like this so I can enable features during development that aren't part of the default feature set. I work in a large workspace so I can't just turn them on in VSCode's Workspace settings as the features only apply to a specific crate within the workspace. So being able to read them from And on that note, any such support for this does need to handle the case of a project within a workspace (in my case, a virtual manifest workspace). Even if I have the whole workspace open in VSCode, rust-analyzer should pick up feature settings on a per-crate basis for each workspace member. |
Yes, I think everything in here has been noted down in that issue (except for one small thing that I'll add). |
Would it be possible to read configuration options from
Cargo.toml
? Then they could be specified in an editor-neutral way, something like:I think snake-case would be more idiomatic for
Cargo.toml
, but I don't know how deep we'd want to get into translating names. There's also a mismatch between the usualdefault_features = false
and RA'snoDefaultFeatures
.The text was updated successfully, but these errors were encountered: