feat: automatically restart lsp server (opt-in)

This commit is contained in:
Oleksandr Smirnov 2025-09-10 15:55:43 +03:00
parent 440a7cc432
commit 7c198a1b36
No known key found for this signature in database
7 changed files with 105 additions and 69 deletions

11
lua/gopher/_utils/lsp.lua Normal file
View file

@ -0,0 +1,11 @@
local lsp = {}
local gopls = "gopls"
-- Restarts gopls server (see: `:h lsp-restart`)
function lsp.restart()
vim.lsp.enable(gopls, false)
vim.lsp.enable(gopls, true)
end
return lsp