From effe4bf2e1afb881ea67291c648b68dd3dfc927a Mon Sep 17 00:00:00 2001 From: Masayuki Izumi Date: Sun, 30 Nov 2025 13:40:18 +0900 Subject: 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. --- lsp/buf_ls.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lsp/buf_ls.lua') 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, } -- cgit v1.2.3-70-g09d2