replace utils.notify by utils.warn (#168)

pull/180/head
liangkai 2 years ago committed by GitHub
parent 0e8cc90e30
commit dffe933fd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,11 +13,10 @@ local gofmt_args = _GO_NVIM_CFG.gofmt_args or {
"--base-formatter=" .. gofmt,
}
local goimport_args = _GO_NVIM_CFG.goimport_args
or {
"--max-len=" .. tostring(max_len),
"--base-formatter=goimports",
}
local goimport_args = _GO_NVIM_CFG.goimport_args or {
"--max-len=" .. tostring(max_len),
"--base-formatter=goimports",
}
local run = function(fmtargs, bufnr, cmd)
log(fmtargs, bufnr, cmd)
@ -70,7 +69,7 @@ local run = function(fmtargs, bufnr, cmd)
data = utils.handle_job_data(data)
log(vim.inspect(data) .. "from stderr")
end,
on_exit = function(_, data, _) -- id, data, event
on_exit = function(_, data, _) -- id, data, event
-- log(vim.inspect(data) .. "exit")
if data ~= 0 then
return vim.notify("golines failed " .. tostring(data), vim.lsp.log_levels.ERROR)
@ -108,11 +107,11 @@ M.gofmt = function(...)
all_buf = true
end
if not install(gofmt) then
utils.notify("installing ".. gofmt .. " please retry after installation")
utils.warn("installing " .. gofmt .. " please retry after installation")
return
end
if not install("golines") then
utils.notify("installing golines , please rerun format after install finished")
utils.warn("installing golines , please rerun format after install finished")
return
end
local a = {}
@ -140,7 +139,7 @@ M.org_imports = function(wait_ms)
codeaction("", "source.organizeImports", wait_ms)
vim.defer_fn(function()
vim.lsp.buf.format({ async = _GO_NVIM_CFG.lsp_fmt_async })
end, 100)
end, 100)
end
M.goimport = function(...)

Loading…
Cancel
Save