dundalek / lazy-lsp.nvim

Neovim plugin to auto install LSP servers
MIT License
203 stars 17 forks source link

Load error: attempt to index field 'document_config' (a nil value) #38

Closed AThilenius closed 7 months ago

AThilenius commented 7 months ago

Hi! I can't seem to make this work, with the default config (below) on either NeoVim 0.9 or 0.10. I haven't finished ruling out something weird about my NixOS setup that's causing it yet.

Full init.lua

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  {
    "dundalek/lazy-lsp.nvim",
    dependencies = { "neovim/nvim-lspconfig" },
    config = function()
      require("lazy-lsp").setup {}
    end
  },
})

Output of :messages

ruby_ls is deprecated, use ruby_lsp instead.
This feature will be removed in lspconfig version 0.2.0
Failed to run `config` for lazy-lsp.nvim
...l/share/nvim/lazy/lazy-lsp.nvim/lua/lazy-lsp/helpers.lua:73: attempt to index field 'document_config' (a nil value)
# stacktrace:
  - /lazy-lsp.nvim/lua/lazy-lsp/helpers.lua:73 _in_ **build_filetype_to_servers_index**
  - /lazy-lsp.nvim/lua/lazy-lsp/helpers.lua:109 _in_ **enabled_filetypes_to_servers**
  - /lazy-lsp.nvim/lua/lazy-lsp/helpers.lua:125 _in_ **server_configs**
  - /lazy-lsp.nvim/lua/lazy-lsp/init.lua:7 _in_ **setup**
  - init.lua:21 _in_ **config**
  - init.lua:16

The part about ruby_ls leads me to believe this might be something weird with my own system? Hoping someone has seen this before and can point me in the right direction. I've gone full NixOS, and Mason really doesn't work with it.

dundalek commented 7 months ago

Turns out there was a breaking change made 3 days ago: https://github.com/neovim/nvim-lspconfig/pull/3105

I pushed a fix https://github.com/dundalek/lazy-lsp.nvim/commit/19d2a4de3a57deed4aab304704c1f5e77454f4f3 if you update to latest version of lazy-lsp the error should go away.

AThilenius commented 7 months ago

Talk about a fast turnaround! You're awesome, thank you so much! That did indeed fix it.

dundalek commented 7 months ago

cool, thanks :+1: