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
621 stars 41 forks source link

Not getting any messages... #59

Closed samtgarson closed 3 years ago

samtgarson commented 3 years ago

Hey there, thanks for your work on OSS!

While setting up lualine, I've successfully integrated diagnostic counts from this plugin but trying to integrate the progress messages / spinner and I don't seem to be receiving any messages.

The relevant parts of my config are here and here. I've done some debugging and even just importing the messages function from messaging just returns an empty table.

AFAIK there's no way of debugging whether the clients have been successfully registered...? Thanks ✌️

wbthomason commented 3 years ago

Thanks! I believe you just need to call status.on_attach rather than status.register_client, e.g. https://github.com/nvim-lua/lsp-status.nvim/blob/master/lua/lsp-status.lua#L80

samtgarson commented 3 years ago

@wbthomason thanks for the quick reply, I forgot to change it back but I had previously used that. Can you spot anything else obvious?

I’m not a lua guy, does it matter that the two parts are in different files?

wbthomason commented 3 years ago

It shouldn't matter that the two parts are in different files, I think. It may just be that the servers you're using don't send messages - maybe try with something like sumneko-lua or rust-analyzer or clangd and see if you start seeing messages (while using on_attach)

samtgarson commented 3 years ago

I'm pretty sure the Typescript I'm using sumneko-lua to edit those lua files, presumably I should get something when I open the file?

I've reverted the on_attach to this:

local on_attach = function(client, bufnr)
  lsp_status.on_attach(client)

and have amended the lualine function to this:

    lualine_x = {function ()
      local progress = lsp_status.status_progress()
      print('PROGRESS: ', progress)
      return progress
    end},

My messages look like this 😞 image

Strikes me that the vim.lsp.handlers['$/progress'] might not be receiving anything... I'll have to do a bit more digging.

samtgarson commented 3 years ago

I had some other issues with my lua language server setup, I'm now seeing progress messages for lua files 🙌

I guess the other servers I'm using don't report progress. Thanks!

wbthomason commented 3 years ago

Great, I'm glad things are working now!