Using LanguageServer.jl with eglot in emacs

No, I don’t have admin access and therefore cannot install/activate WSL.

There is a Linux cluster at work. What I normally do is ssh into it, and run emacs (in the Cygwin terminal).
There I can run Julia code, etc.

However, the master branches of many of my repos have been broken for a couple weeks, as I’m overhauling some of the internals. I have avoided updating the cluster, because I still need to get work done, and have therefore been developing the master branches locally.
This is also probably something that could be solved with Julia environments, letting me keep two separate environments on the Linux cluster. Although being able to work locally would be nice as well.

Also, a more general emacs question: how does it decide how to split the screen?
I have a relatively square monitor, and emacs always defaults to splitting side by side (equivalent to C-x 3 ), while with ultra-wide monitors, it splits them one above the other (equivalent to C-x 2 ). So it seems to be using the screen resolution to always make the opposite choice of what I want.
How can I change this default behavior?

I don’t have experience with customizing this but looking at the docs of split-window-sensibly it seems that if you set split-width-threshold to nil and split-height-threshold to 0 it will try to split the window vertically (and the other way around if you want a horizontal split).

How did you obtain emacs? Is this from or installed via cygwin? My experience has been that the perf of programs intalled via cygwin leaves a lot to be desired. What modes are enabled when you see the input lag (M-x describe-mode)?

Just modify the PATH environment variable? Note that within emacs, you can also modify the exec-path variable.

For the clipboard, try setting both select-enable-clipboard and select-enable-primary to t (just a guess on the problem).

1 Like

Hi, how does one use that recipe? I use the included package.el.

You can use straight or quelpa to install a melpa recipe. If you don’t want to use those, you can just download the package and make sure it’s on your load-path. I’m not exactly sure how you get autoloads working with this setup though, so you might just have to require it. Once the pull request to melpa is accepted you’ll be able to install with package-install if you’ve added melpa to package-archives.

1 Like

I cloned the repository, added the following line to my init:

(add-to-list 'load-path "/home/myuser/Desktop/eglot-jl-master/eglot-jl.el")
(require 'eglot-jl)

I get an error and it seems the the problem is in this line
(defconst eglot-jl-base (file-name-directory load-file-name))

Could you toggle-debug-on-error and paste the traceback either here or in a github issue, please?

Nevermind, I had to add the full directory and not just the .el file.

It seems to be working,

  • but it disconnects and reconnects a lot of times,
  • doesn’t seem to understand stuff that is imported with “using
  • and keeps printing:
[eglot] (warning) Server tried to register unsupported capability `workspace/didChangeWorkspaceFolders'

But this are probably LanguageServer.jl and eglot.el issues.

This is normal, although if it prints it more than once, that means that the language server is restarting. And yes, I certainly wouldn’t call the setup stable at the moment. I’ve been in a bit of a crunch lately, so I haven’t even been using it myself as it’s been getting in the way more than helping.

When the server restarts, it would be great if you could capture the events immediately preceding the restart from the eglot events buffer and submit an issue on github. From there I can route it upstream to eglot or LanguageServer.jl as appropriate.

Sure. Thanks for your hard work!