Julia with neovim

Hey all,
i’m using neovim with Julia (julials). I have set up my LSP with “Mason” regarding to the documentation from the github. I include the relevant configs here, but if you want a look at my full neovim config, go to my GitHub: (GitHub - MichaelBrueggemann/nvim).

My Issue is, that the LSP is working correctly (i can get Hover documentation etc.) but when i’m in a file that uses Tokens from a local module, neovim doesnt recognize the References. But when i’m in a file deeper nested in my project, this issue is gone.

The module “GEMS” is fully defined in “~/Repositories/gems” and i started my neovim session in this directory via “nvim .”.

Does anyone has had similar experiences? If there are Information missing, please tell me.

As i’m a new user i can’t create multiple embedded files, so i placed all relevant screenshots in a PNGs at the bottom.


local mason = require('mason')
local mason_lsp = require('mason-lspconfig')

-- setup mason itself
    ui = {
        icons = {
            package_installed = "✓",
            package_pending = "➜",
            package_uninstalled = "✗"

-- Customized on_attach function
-- See `:help vim.diagnostic.*` for documentation on any of the below functions

-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
    -- Enable completion triggered by <c-x><c-o>
    vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')

    -- See `:help vim.lsp.*` for documentation on any of the below functions
    local opts = { buffer = bufnr }
    vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
    vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
    vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
    vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
    vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, opts)
    vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
    vim.keymap.set('n', '<leader>rf', vim.lsp.buf.references, opts)
    vim.keymap.set('n', '<leader>f', function()
        vim.lsp.buf.format { async = true }
        print("Formatting done!")
    end, opts)

    print("Language server started: " .. client.name)

local lspconfig = require('lspconfig')
local lsp_capabilities = vim.lsp.protocol.make_client_capabilities()

-- define autocompletion capabilitites
local cmp_capabilities = require("cmp_nvim_lsp").default_capabilities(lsp_capabilities)

-- list all lsp servers, that should be installed
local lsp_servers = {

-- install lsps
    ensure_installed = lsp_servers,
    automatic_installation = true,

    on_attach = on_attach,
    capabilities = cmp_capabilities,


Yeah, same. I think this is a problem with LanguageServer.jl (this was happening to me in helix too).

Same here. What I don’t understand is why VSCode doesn’t have this problem? Or do they?

One thing to add, i think it has to do something with my custom package and the startup of the LSP. I could think of, that it could be necessary to run like "julia -e ‘using Pkg; Pkg.instantiate()’ in the directory where my Project.toml is on startup of the LSP. But i dont know how to change this in the LSP settings and i also don’t think that this should be done by a user in the first place.

1 Like