nvim-lua / lsp-status.nvim

Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
MIT License
625 stars 41 forks source link

status() is missing current function, only shows diagnostic info #26

Closed smartding closed 3 years ago

smartding commented 3 years ago

I'm using NVIM v0.5.0-881-g4537ff659 with gopls, and lsp-status is configured as follows:

local custom_attach = function(client)
  require'compe_nvim_lsp'.attach(client)
  require'lsp-status'.on_attach(client)
end

local with_snip_support = require'lsp-status'.capabilities
with_snip_support.textDocument.completion.completionItem.snippetSupport = true

require'lspconfig'.gopls.setup{
  on_attach = custom_attach,
  capabilities = with_snip_support,
}

require'lsp-status'.register_progress()
require'lsp-status'.config{
  status_symbol = ''
}

I notice the status function only shows diagnostic info, but the current function name is missing.

wbthomason commented 3 years ago

Does gopls support textDocument/documentSymbol? Have you previously had the current function name in the result of status and this is a regression, or is this the first time you've tried to use lsp-status? Where do you call the status() function (e.g. is it getting updated)?

smartding commented 3 years ago

Does gopls support textDocument/documentSymbol? Have you previously had the current function name in the result of status and this is a regression, or is this the first time you've tried to use lsp-status? Where do you call the status() function (e.g. is it getting updated)?

lsp-status works with gopls one commit ago, that is if I rollback lsp-status to commit id fb6b54e4c36481721819244788b278e7860afa85, everything works. So I guess it's a regression. For debugging purpose, I just call status() in neovim command like this : lua print(require('lsp-status').status()).

wbthomason commented 3 years ago

Gotcha. Thanks for the report - it turns out this was an extremely stupid typo on my part.