diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-09-01 07:02:40 +0300 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-09-08 23:41:16 +0300 |
| commit | ca262a34acdde2f72d15535e9f535021a9cb8d62 (patch) | |
| tree | 6de7a4c1691c33deb9767374368ce6559b019aac /src/tools/rust-analyzer/editors/code | |
| parent | f16a03f3a96d5b82f30f46d979989ef3f529f031 (diff) | |
Automatically add semicolon when completing unit-returning functions
But provide a config to suppress that. I didn't check whether we are in statement expression position, because this is hard in completion (due to the natural incompleteness of source code when completion is invoked), and anyway using function returning unit as an argument to something seems... dubious.
Diffstat (limited to 'src/tools/rust-analyzer/editors/code')
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/package.json | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/editors/code/package.json b/src/tools/rust-analyzer/editors/code/package.json index 0b029460b32..b66f0a64d57 100644 --- a/src/tools/rust-analyzer/editors/code/package.json +++ b/src/tools/rust-analyzer/editors/code/package.json @@ -1030,6 +1030,16 @@ { "title": "completion", "properties": { + "rust-analyzer.completion.addSemicolonToUnit": { + "markdownDescription": "Whether to automatically add a semicolon when completing unit-returning functions.\n\nIn `match` arms it completes a comma instead.", + "default": true, + "type": "boolean" + } + } + }, + { + "title": "completion", + "properties": { "rust-analyzer.completion.autoimport.enable": { "markdownDescription": "Toggles the additional completions that automatically add imports when completed.\nNote that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.", "default": true, |
