doomemacs/modules/lang/julia
Henrik Lissner acae9f9acb
bump: :tools lsp
emacs-lsp/lsp-mode@6b6afc00de -> emacs-lsp/lsp-mode@3fa645c039
joaotavora/eglot@e835996e16 -> joaotavora/eglot@bd970be047

- There are multiple issues in the lsp-mode
  repo (emacs-lsp/lsp-mode#2722), lsp-julia repo (gdkrmr/lsp-julia#23
  and gdkrmr/lsp-julia#35), and the LanguageServer.jl
  repo (julia-vscode/LanguageServer.jl#844) about crashes of the Julia
  LSP with lsp-mode due to errors caused by the folding capabilities
  announced by the client. One can work around these issues by enabling
  folding (see gdkrmr/lsp-julia#23) but that is only a hack and does not
  fix the underlying issue. The problem is caused by a violation of the
  LSP specs in lsp-mode which was fixed in emacs-lsp/lsp-mode#3593. The
  PR updates lsp-mode to the latest commit on the master branch which
  contains this fix (and some other unrelated fixes, CI passes
  successfully again), and hence the workaround for lsp-julia can be
  removed.

Ref: emacs-lsp/lsp-mode#3593
Ref: emacs-lsp/lsp-mode#2722
Ref: gdkrmr/lsp-julia#35
Ref: gdkrmr/lsp-julia#23
Ref: julia-vscode/LanguageServer.jl#844
Close: #6516
Co-authored-by: devmotion <devmotion@users.noreply.github.com>
2022-07-05 01:35:06 +02:00
..
autoload.el Run julia-repl-use-emacsclient after opening a REPL 2020-04-23 23:56:18 -04:00
config.el bump: :tools lsp 2022-07-05 01:35:06 +02:00
doctor.el docs(tree-sitter): add doctor checks for flag 2022-05-22 21:26:00 +01:00
packages.el bump: :lang 2022-03-31 21:09:38 +02:00
README.org fix README 2021-03-13 20:11:58 +00:00

lang/julia

Description

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

Module Flags

  • +lsp Enable LSP server support.

Plugins

Prerequisites

This module requires julia and an language server if +lsp is enabled.

Language Server

+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:

lsp-julia

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")

eglot-jl

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))

Features

Language Server

+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.

Configuration

Change the default environment for the Julia language server

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")