2022-03-28 15:03:21 +02:00
|
|
|
|
#+title: :lang julia
|
|
|
|
|
#+subtitle: A better, faster MATLAB
|
|
|
|
|
#+created: April 08, 2020
|
|
|
|
|
#+since: 1.3
|
2021-10-16 01:28:32 +02:00
|
|
|
|
|
|
|
|
|
* Description :unfold:
|
2021-03-02 04:25:35 +01:00
|
|
|
|
This module adds support for [[https://julialang.org/][the Julia language]] to Doom Emacs.
|
2020-04-08 14:33:27 -06:00
|
|
|
|
|
2022-09-26 02:19:42 +08:00
|
|
|
|
- Syntax highlighting and latex symbols from [[doom-package:julia-mode]]
|
|
|
|
|
- REPL integration from [[doom-package:julia-repl]]
|
|
|
|
|
- Code completion and syntax checking, requires [[doom-module::tools lsp]] and [[doom-module:+lsp]]
|
2020-04-08 14:33:27 -06:00
|
|
|
|
|
2021-10-16 01:28:32 +02:00
|
|
|
|
** Maintainers
|
|
|
|
|
/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]]
|
2021-03-02 04:25:35 +01:00
|
|
|
|
|
2021-10-16 01:28:32 +02:00
|
|
|
|
** Module flags
|
|
|
|
|
- +lsp ::
|
2022-09-26 02:19:42 +08:00
|
|
|
|
Enable LSP support for ~julia-mode~. Requires [[doom-module::tools lsp]] and a langserver
|
2021-10-16 01:28:32 +02:00
|
|
|
|
(supports LanguageServer.jl).
|
2022-04-09 18:38:04 +03:00
|
|
|
|
- +tree-sitter ::
|
|
|
|
|
Leverages tree-sitter for better syntax highlighting and structural text
|
2022-09-26 02:19:42 +08:00
|
|
|
|
editing. Requires [[doom-module::tools tree-sitter]].
|
2022-08-17 20:55:44 -05:00
|
|
|
|
- +snail :: Use Snail, a development environment and REPL interaction package
|
|
|
|
|
for Julia in the spirit of Common Lisp’s SLIME and Clojure’s CIDER. It enables
|
|
|
|
|
convenient and dynamic REPL-driven development.
|
2020-04-08 14:33:27 -06:00
|
|
|
|
|
2021-10-16 01:28:32 +02:00
|
|
|
|
** Packages
|
2022-09-26 02:19:42 +08:00
|
|
|
|
- [[doom-package:julia-mode]]
|
|
|
|
|
- [[doom-package:julia-repl]]
|
|
|
|
|
- if [[doom-package:+lsp]]
|
|
|
|
|
- if [[doom-module::tools lsp]]
|
|
|
|
|
- [[doom-package:lsp-julia]]
|
|
|
|
|
- [[doom-package:lsp]]
|
|
|
|
|
- if [[doom-module::tools lsp +eglot]]
|
|
|
|
|
- [[doom-package:eglot-jl]]
|
|
|
|
|
- [[doom-package:eglot]]
|
2022-08-17 20:55:44 -05:00
|
|
|
|
- if [[doom-package:][+snail]]
|
|
|
|
|
- [[doom-package:][julia-snail]]
|
2021-10-16 01:28:32 +02:00
|
|
|
|
|
|
|
|
|
** Hacks
|
|
|
|
|
/No hacks documented for this module./
|
|
|
|
|
|
|
|
|
|
** TODO Changelog
|
|
|
|
|
# This section will be machine generated. Don't edit it by hand.
|
|
|
|
|
/This module does not have a changelog yet./
|
|
|
|
|
|
|
|
|
|
* Installation
|
|
|
|
|
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
|
|
|
|
|
|
2022-09-26 02:19:42 +08:00
|
|
|
|
This module requires [[https://julialang.org/][Julia]] and an language server if [[doom-module:+lsp]] is enabled.
|
2020-04-08 14:33:27 -06:00
|
|
|
|
|
2020-04-08 14:52:45 -06:00
|
|
|
|
** Language Server
|
2022-09-26 02:19:42 +08:00
|
|
|
|
[[doom-module:+lsp]] requires ~LanguageServer.jl~ and ~SymbolServer.jl~. The [[doom-package:lsp-julia]] and
|
|
|
|
|
[[doom-package:eglot-jl]] packages both come bundled with their own versions of these servers,
|
2021-03-02 04:25:35 +01:00
|
|
|
|
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:
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+begin_src julia
|
2021-03-02 04:25:35 +01:00
|
|
|
|
using Pkg
|
|
|
|
|
Pkg.add("LanguageServer")
|
|
|
|
|
Pkg.add("SymbolServer")
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+end_src
|
2021-03-02 04:25:35 +01:00
|
|
|
|
|
2022-09-26 02:19:42 +08:00
|
|
|
|
Then configure [[doom-package:lsp-julia]] or [[doom-package:eglot-jl]] depending on whether you have enabled
|
|
|
|
|
[[doom-module::tools lsp]] or [[doom-module::tools lsp +eglot]], respectively:
|
2020-04-08 14:52:45 -06:00
|
|
|
|
|
2021-10-16 01:28:32 +02:00
|
|
|
|
*** =lsp-julia=
|
2022-09-26 02:19:42 +08:00
|
|
|
|
To instruct [[doom-package:lsp-julia]] not to use the built-in package:
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
;; in $DOOMDIR/config.el
|
2021-03-02 04:25:35 +01:00
|
|
|
|
(setq lsp-julia-package-dir nil)
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+end_src
|
2021-03-02 04:25:35 +01:00
|
|
|
|
|
2022-09-26 02:19:42 +08:00
|
|
|
|
To find your installation of ~LanguageServer.jl~, [[doom-package:lsp-julia]] needs to know the
|
2022-01-26 18:37:26 -08:00
|
|
|
|
environment in which it is installed. This is set to v1.6 by default as it is
|
2021-03-02 04:25:35 +01:00
|
|
|
|
the current LTS:
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
;; in $DOOMDIR/config.el
|
|
|
|
|
(after! lsp-julia
|
2022-01-26 18:37:26 -08:00
|
|
|
|
(setq lsp-julia-default-environment "~/.julia/environments/v1.6"))
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
*** =eglot-jl=
|
2022-09-26 02:19:42 +08:00
|
|
|
|
To find your installation of ~LanguageServer.jl~, [[doom-package:eglot-jl]] must know the
|
2022-01-26 18:37:26 -08:00
|
|
|
|
environment in which it is installed. This is set to v1.6 by default as it is
|
2021-03-02 04:25:35 +01:00
|
|
|
|
the current LTS:
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
;; in $DOOMDIR/config.el
|
2022-01-26 18:37:26 -08:00
|
|
|
|
(setq eglot-jl-language-server-project "~/.julia/environments/v1.6")
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+end_src
|
2021-03-02 04:25:35 +01:00
|
|
|
|
|
2022-09-26 02:19:42 +08:00
|
|
|
|
But to let [[doom-package:eglot-jl]] use the environment bundled with it, set it to
|
2021-03-02 04:25:35 +01:00
|
|
|
|
~eglot-jl-base~ instead:
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
;; in $DOOMDIR/config.el
|
2021-03-02 04:25:35 +01:00
|
|
|
|
(after! eglot-jl
|
|
|
|
|
(setq eglot-jl-language-server-project eglot-jl-base))
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
* TODO Usage
|
|
|
|
|
#+begin_quote
|
|
|
|
|
🔨 /This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
|
|
|
|
#+end_quote
|
2020-04-08 14:52:45 -06:00
|
|
|
|
|
2020-04-08 14:33:27 -06:00
|
|
|
|
** Language Server
|
2022-09-26 02:19:42 +08:00
|
|
|
|
[[doom-module:+lsp]] adds code completion, syntax checking, formatting and other [[doom-package:lsp-mode]] or
|
|
|
|
|
[[doom-package:eglot]] features. It requires ~LanguageServer.jl~, the installation of which is
|
2021-03-02 04:25:35 +01:00
|
|
|
|
described above.
|
|
|
|
|
|
2022-08-17 21:00:49 -05:00
|
|
|
|
** Snail
|
|
|
|
|
|
|
|
|
|
| Keybind | Command |
|
|
|
|
|
|-----------------------------+-----------------------------------|
|
|
|
|
|
| [[kbd:][<localleader> ']] | ~julia-snail~ |
|
|
|
|
|
| [[kbd:][<localleader> a]] | ~julia-snail-package-activate~ |
|
|
|
|
|
| [[kbd:][<localleader> r]] | ~julia-snail-update-module-cache~ |
|
|
|
|
|
| [[kbd:][<localleader> d]] | ~julia-snail-doc-lookup~ |
|
|
|
|
|
| [[kbd:][<localleader> e b]] | ~julia-snail-send-buffer-file~ |
|
|
|
|
|
| [[kbd:][<localleader> e l]] | ~julia-snail-send-line~ |
|
|
|
|
|
| [[kbd:][<localleader> e r]] | ~julia-snail-send-region~ |
|
|
|
|
|
| [[kbd:][<localleader> e e]] | ~julia-snail-send-dwim~ |
|
|
|
|
|
|
2021-10-16 01:28:32 +02:00
|
|
|
|
* TODO Configuration
|
|
|
|
|
#+begin_quote
|
|
|
|
|
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
|
|
|
|
#+end_quote
|
2020-04-08 14:33:27 -06:00
|
|
|
|
|
2021-10-16 01:28:32 +02:00
|
|
|
|
** Change the default environment for the Julia language server
|
2022-09-26 02:19:42 +08:00
|
|
|
|
[[doom-package:lsp-julia]] requires a variable be set for the Julia environment. This is set to
|
2022-01-26 18:37:26 -08:00
|
|
|
|
v1.6 by default as it is the current LTS:
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
;; in $DOOMDIR/config.el
|
|
|
|
|
(after! lsp-julia
|
2022-01-26 18:37:26 -08:00
|
|
|
|
(setq lsp-julia-default-environment "~/.julia/environments/v1.6"))
|
2021-10-16 01:28:32 +02:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
* Troubleshooting
|
|
|
|
|
/There are no known problems with this module./ [[doom-report:][Report one?]]
|
|
|
|
|
|
|
|
|
|
* Frequently asked questions
|
|
|
|
|
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
|
|
|
|
|
|
|
|
|
|
* TODO Appendix
|
|
|
|
|
#+begin_quote
|
|
|
|
|
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
|
|
|
|
#+end_quote
|