LunarVim.LunarVim/ftplugin/ruby.lua

25 lines
853 B
Lua
Raw Normal View History

2021-04-16 22:57:08 +05:45
-- If you are using rvm, make sure to change below configuration
require'lspconfig'.solargraph.setup {
2021-06-30 18:45:40 -04:00
cmd = {DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "--stdio"},
2021-04-16 22:57:08 +05:45
on_attach = require'lsp'.common_on_attach,
handlers = {
2021-06-30 22:09:18 -04:00
["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = O.lang.ruby.diagnostics.virtual_text,
signs = O.lang.ruby.diagnostics.signs,
underline = O.lang.ruby.diagnostics.underline,
update_in_insert = true
2021-04-16 22:57:08 +05:45
2021-06-30 22:09:18 -04:00
})
2021-04-16 22:57:08 +05:45
},
2021-06-30 18:45:40 -04:00
filetypes = O.lang.ruby.filetypes
2021-04-16 22:57:08 +05:45
}
2021-06-30 18:45:40 -04:00
if O.lang.ruby.autoformat then
require('lv-utils').define_augroups({
_ruby_format = {
2021-06-30 22:09:18 -04:00
{'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
2021-06-30 18:45:40 -04:00
}
})
end