# Neovim lsp in julia 1.12

**URL:** https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003
**Category:** Tooling
**Tags:** vim, languageserver, neovim
**Created:** [November 20, 2025, 9:15am UTC](https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003 "2025-11-20T09:15:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)
#### Post date: [November 20, 2025, 9:15am UTC](https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003/1 "2025-11-20T09:15:04Z")

</div>

Hello everyone.  
I have been using the following setup for quite a while for my neovim lsp

The following is my lua setup:

```lua
vim.lsp.config('julials', {
    cmd = {
        "julia",
        "--project=".."~/.julia/environments/lsp/",
        "--startup-file=no",
        "--history-file=no",
        vim.fn.expand("~/.config/nvim/lua/lsp/") .. "julials_start.jl"
    },
    filetypes = { 'julia' },
    root_markers = { "Project.toml", "JuliaProject.toml" },
    settings = {}
})

```

where the julials\_start.jl contains:

```julia
using Pkg
Pkg.instantiate()

using LanguageServer
depot_path = get(ENV, "JULIA_DEPOT_PATH", "")
project_path = let
    dirname(something(
        ## 1. Finds an explicitly set project (JULIA_PROJECT)
        Base.load_path_expand((
            p = get(ENV, "JULIA_PROJECT", nothing);
            p === nothing ? nothing : isempty(p) ? nothing : p
        )),
        ## 2. Look for a Project.toml file in the current working directory,
        ## or parent directories, with $HOME as an upper boundary
        Base.current_project(),
        ## 3. First entry in the load path
        get(Base.load_path(), 1, nothing),
        ## 4. Fallback to default global environment,
        ## this is more or less unreachable
        Base.load_path_expand("@v#.#"),
    ))
end

@info "Running language server" VERSION pwd() project_path depot_path
server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path)
server.runlinter = true
run(server)

```

I just have to instantiate the environment which contains the lsp (in this case it is `~/.julia/environments/lsp/`), as well as the local environment which contains the Project.toml.

For julia 1.11, it works very well (even though it takes ages to start), and it gives me information on all the packages I’ve got on the Project.toml.

After updating to julia 1.12, using the same setup, the lsp connects very quickly, but it does not seem to be aware of any packages.  
I can get proper diagnostics if there something very wrong with the syntax (e.g. typing functn instead of function) but it does not give any autocomplete or information when I hover a variable and press `K`.

Does anyone have any idea what’s wrong here?  
Any other setups that work for 1.12?

---

<div class="post-metadata">

### Author: ![rkube](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rkube/32/211198_2.png) [@rkube](https://discourse.julialang.org/u/rkube)
#### Post date: [November 20, 2025, 4:50pm UTC](https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003/2 "2025-11-20T16:50:31Z")

</div>

I’ve been trying out [JETLS.jl](https://github.com/aviatesk/JETLS.jl) the last couple of weeks and it’s working quite nicely.  
Here’s my config:

```julia-auto
local julia_envs = os.getenv("JULIA_ENVS") or (os.getenv("HOME") .. "/source/repos")

return {
  cmd = {
        "julia",
        "--startup-file=no",
        "--history-file=no",
        "--project=" .. julia_envs.. "/JETLS.jl",
        julia_envs.. "/JETLS.jl/runserver.jl",
  },
  cmd_env = {
        JULIAUP_CHANNEL="1.12",
  },
  filetypes = {"julia"},
  root_markers = { "Project.toml", "JuliaProject.toml" },
}

```

and the `vim.lsp.enable("julia_jetls")` in `init.lua`.

---

<div class="post-metadata">

### Author: ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)
#### Post date: [November 20, 2025, 6:58pm UTC](https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003/3 "2025-11-20T18:58:50Z")

</div>

Thanks a lot for the info @rkube!  
I was a bit reluctant to try JETLS since it seems not fully-featured yet, but I might have a go at it now.

---

<div class="post-metadata">

### Author: ![rkube](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rkube/32/211198_2.png) [@rkube](https://discourse.julialang.org/u/rkube)
#### Post date: [November 26, 2025, 5:43pm UTC](https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003/4 "2025-11-26T17:43:28Z")

</div>

JETLS.jl is moving at the speed of light. It now compiles to a binary 😎 , updated configuration instructions are here: [Index · JETLS.jl](https://aviatesk.github.io/JETLS.jl/dev/)

---

<div class="post-metadata">

### Author: ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)
#### Post date: [November 26, 2025, 8:42pm UTC](https://discourse.julialang.org/t/neovim-lsp-in-julia-1-12/134003/5 "2025-11-26T20:42:38Z")

</div>

Alright, I’m convinced.  
I’ll try JETLS and see how it goes.

Here’s my abomination of a config (for now).

```julia-auto
-- Julia lsp config
local version = vim.fn.system("julia --version"):match("(%d+%.%d+%.%d+)")

if version then
    -- extract major and minor as numbers
    local major, minor = version:match("^(%d+)%.(%d+)%.")

    if minor == 12 then
        print("Julia version 1.12.x detected, running jetls")

        vim.lsp.config("jetls", {
            cmd = {
                "jetls",
                "--threads=auto",
                "--",
            },
            filetypes = {"julia"},
            root_markers = { "Project.toml", "JuliaProject.toml" },
            settings = {}
        })
        vim.lsp.enable("jetls")

    else
        print("Julia version < 1.12.x detected, running julials")
        vim.lsp.config('julials', {
            cmd = {
                "julia",
                "--project=".."~/.julia/environments/lsp/",
                "--startup-file=no",
                "--history-file=no",
                vim.fn.expand("~/.config/nvim/lua/lsp/") .. "julials_start.jl"
            },
            filetypes = { 'julia' },
            root_markers = { "Project.toml", "JuliaProject.toml" },
            settings = {}
        })

    end
end

```
