mirror of
https://github.com/neovim/nvim-lspconfig.git
synced 2025-12-24 15:01:00 +01:00
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.
28 lines
665 B
Lua
28 lines
665 B
Lua
---@brief
|
|
---
|
|
--- https://shopify.github.io/ruby-lsp/
|
|
---
|
|
--- This gem is an implementation of the language server protocol specification for
|
|
--- Ruby, used to improve editor features.
|
|
---
|
|
--- Install the gem. There's no need to require it, since the server is used as a
|
|
--- standalone executable.
|
|
---
|
|
--- ```sh
|
|
--- gem install ruby-lsp
|
|
--- ```
|
|
|
|
---@type vim.lsp.Config
|
|
return {
|
|
cmd = { 'ruby-lsp' },
|
|
filetypes = { 'ruby', 'eruby' },
|
|
root_markers = { 'Gemfile', '.git' },
|
|
init_options = {
|
|
formatter = 'auto',
|
|
},
|
|
reuse_client = function(client, config)
|
|
config.cmd_cwd = config.root_dir
|
|
return client.config.cmd_cwd == config.cmd_cwd
|
|
end,
|
|
}
|