Ok, so you are asking about the configuration options listed in the rust-analyzer documentation.
I wasn’t able to find out much about the subject in the lsp-mode
documentation, so instead I took a quick peek in the lsp-rust
source code. I soon found that there is a function called lsp-rust-analyzer--make-init-options
that returns the data structure that will be encoded as JSON and sent to the server. You can view the source inside Emacs (type C-h f
and enter the function name; it opens a help buffer for the function which includes a link to its source code), but it is also viewable on GitHub.
If you look through this giant thing, you’ll eventually see :cargo
and :procMacro
sections. Specifically, you’ll see this:
:procMacro (:enable ,(lsp-json-bool lsp-rust-analyzer-proc-macro-enable))
which uses the variable lsp-rust-analyzer-proc-macro-enable
to enable or disable support for procedural macros. Similarly:
:cargo (…
:loadOutDirsFromCheck ,(lsp-json-bool lsp-rust-analyzer-cargo-run-build-scripts)
…)
does the same thing with the lsp-rust-analyzer-cargo-run-build-scripts
variable.
Both of these variables refer to customizable settings. To edit them, you can just run M-x customize-group
, and then type lsp-rust-analyzer
at the prompt. This lists all of the settings for the lsp-rust-analyzer
module, and gives you a nice interface for editing them.
It also turns out that these variables are both documented in the lsp-mode
documentation; I had simply failed to notice them.