all repos

gopher.nvim @ 7764f6e37f1fbf641378428bf9a9b496d0a5437e

Minimalistic plugin for Go development
5 files changed, 0 insertions(+), 31 deletions(-)
revert: automatically restart lsp server (#128)

semi revert of 7c198a1b3673a29e95ffed41c297933ba8467fee
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed by: GitHub noreply@github.com
Committed at: 2025-11-25 17:02:38 +0200
Parent: f599e75
M README.md

@@ -219,9 +219,6 @@

-- timeout for running installer commands(e.g :GoDepsInstall, :GoDepsInstallSync) installer_timeout = 999999, - -- restart gopls server after commands like `:GoMod`, `:GoGet`, `:GoWork` - restart_lsp = false, - -- user specified paths to binaries commands = { go = "go",
M doc/gopher.nvim.txt

@@ -61,9 +61,6 @@ -- timeout for running installer commands(e.g :GoDepsInstall, :GoDepsInstallSync)

---@type number installer_timeout = 999999, - -- restart gopls server after commands like `:GoMod`, `:GoGet`, `:GoWork` - restart_lsp = false, - -- user specified paths to binaries ---@class gopher.ConfigCommand commands = {
D

@@ -1,11 +0,0 @@

-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
M lua/gopher/config.lua

@@ -33,9 +33,6 @@ -- timeout for running installer commands(e.g :GoDepsInstall, :GoDepsInstallSync)

---@type number installer_timeout = 999999, - -- restart gopls server after commands like `:GoMod`, `:GoGet`, `:GoWork` - restart_lsp = false, - -- user specified paths to binaries ---@class gopher.ConfigCommand commands = {

@@ -101,7 +98,6 @@

vim.validate("log_level", _config.log_level, "number") vim.validate("timeout", _config.timeout, "number") vim.validate("installer_timeout", _config.timeout, "number") - vim.validate("restart_lsp", _config.restart_lsp, "boolean") vim.validate("commands", _config.commands, "table") vim.validate("commands.go", _config.commands.go, "string") vim.validate("commands.gomodifytags", _config.commands.gomodifytags, "string")
M lua/gopher/go.lua

@@ -1,6 +1,5 @@

local c = require "gopher.config" local u = require "gopher._utils" -local lsp = require "gopher._utils.lsp" local r = require "gopher._utils.runner" local go = {}

@@ -14,12 +13,6 @@ u.notify(c.commands.go .. " " .. subcmd .. " ran successful")

return rs.stdout end -local function restart_lsp() - if c.restart_lsp then - lsp.restart() - end -end - ---@param args string[] function go.get(args) for i, arg in ipairs(args) do

@@ -29,13 +22,11 @@ table.insert(args, i, m)

end run("get", args) - restart_lsp() end ---@param args string[] function go.mod(args) run("mod", args) - restart_lsp() end ---@param args string[]

@@ -43,7 +34,6 @@ function go.work(args)

-- TODO: use `gopls.tidy` run("work", args) - restart_lsp() end ---Executes `go generate`