Skip to content

Commit

Permalink
Add PHP's php-language-server to built-in guessed servers
Browse files Browse the repository at this point in the history
Closes #1. The problem in that issue is that php-language-server has a
bug when it's not passed it the deprecated ":rootPath" field. The bug
doesn't happen if the ":processId" field is also absent. Eglot was
triggering the bug, because it didn't pass ":rootPath", but there's
nothing wrong in doing so.

* README.md: Add php-language-server to the built-in list.

* eglot.el (eglot-server-programs): Add php-language-server.
(eglot--connect): Also pass (deprecated) rootPath.

#1: joaotavora/eglot#1
  • Loading branch information
joaotavora committed May 15, 2018
1 parent 6eb9114 commit f08afeb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
(defvar eglot-server-programs '((rust-mode . ("rls"))
(python-mode . ("pyls"))
(js-mode . ("javascript-typescript-stdio"))
(sh-mode . ("bash-language-server" "start")))
(sh-mode . ("bash-language-server" "start"))
(php-mode . ("php" "vendor/felixfbecker/\
language-server/bin/php-language-server.php")))
"Alist mapping major modes to server executables.")

(defface eglot-mode-line
Expand Down Expand Up @@ -276,6 +278,7 @@ INTERACTIVE is t if inside interactive call."
'network)
(emacs-pid))
:capabilities(eglot--client-capabilities)
:rootPath (car (project-roots project))
:rootUri (eglot--path-to-uri
(car (project-roots project)))
:initializationOptions []))
Expand Down

0 comments on commit f08afeb

Please sign in to comment.