From 2e92288351d3b0a9e5c8d8de7d1a9aaa0e5c40e9 Mon Sep 17 00:00:00 2001 From: Imron Gamidli <36050790+gogamid@users.noreply.github.com> Date: Wed, 6 Nov 2024 06:38:53 +0100 Subject: [PATCH] feat(buf): new lsp for protobuf (#3414) new server bufls for protobuf filetype --- lua/lspconfig.lua | 4 ++++ lua/lspconfig/configs/buf_ls.lua | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 lua/lspconfig/configs/buf_ls.lua diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua index 76c3c4ac3e..5ab7d865b8 100644 --- a/lua/lspconfig.lua +++ b/lua/lspconfig.lua @@ -35,6 +35,10 @@ local aliases = { to = 'ts_ls', version = '0.2.1', }, + bufls = { + to = 'bufls', + version = '0.2.1', + }, } ---@return Alias diff --git a/lua/lspconfig/configs/buf_ls.lua b/lua/lspconfig/configs/buf_ls.lua new file mode 100644 index 0000000000..2ce9fc74c9 --- /dev/null +++ b/lua/lspconfig/configs/buf_ls.lua @@ -0,0 +1,16 @@ +return { + default_config = { + cmd = { 'buf', 'beta', 'lsp', '--timeout=0', '--log-format=text' }, + filetypes = { 'proto' }, + root_dir = require('lspconfig.util').root_pattern('buf.yaml', '.git'), + }, + docs = { + description = [[ +https://github.com/bufbuild/buf + +buf beta lsp included in the cli itself + +buf beta lsp is a Protobuf language server compatible with Buf modules and workspaces +]], + }, +}