diff options
| author | John Turner <jturner.usa@gmail.com> | 2025-12-12 03:25:24 +0000 |
|---|---|---|
| committer | John Turner <jturner.usa@gmail.com> | 2025-12-12 03:40:45 +0000 |
| commit | 8b700b0404b03f17d48ffef290601d0966588a57 (patch) | |
| tree | 9d200eedfa5e98145031e34289ffabd18e31ce5a | |
| parent | e67e20ef293e95763e7cdd012a1a7ca87eb2b0a2 (diff) | |
| download | gentoo-utils-8b700b0404b03f17d48ffef290601d0966588a57.tar.gz | |
create rust-analyzer.sh script
This script should be ran by the LSP server to get error diagnostics.
| -rw-r--r-- | .dir-locals.el | 4 | ||||
| -rwxr-xr-x | rust-analyzer.sh | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/.dir-locals.el b/.dir-locals.el index cccbb8c..b3e56f1 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -3,12 +3,12 @@ (rust-cargo-default-arguments . "-r") (eglot-workspace-configuration . (:rust-analyzer (:check - (:overrideCommand ["ninja" "clippy-json" "-C" "build"])))) + (:overrideCommand ["./rust-analyzer.sh"])))) (eval . (add-to-list 'eglot-server-programs '((rust-ts-mode rust-mode) . ("rust-analyzer" :initializationOptions (:check - (:overrideCommand ["ninja" "clippy-json" "-C" "build"])))))) + (:overrideCommand ["./rust-analyzer.sh"])))))) (eval . (eglot-ensure)) (eval . (company-mode 1)) (eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t)) diff --git a/rust-analyzer.sh b/rust-analyzer.sh new file mode 100755 index 0000000..a1240b2 --- /dev/null +++ b/rust-analyzer.sh @@ -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 |
