Commit 52b3eea
committed
fix(ruby_lsp): prevent duplicate clients on second buffer
Problem: When opening multiple Ruby buffers, a second LSP client is
spawned instead of reusing the first client, even though they share
the same root directory.
Root cause: The reuse_client function sets cmd_cwd as a side effect
during reuse checks. This means the first client is created without
cmd_cwd set, causing the reuse check to fail for the second buffer.
Solution: Use before_init to ensure cmd_cwd is set for every client.
Remove the custom reuse_client function to use Neovim's default
reuse logic (compare name + root_dir).
Testing: Tested with Neovim 0.11.4 by opening 3 Ruby files. All
buffers now correctly reuse the first client.1 parent ac98db2 commit 52b3eea
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
0 commit comments