2022-03-20 10:22:32 +08:00
|
|
|
local util = require 'lspconfig.util'
|
2021-10-05 15:13:10 +08:00
|
|
|
|
|
|
|
local bin_name = 'solargraph'
|
|
|
|
if vim.fn.has 'win32' == 1 then
|
2024-06-13 08:44:55 +08:00
|
|
|
bin_name = bin_name .. '.bat'
|
2021-10-05 15:13:10 +08:00
|
|
|
end
|
2022-03-20 10:22:32 +08:00
|
|
|
|
|
|
|
return {
|
2021-10-05 15:13:10 +08:00
|
|
|
default_config = {
|
2024-06-13 08:44:55 +08:00
|
|
|
cmd = { bin_name, 'stdio' },
|
2021-10-05 15:13:10 +08:00
|
|
|
settings = {
|
|
|
|
solargraph = {
|
|
|
|
diagnostics = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
init_options = { formatting = true },
|
|
|
|
filetypes = { 'ruby' },
|
|
|
|
root_dir = util.root_pattern('Gemfile', '.git'),
|
|
|
|
},
|
|
|
|
docs = {
|
2024-06-13 08:44:55 +08:00
|
|
|
package_json = 'https://raw.githubusercontent.com/castwide/vscode-solargraph/master/package.json',
|
2021-10-05 15:13:10 +08:00
|
|
|
description = [[
|
|
|
|
https://solargraph.org/
|
|
|
|
|
|
|
|
solargraph, a language server for Ruby
|
|
|
|
|
|
|
|
You can install solargraph via gem install.
|
|
|
|
|
|
|
|
```sh
|
|
|
|
gem install --user-install solargraph
|
|
|
|
```
|
|
|
|
]],
|
|
|
|
default_config = {
|
|
|
|
root_dir = [[root_pattern("Gemfile", ".git")]],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|