Skip to content

Commit

Permalink
lsp-rust/rust-analyzer: expose experimental_procAttrMacros setting
Browse files Browse the repository at this point in the history
this config flag was added in rust-lang/rust-analyzer#9128

when enabled, the existing `lsp-rust-analyzer-expand-macro` function will also
expand proc macro attributes

as this is an experimental feature, the default value of the setting is nil
  • Loading branch information
japaric authored and brotzeit committed Aug 21, 2021
1 parent d904e8a commit a2b98b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion clients/lsp-rust.el
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,12 @@ https://rust-analyzer.github.io/manual.html#auto-import.
:group 'lsp-rust-analyzer
:package-version '(lsp-mode . "7.1.0"))

(defcustom lsp-rust-analyzer-experimental-proc-attr-macros nil
"Whether to enable experimental support for expanding proc macro attributes."
:type 'boolean
:group 'lsp-rust-analyzer
:package-version '(lsp-mode . "7.1.0"))

(defun lsp-rust-analyzer--make-init-options ()
"Init options for rust-analyzer"
`(:diagnostics (:enable ,(lsp-json-bool lsp-rust-analyzer-diagnostics-enable)
Expand Down Expand Up @@ -660,7 +666,8 @@ https://rust-analyzer.github.io/manual.html#auto-import.
:callInfo (:full ,(lsp-json-bool lsp-rust-analyzer-call-info-full))
:procMacro (:enable ,(lsp-json-bool lsp-rust-analyzer-proc-macro-enable))
:rustcSource ,lsp-rust-analyzer-rustc-source
:highlighting (:strings ,(lsp-json-bool lsp-rust-analyzer-highlighting-strings))))
:highlighting (:strings ,(lsp-json-bool lsp-rust-analyzer-highlighting-strings))
:experimental (:procAttrMacros ,(lsp-json-bool lsp-rust-analyzer-experimental-proc-attr-macros))))

(defconst lsp-rust-notification-handlers
'(("rust-analyzer/publishDecorations" . (lambda (_w _p)))))
Expand Down

0 comments on commit a2b98b0

Please sign in to comment.