about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/editors/code
diff options
context:
space:
mode:
authorChayim Refael Friedman <chayimfr@gmail.com>2025-06-06 16:34:53 +0300
committerChayim Refael Friedman <chayimfr@gmail.com>2025-06-06 16:34:53 +0300
commit2a473e5aa6c8869dfef3891e32c77085338e4f46 (patch)
tree68fbc8c23303bafdb74b69e1af1d15db55a8a4d9 /src/tools/rust-analyzer/editors/code
parent337c2d993b00cf727be28e6e1435fbbca17c9f2a (diff)
In "Fill match arms", allow users to prefer `Self` to the enum name when possible
But default to not to.

I chose to have a more generic config name because maybe other assists could also use the same approach.
Diffstat (limited to 'src/tools/rust-analyzer/editors/code')
-rw-r--r--src/tools/rust-analyzer/editors/code/package.json10
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 c8c36cd85c8..398d0c51e9a 100644
--- a/src/tools/rust-analyzer/editors/code/package.json
+++ b/src/tools/rust-analyzer/editors/code/package.json
@@ -683,6 +683,16 @@
             {
                 "title": "assist",
                 "properties": {
+                    "rust-analyzer.assist.preferSelf": {
+                        "markdownDescription": "When inserting a type (e.g. in \"fill match arms\" assist), prefer to use `Self` over the type name where possible.",
+                        "default": false,
+                        "type": "boolean"
+                    }
+                }
+            },
+            {
+                "title": "assist",
+                "properties": {
                     "rust-analyzer.assist.termSearch.borrowcheck": {
                         "markdownDescription": "Enable borrow checking for term search code assists. If set to false, also there will be more suggestions, but some of them may not borrow-check.",
                         "default": true,