Skip to content

Commit 74e5739

Browse files
Add settings for a couple of Rust Analyzer options (#4932)
* Add option for rust-analyzer.assist.preferSelf * Add option for rust-analyzer.completion.termSearch.enable
1 parent d0c391d commit 74e5739

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

clients/lsp-rust.el

Lines changed: 16 additions & 1 deletion
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
@@ -809,6 +816,12 @@ and field accesses with self prefixed to them when inside a method."
809816
:group 'lsp-rust-analyzer
810817
:package-version '(lsp-mode . "8.0.0"))
811818

819+
(defcustom lsp-rust-analyzer-completion-term-search-enable nil
820+
"Enable term search based snippets like `Some(foo.bar().baz())`."
821+
:type 'boolean
822+
:group 'lsp-rust-analyzer
823+
:package-version '(lsp-mode . "9.0.1"))
824+
812825
(defcustom lsp-rust-analyzer-import-enforce-granularity nil
813826
"Whether to enforce the import granularity setting for all files.
814827
If set to nil rust-analyzer will try to keep import styles consistent per file."
@@ -1783,11 +1796,13 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m
17831796
:typeHints ( :enable ,(lsp-json-bool lsp-inlay-hint-enable)
17841797
:hideClosureInitialization ,(lsp-json-bool lsp-rust-analyzer-hide-closure-initialization)
17851798
:hideNamedConstructor ,(lsp-json-bool lsp-rust-analyzer-hide-named-constructor)))
1799+
:assist ( :preferSelf ,(lsp-json-bool lsp-rust-analyzer-assist-prefer-self))
17861800
:completion ( :addCallParenthesis ,(lsp-json-bool lsp-rust-analyzer-completion-add-call-parenthesis)
17871801
:addCallArgumentSnippets ,(lsp-json-bool lsp-rust-analyzer-completion-add-call-argument-snippets)
17881802
:postfix (:enable ,(lsp-json-bool lsp-rust-analyzer-completion-postfix-enable))
17891803
:autoimport (:enable ,(lsp-json-bool lsp-rust-analyzer-completion-auto-import-enable))
1790-
:autoself (:enable ,(lsp-json-bool lsp-rust-analyzer-completion-auto-self-enable)))
1804+
:autoself (:enable ,(lsp-json-bool lsp-rust-analyzer-completion-auto-self-enable))
1805+
:termSearch (:enable ,(lsp-json-bool lsp-rust-analyzer-completion-term-search-enable)))
17911806
:callInfo (:full ,(lsp-json-bool lsp-rust-analyzer-call-info-full))
17921807
:procMacro (:enable ,(lsp-json-bool lsp-rust-analyzer-proc-macro-enable))
17931808
:rustcSource ,lsp-rust-analyzer-rustc-source

0 commit comments

Comments
 (0)