create rust-analyzer.sh script
This script should be ran by the LSP server to get error diagnostics.
This commit is contained in:
@@ -3,12 +3,12 @@
|
|||||||
(rust-cargo-default-arguments . "-r")
|
(rust-cargo-default-arguments . "-r")
|
||||||
(eglot-workspace-configuration . (:rust-analyzer
|
(eglot-workspace-configuration . (:rust-analyzer
|
||||||
(:check
|
(:check
|
||||||
(:overrideCommand ["ninja" "clippy-json" "-C" "build"]))))
|
(:overrideCommand ["./rust-analyzer.sh"]))))
|
||||||
(eval . (add-to-list 'eglot-server-programs
|
(eval . (add-to-list 'eglot-server-programs
|
||||||
'((rust-ts-mode rust-mode) .
|
'((rust-ts-mode rust-mode) .
|
||||||
("rust-analyzer" :initializationOptions
|
("rust-analyzer" :initializationOptions
|
||||||
(:check
|
(:check
|
||||||
(:overrideCommand ["ninja" "clippy-json" "-C" "build"]))))))
|
(:overrideCommand ["./rust-analyzer.sh"]))))))
|
||||||
(eval . (eglot-ensure))
|
(eval . (eglot-ensure))
|
||||||
(eval . (company-mode 1))
|
(eval . (company-mode 1))
|
||||||
(eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t))
|
(eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t))
|
||||||
|
|||||||
12
rust-analyzer.sh
Executable file
12
rust-analyzer.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# this script is a temporary workaround for not having a proper clippy-json target
|
||||||
|
|
||||||
|
source /etc/profile
|
||||||
|
|
||||||
|
cd build || exit $?
|
||||||
|
|
||||||
|
# compile as far as we can
|
||||||
|
ninja
|
||||||
|
|
||||||
|
ninja clippy-json
|
||||||
Reference in New Issue
Block a user