diff options
| author | Masayuki Izumi <m@izum.in> | 2025-11-30 13:40:18 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-29 23:40:18 -0500 |
| commit | effe4bf2e1afb881ea67291c648b68dd3dfc927a (patch) | |
| tree | f95f5f4302ee0a8fac5ca2d650af8171c406bb79 /lsp/buf_ls.lua | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.tar nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.tar.gz nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.tar.bz2 nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.tar.lz nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.tar.xz nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.tar.zst nvim-lspconfig-effe4bf2e1afb881ea67291c648b68dd3dfc927a.zip | |
fix(buf_ls): restrict reuse_client to buf_ls clients only #4221
The previous implementation used `reuse_client = function() return true
end`,
which caused buf_ls to reuse *any* existing LSP client. As a result,
when a
Copilot LSP client was already running, buf_ls attempted to reuse that
client
instead of spawning its own, preventing buf_ls from attaching to .proto
buffers.
Restrict reuse_client so only buf_ls clients can be reused.
Diffstat (limited to 'lsp/buf_ls.lua')
| -rw-r--r-- | lsp/buf_ls.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lsp/buf_ls.lua b/lsp/buf_ls.lua index 5e621a22..379aaa7e 100644 --- a/lsp/buf_ls.lua +++ b/lsp/buf_ls.lua @@ -10,8 +10,8 @@ return { cmd = { 'buf', 'lsp', 'serve', '--timeout=0', '--log-format=text' }, filetypes = { 'proto' }, root_markers = { 'buf.yaml', '.git' }, - reuse_client = function() + reuse_client = function(client, config) -- `buf lsp serve` is meant to be used with multiple workspaces. - return true + return client.name == config.name end, } |
