Sun, 05 Mar 2023 15:14:03 -0500
disable rubocop and formatting in solargraph, add standardrb glue
--- a/.config/nvim/lua/config/lsp.lua +++ b/.config/nvim/lua/config/lsp.lua @@ -39,6 +39,28 @@ vim.api.nvim_create_autocmd("LspAttach", }) end, }) - end }) + +-- This can be removed when mason-lspconfig gets support for standardrb +if vim.fn.executable("standardrb") == 1 then + local lsp_ruby = vim.api.nvim_create_augroup("lsp_ruby", {clear = true}) + + vim.api.nvim_create_autocmd("FileType", { + pattern = "ruby", + group = lsp_ruby, + once = true, + callback = function() + require("lspconfig").standardrb.setup({}) + end, + }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = "ruby", + group = lsp_ruby, + callback = function() + vim.cmd.LspStart("standardrb") + end, + }) +end +
--- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -18,7 +18,13 @@ return { capabilities = require('cmp_nvim_lsp').default_capabilities(), settings = { gopls = { gofumpt = true } } }) - end + end, + solargraph = function () + require("lspconfig").solargraph.setup({ + capabilities = require('cmp_nvim_lsp').default_capabilities(), + init_options = { formatting = false } + }) + end, }) end, },