Skip to content

Commit

Permalink
tweak(eglot): do not assume servers to be executable
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed May 21, 2023
1 parent 6525e40 commit 51dd7b8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions elisp/+eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ Examples:
(+eglot-register 'lua-mode \"lua-language-server\" \"lua-lsp\")
(+eglot-register '(c-mode c++-mode) '(\"clangd\" \"--clang-tidy\" \"-j=12\") \"ccls\")"
(declare (indent 0))
(let* ((alternatives-p (length> servers 1))
(first-server (car servers))
(first-server (if (listp first-server) (car first-server) first-server)))
(with-eval-after-load 'eglot
(when (executable-find first-server)
(add-to-list
'eglot-server-programs
(cons modes (if alternatives-p
(eglot-alternatives (ensure-list servers))
(ensure-list (car servers)))))))))
(with-eval-after-load 'eglot
(add-to-list
'eglot-server-programs
(cons modes (if (length> servers 1)
(eglot-alternatives (ensure-list servers))
(ensure-list (car servers)))))))

;;; +eglot.el ends here

0 comments on commit 51dd7b8

Please sign in to comment.