diff options
Diffstat (limited to 'config/nvim/lua/lsp.lua')
| -rw-r--r-- | config/nvim/lua/lsp.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 2c2cbf2..9838887 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -116,6 +116,27 @@ vim.lsp.config('sourcekit', { }) vim.lsp.enable('sourcekit') +-- RUBY ------------------------------------------------------------------------ +vim.lsp.config('ruby', { + cmd = function(dispatchers, config) + return vim.lsp.rpc.start( + { 'mise x -- ruby-lsp' }, + dispatchers, + config and config.root_dir and { cwd = config.cmd_cwd or config.root_dir } + ) + end, + 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, +}) +vim.lsp.enable('ruby') + -- Enable inlay hints for Rust when LSP attaches vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) |