I am trying to configure Protobuf LSP support with nvim (I am using Lazyvim package manager). I've read here that bufls is deprecated and that we should be using buf_ls. Using this snippet, I've configured LSP like such:
-- in ./config/nvim/lua/plugins/lsp-config.lua
return {
{
"neovim/nvim-lspconfig",
...
config = function()
require("lspconfig").buf_ls.setup({
cmd = { "buf", "beta", "lsp", "--timeout", "0", "--log-format=text" },
filetypes = { "proto" },
root_dir = require("lspconfig.util").root_pattern("buf.yaml", ".git"),
})
end,
As the result:
:LspInfocorrectly returns LSP information- I have syntax highlighting working
- But neither
symbolsnorgo to definitionwork!
For context, similar configuration (just using JSON instead of Lua) yields all LSP features with Zed IDE.
Having run :lua vim.lsp.buf.document_symbol() on a .proto file I got:
Error 15:36:06 notify.error method textDocument/documentSymbol is not supported by any of the servers registered for the current buffer
I think what that means is that buf_ls doesn't have symbol support (yet?): https://github.com/bufbuild/buf#buf ...and that Zed achieves this via a combination of features. Is there a way to achieve the same with nvim? Any hint or help would be appreciated!
bufcode (github.com/bufbuild/buf/blob/main/private/buf/buflsp/nyi.go), "Go to Definition" and "DocumentSymbol" are not yet implemented./,*,ntakes long for navigating long*.protofiles, let alone if those files refer to other imported files.