Simplify standardrb lsp setup

Sun, 05 Mar 2023 15:36:09 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 05 Mar 2023 15:36:09 -0500
changeset 1061
8141190cc943
parent 1060
c20cb89a2ee9
child 1062
77bf3b44f6f9

Simplify standardrb lsp setup

.config/nvim/lua/config/lsp.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/config/lsp.lua
+++ b/.config/nvim/lua/config/lsp.lua
@@ -44,21 +44,15 @@ vim.api.nvim_create_autocmd("LspAttach",
 
 -- 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,
+    group = vim.api.nvim_create_augroup("lsp_ruby", {clear = true}),
     once = true,
     callback = function()
-      require("lspconfig").standardrb.setup({})
-    end,
-  })
-
-  vim.api.nvim_create_autocmd("FileType", {
-    pattern = "ruby",
-    group = lsp_ruby,
-    callback = function()
+      require("lspconfig").standardrb.setup({
+        autostart = true,
+        single_file_support = true
+      })
       vim.cmd.LspStart("standardrb")
     end,
   })

mercurial