Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion lsp/buf_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,31 @@
--- buf lsp included in the cli itself
---
--- buf lsp is a Protobuf language server compatible with Buf modules and workspaces
---
--- buf lsp also supports Buf configuration files. The `buf-config` filetype is not
--- detected automatically; register it manually (see below) or override the filetypes:
---
--- ```lua
--- vim.filetype.add({
--- filename = {
--- ['buf.yaml'] = 'buf-config',
--- ['buf.gen.yaml'] = 'buf-config',
--- ['buf.policy.yaml'] = 'buf-config',
--- ['buf.lock'] = 'buf-config',
--- },
--- })
--- ```
---
--- Optionally, tell treesitter to treat buf config files as YAML for syntax highlighting:
---
--- ```lua
--- vim.treesitter.language.register('yaml', 'buf-config')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be moot with vim/vim#19935 / neovim/neovim#38897, since all of the extensions / names are taken care of upstream...

--- ```

---@type vim.lsp.Config
return {
cmd = { 'buf', 'lsp', 'serve', '--log-format=text' },
filetypes = { 'proto' },
filetypes = { 'proto', 'buf-config' },
root_markers = { 'buf.yaml', '.git' },
reuse_client = function(client, config)
-- `buf lsp serve` is meant to be used with multiple workspaces.
Expand Down