mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
update config to enable user to configure lsp/formatter
This makes it possible to configure ruby lsp and formatter without overriding the lsp config!
This commit is contained in:
parent
4cd5c4162a
commit
2f4375f38e
1 changed files with 21 additions and 5 deletions
|
|
@ -1,3 +1,13 @@
|
||||||
|
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"
|
||||||
|
local formatter = vim.g.lazyvim_ruby_formatter or "rubocop"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
recommended = function()
|
recommended = function()
|
||||||
return LazyVim.extras.wants({
|
return LazyVim.extras.wants({
|
||||||
|
|
@ -15,12 +25,18 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
---@type lspconfig.options
|
---@type lspconfig.options
|
||||||
servers = {
|
servers = {
|
||||||
-- disable solargraph from auto running when you open ruby files
|
ruby_lsp = {
|
||||||
solargraph = {
|
enabled = lsp == "ruby_lsp",
|
||||||
autostart = false,
|
},
|
||||||
|
solargraph = {
|
||||||
|
enabled = lsp == "solargraph",
|
||||||
|
},
|
||||||
|
rubocop = {
|
||||||
|
enabled = formatter == "rubocop",
|
||||||
|
},
|
||||||
|
standardrb = {
|
||||||
|
enabled = formatter == "standardrb",
|
||||||
},
|
},
|
||||||
-- ruby_lsp will be automatically installed with mason and loaded with lspconfig
|
|
||||||
ruby_lsp = {},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue