From abaf5fb6c496ecc9a19de1c2fbdf87a905138023 Mon Sep 17 00:00:00 2001 From: Rintaro Okamura Date: Mon, 22 Aug 2022 11:54:51 +0900 Subject: feat: add buf-language-server support (#2073) --- lua/lspconfig/server_configurations/bufls.lua | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lua/lspconfig/server_configurations/bufls.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/bufls.lua b/lua/lspconfig/server_configurations/bufls.lua new file mode 100644 index 00000000..aa25b4c0 --- /dev/null +++ b/lua/lspconfig/server_configurations/bufls.lua @@ -0,0 +1,33 @@ +local util = require 'lspconfig.util' + +local bin_name = 'bufls' +local cmd = { bin_name, 'serve' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, 'start' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'proto' }, + root_dir = function(fname) + return util.root_pattern('buf.work.yaml', '.git')(fname) + end, + }, + docs = { + description = [[ +https://github.com/bufbuild/buf-language-server + +`buf-language-server` can be installed via `go install`: +```sh +go install github.com/bufbuild/buf-language-server/cmd/bufls@latest +``` + +bufls is a Protobuf language server compatible with Buf modules and workspaces +]], + default_config = { + root_dir = [[root_pattern("buf.work.yaml", ".git")]], + }, + }, +} -- cgit v1.2.3-70-g09d2