From c4cc7419514e7a978b1c9a98d616c5d6d399631e Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Sun, 2 Oct 2022 11:41:24 +1100 Subject: feat: add ruby-lsp server configuration (#2169) --- lua/lspconfig/server_configurations/ruby_ls.lua | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lua/lspconfig/server_configurations/ruby_ls.lua (limited to 'lua/lspconfig/server_configurations/ruby_ls.lua') diff --git a/lua/lspconfig/server_configurations/ruby_ls.lua b/lua/lspconfig/server_configurations/ruby_ls.lua new file mode 100644 index 00000000..ba41dd5a --- /dev/null +++ b/lua/lspconfig/server_configurations/ruby_ls.lua @@ -0,0 +1,38 @@ +local util = require 'lspconfig.util' + +local bin_name = 'ruby-lsp' + +-- defaults to stdio +local cmd = { bin_name } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'ruby' }, + root_dir = util.root_pattern('Gemfile', '.git'), + }, + docs = { + description = [[ +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 +group :development do + gem "ruby-lsp", require: false +end +``` + ]], + default_config = { + root_dir = [[root_pattern("Gemfile", ".git")]], + }, + }, +} -- cgit v1.2.3-70-g09d2