More better clangds
This commit is contained in:
parent
7c093eb3da
commit
831f873dec
1 changed files with 7 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue