Skip to content

table index is nil in util.lua #69

@gabysbrain

Description

@gabysbrain

I tried setting up lsp-status according to the example config in the readme but once my lsp loads I get an error (also see #9 (comment) who seems to be having the same issue):

Error executing vim.schedule lua callback: .../start/lsp-status.nvim/lua/lsp-status/util.lua:62: table index is nil

My lsp/lsp-status config is here. It's basically the lsp-status config from the readme but integrated into the default config from lspconfig.

-- setup lsp status
local lsp_status = require('lsp-status')
lsp_status.config({
})
lsp_status.register_progress()

local nvim_lsp = require('lspconfig')

-- 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)
  local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
  local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end

  -- Enable completion triggered by <c-x><c-o>
  buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')

-- key bindings

-- lsp_status
  lsp_status.on_attach(client)
end

-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'julials' }
for _, lsp in ipairs(servers) do
  nvim_lsp[lsp].setup {
    on_attach = on_attach,
    capabilities = lsp_status.capabilities,
    flags = {
      debounce_text_changes = 150,
    }
  }
end

From looking at the lsp-status source my guess is that id is never set but I can't figure out why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions