]> git.eshelyaron.com Git - emacs.git/commitdiff
Add php's php-language-server to built-in guessed servers
authorJoão Távora <joaotavora@gmail.com>
Tue, 15 May 2018 12:24:08 +0000 (13:24 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 15 May 2018 12:24:08 +0000 (13:24 +0100)
Closes https://github.com/joaotavora/eglot/issues/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.

lisp/progmodes/eglot.el

index 4ff6204fc3953def097da9f8e4b6ce087e12ef91..da3a09f3b225b0496d7473b95f1b357966e5e5e5 100644 (file)
@@ -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
@@ -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  []))