.config/nvim/lua/config/lsp.lua

changeset 1061
8141190cc943
parent 1059
dc0095e5bbc8
child 1062
77bf3b44f6f9
equal deleted inserted replaced
1060:c20cb89a2ee9 1061:8141190cc943
42 end 42 end
43 }) 43 })
44 44
45 -- This can be removed when mason-lspconfig gets support for standardrb 45 -- This can be removed when mason-lspconfig gets support for standardrb
46 if vim.fn.executable("standardrb") == 1 then 46 if vim.fn.executable("standardrb") == 1 then
47 local lsp_ruby = vim.api.nvim_create_augroup("lsp_ruby", {clear = true})
48
49 vim.api.nvim_create_autocmd("FileType", { 47 vim.api.nvim_create_autocmd("FileType", {
50 pattern = "ruby", 48 pattern = "ruby",
51 group = lsp_ruby, 49 group = vim.api.nvim_create_augroup("lsp_ruby", {clear = true}),
52 once = true, 50 once = true,
53 callback = function() 51 callback = function()
54 require("lspconfig").standardrb.setup({}) 52 require("lspconfig").standardrb.setup({
55 end, 53 autostart = true,
56 }) 54 single_file_support = true
57 55 })
58 vim.api.nvim_create_autocmd("FileType", {
59 pattern = "ruby",
60 group = lsp_ruby,
61 callback = function()
62 vim.cmd.LspStart("standardrb") 56 vim.cmd.LspStart("standardrb")
63 end, 57 end,
64 }) 58 })
65 end 59 end
66 60

mercurial