-
Notifications
You must be signed in to change notification settings - Fork 39
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
Instructions for use in Emacs Eglot #57
Comments
I use PerlNavigator with eglot occasionally with this invocation in my Emacs configuration (I'm using cperl-mode, for which eglot has no default language server configured): (with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
`(cperl-mode . ("node" "/home/haj/devel/perl/PerlNavigator/server/out/server.js" "--stdio")))) I have installed PerlNavigator from source (as described here), and added the relevant path as documented in the eglot manual. The path to the navigator is installation-specific, therefore this might be useful for documentation, but it is not suitable for inclusion in eglot. For comparison: LSP-mode, another LSP client for Emacs, does allow server-specific configuration, but the perlimports variables have not yet been added to its PerlNavigator support. LSP-mode works around installation specific paths by offering to download and install the server from github (the release file, not the sources) into a known directory of its own. |
Thanks @HaraldJoerg! Other than building from source, Sounds like many of the features work already, which is great. There's not a specific list anywhere, but the primary features are syntax checking, perlcritic, perltidy, perlimports, go-to-definition, auto-completion, hover, and outline view. In terms of configuration, that's unfortunate that eglot does not allow for configuration. Although I could allow configuration via a file somewhere (maybe |
Thanks again @HaraldJoerg ! Using your config as a starting point, I was able to get up and running with eglot in emacs. I was able to get a some specific configuration variables set, but I couldn't figure out how to set list variables (e.g. include paths). Pretty good start though. I also fixed a couple minor issues along the way: one startup warning, and an issue with symbol boundaries in goto definition. Essentially, if the cursor is at the beginning of a symbol (e.g. on the sigil of a variable), the navigator did not recognize it as being over the variable. Leaving this open for now, as I think adding a |
Some more details about Eglot: Unlike lsp-mode, most of its configuration is not available through the "customize" interface of Emacs. This makes it somewhat clumsy and ... dangerous. So, the example config with Regarding the installation of a callable program somewhere on the path: This would, of course, be a prerequisite for getting it into the Emacs sources. Also, the Emacs folks care about compatibility. So, instead of overwriting the current configuration for To get it included into Emacs, I suggest to open an Emacs bug when the starter program "on the path" is available. I can help with that and also suggest a patch. In any case, we should collect feedback from João Távora, who is the main developer and maintainer of Eglot, and from the contributors which did the recent changes to advertise |
I can manage to get the language server running and it does show some warnings and expected and so on. However, it is unusable because I get this error message every second or so:
Is there some way to get the server to stop doing this thing that Eglot doesn't like, and if so does someone have some Eglot config to do it? |
Update: tried again today and have the same problem, but realized the warning above is probably unrelated. I did (setq eglot-autoreconnect nil) to prevent Eglot from trying to restart the server over and over and flood the log, and now the log looks like this:
Any pointers on how we might find out why the server exists would be nice. |
The upcoming release of Emacs 29 will have eglot as a built-in LSP client. It would be nice to have instructions on how to use the Navigator, and do some basic testing to ensure the key features work.
Getting the Perl Navigator added as a default language server option would be great too:
https://github.com/joaotavora/eglot/blob/e501275e06952889056268dabe08ccd0dbaf23e5/eglot.el#L235
The text was updated successfully, but these errors were encountered: