From 49fa0eb9ccaff3f6a30a946c723cdeee58962f56 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 21 Sep 2023 16:56:59 -0400 Subject: [PATCH] Disable on-type formatting in rust. This was injecting parenthesis into the wrong location. --- ansible/roles/emacs/files/elisp/lang-rust.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/emacs/files/elisp/lang-rust.el b/ansible/roles/emacs/files/elisp/lang-rust.el index bc91069..169547b 100644 --- a/ansible/roles/emacs/files/elisp/lang-rust.el +++ b/ansible/roles/emacs/files/elisp/lang-rust.el @@ -38,6 +38,10 @@ :hook ( (rust-ts-mode . (lambda () (eglot-ensure) + ;; Disable on-type formatting which was incorrectly injecting parenthesis into my code. + (make-local-variable 'eglot-ignored-server-capabilities) + (add-to-list 'eglot-ignored-server-capabilities :documentOnTypeFormattingProvider) + ;; Configure initialization options (let ((rust-analyzer-command (locate-rust-analyzer))) (when rust-analyzer-command ;; (add-to-list 'eglot-server-programs `(rust-ts-mode . (,rust-analyzer-command)))