VarLad / lapce-julia

Julia plugin for the Lapce Editor (using LanguageServer.jl)
Apache License 2.0
10 stars 0 forks source link

How do I use this? #1

Closed ForceBru closed 1 year ago

ForceBru commented 1 year ago
  1. I installed this plugin in Lapce.
  2. Opened a Julia file.
  3. Nothing happens:
    • No indication of a language server being active;
    • no autocomplete;
    • no suggestions like in this screenshot;
    • no Julia process (ps aux | grep julia shows just the grep command);
    • unable to execute Julia code by pressing Shift+Enter, like in Jupyter.

How to use this plugin? Do I need to manually activate the language server?

Versions

VarLad commented 1 year ago

@ForceBru Thanks for trying out the plugin. Shift + Enter is not supported yet For sending the current line/selection to terminal, track this issue: https://github.com/lapce/lapce/issues/520 For inline code execution (it executes and shows result in the editor itself), that'd be a long road but you start start by tracking this issue: https://github.com/lapce/lapce/issues/812

Check the README.md and see if it solves the "nothing happens" issue.

VarLad commented 1 year ago

Also, close the issue if that does solve your problem. For the Shift + Enter, use the two linked issues to track

ForceBru commented 1 year ago

https://github.com/VarLad/lapce-julia/blob/d42c5d3241921080b59f0f04689ed0f8bfeccbac/README.md?plain=1#L7

What kind of PATH should I check? My default shell is /bin/zsh, and it has Julia in its PATH:

% echo $PATH
.../Julia/Julia-1.8.app/Contents/Resources/julia/bin:...
% which julia
.../Julia/Julia-1.8.app/Contents/Resources/julia/bin/julia

My Lapce terminal is set up to use the fish shell, and it has Julia in its PATH as well:

$ which julia
.../Julia/Julia-1.8.app/Contents/Resources/julia/bin/julia

I installed LanguageServer.jl for this Julia version:

% julia -e "import Pkg; Pkg.status()"          
Status `~/.julia/environments/v1.8/Project.toml`
...
  [70703baa] JuliaSyntax v0.2.0
  [2b0e0bc5] LanguageServer v4.3.1
  [bdcacae8] LoopVectorization v0.12.145
...

I then relaunched Lapce, updated lapce-julia to v0.0.4, but still nothing happens when I open a Julia file. There are no errors, but also no indication of lapce-julia being active or having trouble finding Julia or launching the language server. CPU usage is around zero, so there doesn't seem to be much work going on, while launching Julia is usually CPU-intensive.

Lapce's extensions panel shows that "Julia (LanguageServer.jl) v0.0.4" is indeed installed.

VarLad commented 1 year ago

@ForceBru Do you know where the config folder of Lapce is located? (in MacOS? I think it is ~/Library/Preferences/ in MacOS) In there, in settings.toml file, append the following

[lapce-julia-ls.lsp]
serverPath = "/full/path/to/julia/executable"
VarLad commented 1 year ago

@ForceBru Update the plugin Check out https://github.com/VarLad/lapce-julia#passing-custom-julia-executable-path

If it still doesn't fix the issue, feel free to reopen this!

ForceBru commented 1 year ago

Yep, it works now with the custom path to the Julia executable, thanks a lot!