From 831f873dec6b59979f4e670a5633667bf2b55656 Mon Sep 17 00:00:00 2001 From: John Doty Date: Fri, 26 May 2023 13:59:40 -0700 Subject: [PATCH] More better clangds --- .emacs.d/init.el | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e91a9bf..c2ce388 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -329,13 +329,11 @@ ;; Common configuration for LSP-based systems. ;; ================================================================= (defvar my-clangd-executable - (executable-find "clangd") + (or (executable-find "clangd-mp-14") ;; Support newer clangd + (executable-find "cppls-wrapper") + (executable-find "clangd")) "Path to the clangd binary.") -(defvar my-cppls-fbcode-executable - (executable-find "cppls-wrapper") - "The path to the fbcode C++ language service wrapper.") - (defvar my-pylsp-executable (executable-find "pylsp") "The path to the python-lsp-server binary.") @@ -353,12 +351,11 @@ (flycheck-mode (if (eglot-managed-p) -1 nil))) (defun my-eglot-connect-hook (server) - "Connect to SERVER. Don't send configuration information in C or C++." + "Connect to SERVER. Don't send configuration information in C or C++." (unless (or (eq major-mode 'c++-mode) (eq major-mode 'c-mode)) (eglot-signal-didChangeConfiguration server))) - (use-package eglot :ensure :commands (eglot-ensure eglot) :hook @@ -371,11 +368,9 @@ :bind ("C-c \\" . eglot-code-actions) ;; 2022-07-29 I want to make code actions easier. :config - (let ((cpp-executable (or my-cppls-fbcode-executable - my-clangd-executable))) - (when cpp-executable - (add-to-list 'eglot-server-programs - `((c++-mode c-mode) . (,cpp-executable))))) + (when my-clangd-executable + (add-to-list 'eglot-server-programs + `((c++-mode c-mode) . (,my-clangd-executable)))) (let ((py-executable (or my-pyls-language-server-executable my-pylsp-executable