gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

Compatibility with lsp clients such as eglot #59

Closed NightMachinery closed 2 years ago

NightMachinery commented 2 years ago

I like my current eglot setup a lot, but it doesn't have any REPL capability. I like to use this project just for its REPL, and do not want any other "features" such as modifying company-capf, registering goto mechanisms, etc. I just want to be able to send stuff to a REPL.

PS: How do you make the REPL run code in a module? This is the main problem I have with julia-repl, which is what I am currently using.

gcv commented 2 years ago

You can look at the definition of julia-snail-mode in julia-snail.el for information about what you will need to disable. The following is untested but probably works:

(remove-hook 'completion-at-point-functions #'julia-snail-company-capf t)
(remove-hook 'completion-at-point-functions #'julia-snail-repl-completion-at-point t)
(remove-function (local 'eldoc-documentation-function) #'julia-snail-eldoc)
(remove-hook 'xref-backend-functions #'julia-snail-xref-backend t)

You should put all that in a function and then add that function to julia-snail-mode-hook.

How do you make the REPL run code in a module?

If you want to know how to make Julia evaluate code in a module, look at the definition of eval_in_module in JuliaSnail.jl. More broadly, Snail runs a server on the Julia side, and includes a significant amount of code to enable Emacs and Julia to send each other commands — including commands which send code. All of this is entirely self-contained, unlike LSP.

gcv commented 2 years ago

Added this tip to the Tips and Tricks section of the wiki: https://github.com/gcv/julia-snail/wiki/Tips-and-Tricks#selectively-disabling-snail-features