~ruther/emacs.d

270007921cfba4ae2119b08be9c8ad5ce4ed2f22 — Rutherther 3 months ago 841bf65
feat: ensure rust analyzer runs on less threads
1 files changed, 7 insertions(+), 1 deletions(-)

M init.el
M init.el => init.el +7 -1
@@ 1464,13 1464,19 @@ minibuffer, even without explicitly focusing it."

  (add-hook 'rustic-mode-hook #'my/disable-on-type-formatting -100))

(setq lsp-rust-analyzer-num-threads 2) ;; Set to your desired number of cores
(my-use-package rust-mode
  :ensure t
  ;; Fix order in auto-mode-alist.
  :after rustic
  :after (rustic lsp-mode)
  :custom
  (rust-mode-treesitter-derive t)
  :config
  ;; This force-injects the setting into the lsp-mode configuration table
  (lsp-register-custom-settings
   '(("rust-analyzer.numThreads" lsp-rust-analyzer-num-threads)))
  (customize-set-variable 'lsp-rust-analyzer-cargo-target-dir "target/ra")

  (my/indent-variable-mode-alist-add rust-ts-mode rust-ts-mode-indent-offset)
  (add-hook 'rust-mode-hook #'my/disable-on-type-formatting -100))