This is a simple package to make using Julia’s language server easier
with eglot. It can be installed from melpa by adding melpa to your
package-archives and doing M-x package-install RET eglot-jl RET
with Emacs 26.1+.
After installation, eglot-jl-init will load support for the Julia
language server into eglot and project.el. If eglot-jl-init has been
run in your emacs session, running eglot in a julia-mode buffer
will start a language server for the Julia project to which the buffer
belongs. The first time eglot is run, the Julia language server will
be downloaded and installed into the default depot (e.g. ~/.julia)
in its own isolated project environment. This may take a long time, so
eglot-connect-timeout should be increased for this first run.
Completion:
Show help and signatures in the minibuffer:
Show docstring for symbol at point (eglot-help-at-point):
Jump to definitions of symbol at point (xref-find-definitions):
Rename symbol at point (eglot-rename):
Linting:
Jump to symbol in document imenu:
The most likely reason is that SymbolServer.jl takes a very long time
to process project dependencies. This is a one-time process that
shouldn’t cause issues once the dependencies are cached, however it
can take over a minute to process each dependency. By default, eglot
will only wait wait 30 seconds for a language server to be ready; this
is controlled by eglot-connect-timeout.
To work around this issue, you can:
- Set
eglot-connect-timeoutto a very high value.- Progress of the SymbolServer can be monitored in the
*EGLOT (ProjectName/julia-mode) stderr*buffer.
- Progress of the SymbolServer can be monitored in the
- Run the following, from your project directory:
julia --project=path/to/eglot-jl/ path/to/eglot-jl/eglot-jl.jlThe SymbolServer is finished with caching dependencies when it displays:
[ Info: Received new data from Julia Symbol Server.
By default, starting a new language server (which is done once per project)
takes some time: around 20 seconds are needed before the server is ready, which
manifests itself by the [eglot:projectName] indicator showing up in the
modeline.
A custom system image, created using =PackageCompiler.jl=, can be used to reduce
this latency. The whole process of creating and using a system image can be
automated by setting the eglot-jl-enable-sysimage customization option in
Emacs:
(setq eglot-jl-enable-sysimage t)When this setting is activated, you’ll be prompted to start building a system
image the first time eglot-jl is initialized. You’ll also be prompted to
re-build the sysimage each time this is necessary: when the Julia version
changes, or when eglot-jl itself gets updated.
It will take a few minutes to generate a system image, which eglot-jl will
detect and automatically use for subsequent language server runs. This should
reduce language server startup times to 1 or 2 seconds.
If anything goes wrong with system images, you can deactivate this feature
altogether by restoring eglot-jl-enable-sysimage back to its default value.






