This module adds support for the Julia language to Doom Emacs.
- Syntax highlighting and latex symbols from
julia-mode
- REPL integration from
julia-repl
- Code completion and syntax checking, requires
:tools lsp
and+lsp
+lsp
Enable LSP server support.
- julia-mode
- julia-repl
+lsp
and:tools lsp
+lsp
and:tools lsp +eglot
This module requires julia
and an language server if +lsp
is enabled.
+lsp
requires LanguageServer.jl
and SymbolServer.jl
. The lsp-julia
and
eglot-jl
packages both come bundled with their own versions of these servers,
which is used by default. If you’re happy with that, no further configuration is
necessary.
However, to use your own installation you will need to install then configure them. To install them, execute these commands in a Julia REPL:
using Pkg
Pkg.add("LanguageServer")
Pkg.add("SymbolServer")
Then configure lsp-julia
or eglot-jl
depending on whether you have enabled
:tools lsp
or :tools (lsp +eglot)
, respectively:
To instruct lsp-julia
not to use the built-in package:
;; ~/.doom.d/config.el
(setq lsp-julia-package-dir nil)
To find your installation of LanguageServer.jl
, eglot-jl
needs to know the
environment in which it is installed. This is set to v1.0 by default as it is
the current LTS:
(setq lsp-julia-default-environment "~/.julia/environments/v1.0")
To find your installation of LanguageServer.jl
, eglot-jl
must know the
environment in which it is installed. This is set to v1.0 by default as it is
the current LTS:
;; ~/.doom.d/config.el
(setq eglot-jl-language-server-project "~/.julia/environments/v1.0")
But to let eglot-jl
use the environment bundled with it, set it to
eglot-jl-base
instead:
;; ~/.doom.d/config.el
(after! eglot-jl
(setq eglot-jl-language-server-project eglot-jl-base))
+lsp
adds code completion, syntax checking, formatting and other lsp-mode
or
eglot
features. It requires LanguageServer.jl
, the installation of which is
described above.
lsp-julia
requires a variable be set for the Julia environment. This is set to
v1.0 by default as it is the current LTS.
;; ~/.doom.d/config.el
(setq lsp-julia-default-environment "~/.julia/environments/v1.0")