From 903045b001a013a1b321b1121db711820f94e588 Mon Sep 17 00:00:00 2001 From: Rich Grundy Date: Thu, 25 Sep 2025 21:29:51 +0100 Subject: fix(ruby_lsp): set cmd_cwd to root_dir #4099 Problem: When running from a directory other than root (i.e monorepo), ruby-lsp does not load correctly. Unsure why, previous lspconfig had cmd_cwd set to the same as root_dir. Solution: Set the cmd_cwd via reuse_client(), similar to ast_grep. See #3850, #4082 for more details. Tested both from root_dir and monorepo multi-root project. --- lsp/ruby_lsp.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lsp/ruby_lsp.lua') diff --git a/lsp/ruby_lsp.lua b/lsp/ruby_lsp.lua index 9f32aabc..87e2f598 100644 --- a/lsp/ruby_lsp.lua +++ b/lsp/ruby_lsp.lua @@ -20,4 +20,8 @@ return { init_options = { formatter = 'auto', }, + reuse_client = function(client, config) + config.cmd_cwd = config.root_dir + return client.config.cmd_cwd == config.cmd_cwd + end, } -- cgit v1.2.3-70-g09d2