Commit 736ef26
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
(nil != root_dir). The second client gets cmd_cwd set (due to the
side effect), so subsequent buffers correctly reuse it.
Solution: Use on_new_config to ensure cmd_cwd is always set before
client creation. Update reuse_client to compare without mutation,
with fallback to root_dir for backward compatibility.1 parent ac98db2 commit 736ef26
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | | - | |
25 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
0 commit comments