2024-07-19 10:09:57 +01:00
|
|
|
if lazyvim_docs then
|
|
|
|
-- LSP Server to use for Ruby.
|
|
|
|
-- Set to "solargraph" to use solargraph instead of ruby_lsp.
|
|
|
|
vim.g.lazyvim_ruby_lsp = "ruby_lsp"
|
|
|
|
vim.g.lazyvim_ruby_formatter = "rubocop"
|
|
|
|
end
|
|
|
|
|
|
|
|
local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp"
|
|
|
|
if vim.fn.has("nvim-0.10") == 0 then
|
|
|
|
-- ruby_lsp does not work well with Neovim < 0.10
|
|
|
|
lsp = vim.g.lazyvim_ruby_lsp or "solargraph"
|
|
|
|
end
|
|
|
|
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
|
|
|
|
2023-06-17 07:27:15 +01:00
|
|
|
return {
|
2024-05-18 14:39:20 +02:00
|
|
|
recommended = function()
|
|
|
|
return LazyVim.extras.wants({
|
|
|
|
ft = "ruby",
|
|
|
|
root = "Gemfile",
|
|
|
|
})
|
|
|
|
end,
|
2023-06-17 07:27:15 +01:00
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2024-06-07 09:03:59 +02:00
|
|
|
opts = { ensure_installed = { "ruby" } },
|
2023-06-17 07:27:15 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
2024-07-19 10:09:57 +01:00
|
|
|
---@class PluginLspOpts
|
2023-06-17 07:27:15 +01:00
|
|
|
opts = {
|
2024-07-19 10:09:57 +01:00
|
|
|
---@type lspconfig.options
|
2023-06-17 07:27:15 +01:00
|
|
|
servers = {
|
2024-07-19 10:09:57 +01:00
|
|
|
ruby_lsp = {
|
|
|
|
enabled = lsp == "ruby_lsp",
|
|
|
|
},
|
|
|
|
solargraph = {
|
|
|
|
enabled = lsp == "solargraph",
|
|
|
|
},
|
|
|
|
rubocop = {
|
|
|
|
enabled = formatter == "rubocop",
|
|
|
|
},
|
|
|
|
standardrb = {
|
|
|
|
enabled = formatter == "standardrb",
|
|
|
|
},
|
2023-06-17 07:27:15 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-07-19 10:09:57 +01:00
|
|
|
{
|
|
|
|
"williamboman/mason.nvim",
|
|
|
|
opts = { ensure_installed = { "erb-formatter", "erb-lint" } },
|
|
|
|
},
|
2023-06-17 07:27:15 +01:00
|
|
|
{
|
|
|
|
"mfussenegger/nvim-dap",
|
|
|
|
optional = true,
|
|
|
|
dependencies = {
|
|
|
|
"suketa/nvim-dap-ruby",
|
|
|
|
config = function()
|
|
|
|
require("dap-ruby").setup()
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
2024-07-19 10:09:57 +01:00
|
|
|
{
|
|
|
|
"stevearc/conform.nvim",
|
|
|
|
optional = true,
|
|
|
|
opts = {
|
|
|
|
formatters_by_ft = {
|
|
|
|
ruby = { formatter },
|
|
|
|
eruby = { "erb-format" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-06-17 07:27:15 +01:00
|
|
|
{
|
|
|
|
"nvim-neotest/neotest",
|
|
|
|
optional = true,
|
|
|
|
dependencies = {
|
|
|
|
"olimorris/neotest-rspec",
|
|
|
|
},
|
|
|
|
opts = {
|
|
|
|
adapters = {
|
|
|
|
["neotest-rspec"] = {
|
|
|
|
-- NOTE: By default neotest-rspec uses the system wide rspec gem instead of the one through bundler
|
|
|
|
-- rspec_cmd = function()
|
|
|
|
-- return vim.tbl_flatten({
|
|
|
|
-- "bundle",
|
|
|
|
-- "exec",
|
|
|
|
-- "rspec",
|
|
|
|
-- })
|
|
|
|
-- end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|