-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Config revamp #12010
Config revamp #12010
Conversation
020f910
to
68af7ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create a diff of the config changes later so that we can point people to that/derive a tool from it that allows people to easily migrate their configurations.
The diff is hard to read as I have sorted the configurations now, so I'd like if y'all could take a look at the config after my changes and see if it feels consistent and whether there are some outstanding issues with them.
One thing to note is, most toggles are now suffixed with _enabled
, for those that are toggles with intermediate states I added a small trick (see LifetimeElisionDef
), that would allow us to also expand on those config keys in the future.
Note the general idea here is to make the config format consistent and extensible for the future such that we can avoid the need for awkward config keys due to mistakes we've made or having to break the users configs again.
Also as CI shows, will have to do another check on things that I didn't break stuff by accident 😅 |
/// Whether to show HoverActions in Rust files. | ||
hoverActions_enable: bool = "true", | ||
hover_actions_enable: bool = "true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so some of these also have global enable toggles. I am unsure whether it makes sense to have them, part of me says part of me says no. Basically all they really allow is to easily turn everything off, but if one wants all enabled they have to have this enabled AND each thing separately as well.
So the question is, is it beneficial to have an easy way to disable everything in a category or not
1f5ae35
to
d49aaa8
Compare
|
||
/// Show function name and docs in parameter hints. | ||
callInfo_full: bool = "true", | ||
assist_expressionFillDefault: ExprFillDefaultDef = "\"todo\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using assist
here feels wrong to me, this isn't solely used by assists, similar to how the import stuff wasn't assist specific.
Alright, the client extension now updates all the simple renames. So the user is unfortunately required to manual update the following ones:
Simple reason for this being that updating these is a bit more wonky and I'd rather not have the extension touch more than necessary. |
2258cdf
to
24f35e6
Compare
7d2f4e6
to
67e95cb
Compare
Okay this is finished, as proposed in Zulip I'll merge this after the release on monday unless something comes up. |
☔ The latest upstream changes (presumably #12118) made this pull request unmergeable. Please resolve the merge conflicts. |
So I am inclined to merge this now (or tomorrow rather), any objections? |
@bors r+ |
📌 Commit 73df43f has been approved by |
☀️ Test successful - checks-actions |
…Veykril Fix obsolete config keys The config keys were drastically reorganized by #12010, but the docs don't reflect the updates, causing inconsistency and confusion. I checked for such obsolete configuration keys and updated to the new one. For reproducibility, I attach a small shell script that I used to examine the old keys. Now the script only detects `cargoExtraArgs` and `overrideCargo`, which originates from other type definition in the code but not from the configuration. <details><summary>script</summary> ```bash echo "allowMergingIntoGlobImports exprFillDefault importEnforceGranularity importGranularity importMergeBehavior importMergeBehaviour importGroup importPrefix warmup loadOutDirsFromCheck runBuildScripts runBuildScriptsCommand useRustcWrapperForBuildScripts enableExperimental procAttrMacros breakPoints exitPoints yieldPoints linksInHover linksInHover gotoTypeDef chainingHints closureReturnTypeHints hideNamedConstructorHints parameterHints reborrowHints typeHints lruCapacity cargoExtraArgs overrideCargo rustcSource enableRangeFormatting assist\.allowMergingIntoGlobImports assist\.exprFillDefault assist\.importEnforceGranularity assist\.importGranularity assist\.importMergeBehavior assist\.importMergeBehaviour assist\.importGroup assist\.importPrefix primeCaches\.enable cache\.warmup cargo\.loadOutDirsFromCheck cargo\.runBuildScripts cargo\.runBuildScriptsCommand cargo\.useRustcWrapperForBuildScripts completion\.snippets diagnostics\.enableExperimental experimental\.procAttrMacros highlighting\.strings highlightRelated\.breakPoints highlightRelated\.exitPoints highlightRelated\.yieldPoints highlightRelated\.references hover\.documentation hover\.linksInHover hoverActions\.linksInHover hoverActions\.debug hoverActions\.enable hoverActions\.gotoTypeDef hoverActions\.implementations hoverActions\.references hoverActions\.run inlayHints\.chainingHints inlayHints\.closureReturnTypeHints inlayHints\.hideNamedConstructorHints inlayHints\.parameterHints inlayHints\.reborrowHints inlayHints\.typeHints lruCapacity runnables\.cargoExtraArgs runnables\.overrideCargo rustcSource rustfmt\.enableRangeFormatting allFeatures addCallArgumentSnippets addCallParenthesis callInfo\.full cargo\.allFeatures checkOnSave\.allFeatures completion\.addCallArgumentSnippets completion\.addCallParenthesis" | while read -r pattern do rg '\b'$pattern'\b([^.]|$)' . -g "!crates/rust-analyzer/src/config/patch_old_style.rs" -g "!editors/code/src/config.ts" -g "!a.sh" --no-heading --color=always --line-number done exit excluded # debug # enable # run # implementations # references # documentation # references # snippets # strings # full ``` </details>
Fixes #11790
Fixes #12115
This PR changes a lot of config names, and a few ones are being merged or split apart. The reason for this is that our configuration names currently are rather inconsistent and some where poorly chosen in regards to extensability. This PR plans to fix that.
We still allow the old config names by patching them to the new ones before deserializing to keep backwards compatability with other clients (the VSCode client will auto update the config) but ideally we will get rid of that layer in the future.
Here is a list of the changes:
These are simple renames
old_name | alias1 | alias2 ... -> new_name
(the vscode client will fix these up automagically):These are configs that have been merged or split apart, which have to be manually updated by the user: