diff options
| author | Hasun Park <hasunpark@onbi.kr> | 2026-01-30 06:37:04 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-29 16:37:04 -0500 |
| commit | cef0acd55136c16b3955bd9334358fb66106387c (patch) | |
| tree | f08b53eb7d199b76e94baf267d833a663a925251 /lsp/ruby_lsp.lua | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.tar nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.tar.gz nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.tar.bz2 nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.tar.lz nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.tar.xz nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.tar.zst nvim-lspconfig-cef0acd55136c16b3955bd9334358fb66106387c.zip | |
fix(ruby_lsp): send cwd to ls cmd #4293
Problem:
Ruby-lsp spawns in cwd even if lsp detected root directory correctly.
Solution:
Send CWD in the start cmd.
Diffstat (limited to 'lsp/ruby_lsp.lua')
| -rw-r--r-- | lsp/ruby_lsp.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lsp/ruby_lsp.lua b/lsp/ruby_lsp.lua index 87e2f598..da716492 100644 --- a/lsp/ruby_lsp.lua +++ b/lsp/ruby_lsp.lua @@ -14,7 +14,13 @@ ---@type vim.lsp.Config return { - cmd = { 'ruby-lsp' }, + cmd = function(dispatchers, config) + return vim.lsp.rpc.start( + { 'ruby-lsp' }, + dispatchers, + config.root_dir and { cwd = config.cmd_cwd or config.root_dir } + ) + end, filetypes = { 'ruby', 'eruby' }, root_markers = { 'Gemfile', '.git' }, init_options = { |
