-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change php-language-server to Serenata or Phpactor #537
Comments
I also have a basic config with Serenata, but as I've never done any serious PHP development until now and haven't used Phpactor I can't judge which is the better tool between the two. |
Phpactor have more features than Serenata, and it seems like the indexing time and performance is in general better. In regard of the php-mode, I'm agree, the ELPA phps-mode is getting better, and the semantic integration seems pretty promising, but php-mode is more popular, so I think that it is not a bad idea to support both. Also, in the (I hope) not so distance future, Phpactor would include some refactoring features, which are a great tool to have in Emacs. |
Eglot nowadays supports both php-mode and phps-mode. I'm afraid João is not a big fan of this idea, but instead of changing the default server, can you just follow the example in #688 and support every one of them? |
@nemeth what exactly is the idea? Eglot supports any LSP server, the question here is what server to suggest as the default 0-config one. For that, I'm usually content with having Eglot suggest whatever the majority of people seem to indicate as the most stable, functional server. But it is fairly easy to change he suggestion to another one with a one-at-most-two-liner in your That said, if you can come up with a 10-20 loc solution to this we can look at it. |
Currently, Eglot works out-of-the-box with the most popular server for a particular major-mode. It would be nice if Eglot cloud support multiple popular servers out-of-the-box. I don't see any theoretical differences between the two cases.
Well, I gave it a try, but I'm unable to write it the way I want. Here is what I currently have: (setq eglot-server-programs
'((python-mode . (eglot-compound-server :alternatives
(("pyls")
("pylsp"))))))
(defclass eglot-compound-server (eglot-lsp-server)
((alternatives :initarg :alternatives)))
(cl-defmethod initialize-instance :before ((server eglot-compound-server) &rest slots)
(let ((alternatives (plist-get (car slots) :alternatives))
;; eglot--connect uses lots of `setf's instead of initargs
;; like: (setf (eglot--project server) project)
;; so nickname, project-root are not available here
(readable-name "nickname")
cmd)
;; Use cl-loop instead?
(dolist (alt (reverse alternatives))
(when (executable-find (car alt))
(setq cmd alt)))
(when (not cmd)
(setq cmd (car alternatives)))
(message "cmd: %s" cmd)
;; This doesn't set the slot's value :(
(setf (jsonrpc--process server)
(make-process
:name readable-name
:command cmd
:connection-type 'pipe
:coding 'utf-8-emacs-unix
:noquery t
:stderr (get-buffer-create
(format "*%s stderr*" readable-name))
:file-handler t)))) |
I actually like this solution since it doesn't need new syntax in |
Actually never mind that last comment, this seems to be much easier to implement:
Do you see any drawback in this? |
Also per #537. * eglot.el (eglot-alternatives): new helper. (eglot-server-programs): Use it. Use clangd and pylsp. * NEWS.md: Mention feature. * README.md (Connecting to a server): Mention pylsp and clangd.
No. The version on master is quite nice and concise. Thanks. @Sasanidas, @pablobc-mx: if you provide start commands for the new php servers, this issue can proceed. A pull request adding eglot-alternatives would be even better. See Lines 119 to 120 in a5b7b7d
|
…e mode Also per joaotavora/eglot#537. * eglot.el (eglot-alternatives): new helper. (eglot-server-programs): Use it. Use clangd and pylsp. * NEWS.md: Mention feature. * README.md (Connecting to a server): Mention pylsp and clangd.
…e mode Also per joaotavora/eglot#537. * eglot.el (eglot-alternatives): new helper. (eglot-server-programs): Use it. Use clangd and pylsp. * NEWS.md: Mention feature. * README.md (Connecting to a server): Mention pylsp and clangd.
Also per #537. * eglot.el (eglot-alternatives): new helper. (eglot-server-programs): Use it. Use clangd and pylsp. * NEWS.md: Mention feature. * README.md (Connecting to a server): Mention pylsp and clangd. #688: joaotavora/eglot#688 #537: joaotavora/eglot#537
Also per joaotavora/eglot#537. * eglot.el (eglot-alternatives): new helper. (eglot-server-programs): Use it. Use clangd and pylsp. * NEWS.md: Mention feature. * README.md (Connecting to a server): Mention pylsp and clangd. GitHub-reference: fix joaotavora/eglot#688
For now, seems like that still php-language-server it is not maintained, a couple of moths ago I open this pull request to add Serenata(another php lsp server) to lsp-mode, so I'm proposing here to change the php language server for Serenata or maybe the new Phpactor language server.
I have already the phpactor eglot basic configuration working, so I can just clean it a little and it may just work fine.
Also point out this issue, that indicates the state of the php-language-server.
Regards.
The text was updated successfully, but these errors were encountered: