Need help to set up the pbkit language server for protobuf files

Hi everyone,

I am trying to set up the pbkit language server for protobuf files. Since it is not part of the nvim-lspconfig repo’s server configurations, I have to figure the way out myself. It doesn’t seem to be too difficult, as I can start from the bufls configuration. The following is what I have at the moment:

return {
        default_config = {
                cmd = { "pb", "lsp" },
                filetypes = { "proto" },
                single_file_support = true,
                root_dir = function() end,
        },
}

When I tried to open a protobuf file in neovim, I could tell that the pbkit language server started correctly from my status line. However, whenever I tried to do something related to the lsp (e.g., go to the definition of some defined messages, or trigger the auto-completion), I got a bizarre message from neovim, as shown in the screenshot. Neovim seems to show that the lsp server received the request from the client. However, instead of handling the request directly, it prompts the user to decide which request should be handled. I have never seen this behavior before.

I also tried to set up pbkit with coc.nvim in neovim and it worked as expected. Then I also managed to make it work with helix. I am wondering whether it is something I need to do in my neovim config to make the native lsp work with this specific language server?

Thanks for your help!

Hi – coincidentally I was trying to do the same thing and faced the same issue. It’s not neovim which is acknowledging it has received a request, but the LSP server itself (see here). This is technically configurable, but it doesn’t appear as if that is exposed to the CLI. I manually set the defaults to false for those config options and it seemed to start working.

I assume the other editors/plugins just discard those messages – not sure if there’s a way to do that here. Ideally those config options would be exposed, which might be worth making a PR for.

Hi zbaylin, thanks for the tips. Do you mean you set the sendReceivedMessageRequest option of the logConfig to false to make things work? I tried that, and it did make syntax highlighting and autocompletion work. However, it does not respond to my keystrokes to goto definition of a field. The goto definition feature works with other editors though. Did you get the goto definition feature to work in neovim?

I found that goto definition actually works with your suggestion. It was one of other plugins that messed it up. Thank you so much for your help!

@zbaylin, after using pbkit a few more days, I found that cross-file goto definition doesn’t work with your workaround in neovim. However, It works fine with coc.nvim and helix which don’t require the workaround you mentioned. Did you ever get the cross-file goto-defitinon feature to work in neovim?