Skip to content

Commit 033a446

Browse files
Add option for rust-analyzer.assist.preferSelf
1 parent 6529610 commit 033a446

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

clients/lsp-rust.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,13 @@ available on a nightly build."
724724
:group 'lsp-rust-analyzer
725725
:package-version '(lsp-mode . "9.0.0"))
726726

727+
(defcustom lsp-rust-analyzer-assist-prefer-self nil
728+
"Prefer to use `Self` over the type name when inserting a type (e.g. in “fill
729+
match arms” assist)."
730+
:type 'boolean
731+
:group 'lsp-rust-analyzer
732+
:package-version '(lsp-mode . "9.0.1"))
733+
727734
(defcustom lsp-rust-analyzer-completion-add-call-parenthesis t
728735
"Whether to add parenthesis when completing functions."
729736
:type 'boolean
@@ -1783,6 +1790,7 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
17831790
:typeHints ( :enable ,(lsp-json-bool lsp-inlay-hint-enable)
17841791
:hideClosureInitialization ,(lsp-json-bool lsp-rust-analyzer-hide-closure-initialization)
17851792
:hideNamedConstructor ,(lsp-json-bool lsp-rust-analyzer-hide-named-constructor)))
1793+
:assist ( :preferSelf ,(lsp-json-bool lsp-rust-analyzer-assist-prefer-self))
17861794
:completion ( :addCallParenthesis ,(lsp-json-bool lsp-rust-analyzer-completion-add-call-parenthesis)
17871795
:addCallArgumentSnippets ,(lsp-json-bool lsp-rust-analyzer-completion-add-call-argument-snippets)
17881796
:postfix (:enable ,(lsp-json-bool lsp-rust-analyzer-completion-postfix-enable))

0 commit comments

Comments
 (0)