I have just written a Julia integration for the vim/neovim plugin ALE (Asyncronous Lint Engine) using LanguageServer.jl. I believe it is one of the best vim plugins and we needed Julia support.
The integration searches for REQUIRE, Project.toml or Manifest.toml files to get the project root and then it starts the language server instance. It works out of the box after installing ale in vim/neovim and LanguageServer.jl.
The LanguageServer.jl package has still room for improvement, but I believe this is a good start!
All I see is some CPU load in the background when pressing or when saving a *.jl file. using the 3 packages on Julia REPL works fine, there are no warnings or errors.
Sounds really awesome. However, I am not even able to build StaticLint:
Building StaticLint → `~/.julia/packages/StaticLint/o1AQ8/deps/build.log`
┌ Error: Error building `StaticLint`:
│ ERROR: LoadError: syntax: extra token "AssociativeWrapper" after end of expression
│ Stacktrace:
│ [1] include at ./boot.jl:317 [inlined]
│ [2] include_relative(::Module, ::String) at ./loading.jl:1038
│ [3] include(::Module, ::String) at ./sysimg.jl:29
│ [4] top-level scope at none:2
│ [5] eval at ./boot.jl:319 [inlined]
│ [6] eval(::Expr) at ./client.jl:389
│ [7] top-level scope at ./none:3
│ in expression starting at /Users/tamasgal/.julia/packages/JSON/Zg7L7/src/JSON.jl:18
│ ERROR: LoadError: LoadError: Failed to precompile JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6] to /Users/tamasgal/.julia/compiled/v1.0/JSON/uf6oy.ji.
│ Stacktrace:
│ [1] error(::String) at ./error.jl:33
│ [2] macro expansion at ./logging.jl:313 [inlined]
│ [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1184
│ [4] _require(::Base.PkgId) at ./logging.jl:311
│ [5] require(::Base.PkgId) at ./loading.jl:852
│ [6] macro expansion at ./logging.jl:311 [inlined]
│ [7] require(::Module, ::Symbol) at ./loading.jl:834
│ [8] include at ./boot.jl:317 [inlined]
│ [9] include_relative(::Module, ::String) at ./loading.jl:1038
│ [10] include(::Module, ::String) at ./sysimg.jl:29
│ [11] include(::String) at ./client.jl:388
│ [12] top-level scope at none:0
│ [13] include at ./boot.jl:317 [inlined]
│ [14] include_relative(::Module, ::String) at ./loading.jl:1038
│ [15] include(::Module, ::String) at ./sysimg.jl:29
│ [16] include(::String) at ./client.jl:388
│ [17] top-level scope at none:0
│ in expression starting at /Users/tamasgal/.julia/packages/StaticLint/o1AQ8/src/symbolserver.jl:2
│ in expression starting at /Users/tamasgal/.julia/packages/StaticLint/o1AQ8/deps/build.jl:1
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068
You just need to install LanguageServer.jl at the moment and it should work out of the box if you set the right g:ale_julia_executable. Unfortunately just for Julia 0.6 at the moment.
:ALEInfo says there’s a Julia process with the LanguageServer running. Though it exits quickly and is re-launched by ALE everytime I trigger Omnicomplete or generally, when I write something in my *.jl file.
I’ve taken a look into ale_linters/julia/languageserver.vim: In Julia 0.7/1.0, STDOUT and STDIN have to be lowercase. After changing that in the variable cmd_string, the Julia process with the LanguageServer does not crash anymore and stays running until I close my *.jl file.
I haven’t seen anyone getting it working so far on Julia 1.x.
Btw: Thanks for updating LanguageServer.jl’s Github Wiki page for vim. Transferring the embedded Julia code snippet to ALE now at least prevents ALE’s Julia background process from crashing. One step further