use vim.log.levels instead of vim.lsp.log_levels

pull/294/head
ray-x 1 year ago
parent 4977d3165d
commit 4f3d09f0a3

@ -131,7 +131,7 @@ _GO_NVIM_CFG = {
function go.setup(cfg)
cfg = cfg or {}
if cfg.max_len then
vim.notify('go.nvim max_len renamed to max_line_len', vim.lsp.log_levels.WARN)
vim.notify('go.nvim max_len renamed to max_line_len', vim.log.levels.WARN)
end
if cfg.disable_defaults then
for k, _ in pairs(_GO_NVIM_CFG) do
@ -161,7 +161,7 @@ function go.setup(cfg)
require('go.lsp_diag')
end
elseif not _GO_NVIM_CFG.lsp_cfg and _GO_NVIM_CFG.lsp_on_attach then
vim.notify('lsp_on_attach ignored, because lsp_cfg is false', vim.lsp.log_levels.WARN)
vim.notify('lsp_on_attach ignored, because lsp_cfg is false', vim.log.levels.WARN)
end
vim.defer_fn(function()
@ -209,7 +209,7 @@ go.set_test_runner = function(runner)
return
end
end
vim.notify('runner not supported ' .. runner, vim.lsp.log_levels.ERROR)
vim.notify('runner not supported ' .. runner, vim.log.levels.ERROR)
end
return go

@ -21,7 +21,7 @@ local function convert_short2long(opts)
end
local function err_unknown_opt(opt)
-- vim.notify("Unknown option `-" .. (#opt > 1 and "-" or "") .. opt, vim.lsp.log_levels.INFO)
-- vim.notify("Unknown option `-" .. (#opt > 1 and "-" or "") .. opt, vim.log.levels.INFO)
end
local function canonize(options, opt)
@ -73,7 +73,7 @@ function alt_getopt.get_ordered_opts(arg, sh_opts, long_opts)
opt = canonize(options, opt)
if options[opt] == 0 then
vim.notify("Bad usage of option `" .. a, vim.lsp.log_levels.ERROR)
vim.notify("Bad usage of option `" .. a, vim.log.levels.ERROR)
end
optarg[count] = a:sub(pos + 1)
@ -87,7 +87,7 @@ function alt_getopt.get_ordered_opts(arg, sh_opts, long_opts)
opts[count] = opt
else
if i == #arg then
vim.notify("Missed value for option `" .. a, vim.lsp.log_levels.ERROR)
vim.notify("Missed value for option `" .. a, vim.log.levels.ERROR)
return
end
@ -106,7 +106,7 @@ function alt_getopt.get_ordered_opts(arg, sh_opts, long_opts)
count = count + 1
elseif a:len() == j then
if i == #arg then
vim.notify("Missed value for option `-" .. opt, vim.lsp.log_levels.ERROR)
vim.notify("Missed value for option `-" .. opt, vim.log.levels.ERROR)
end
optarg[count] = arg[i + 1]

@ -3,7 +3,7 @@ local M = {}
function M.is_test_file()
local file = vim.fn.expand('%')
if #file <= 1 then
vim.notify("no buffer name", vim.lsp.log_levels.ERROR)
vim.notify("no buffer name", vim.log.levels.ERROR)
return
end
local is_test = string.find(file, "_test%.go$")
@ -20,7 +20,7 @@ function M.alternate()
elseif is_source then
alt_file = vim.fn.expand('%:r') .. "_test.go"
else
vim.notify('not a go file', vim.lsp.log_levels.ERROR)
vim.notify('not a go file', vim.log.levels.ERROR)
end
return alt_file
end
@ -28,7 +28,7 @@ end
function M.switch(bang, cmd)
local alt_file = M.alternate()
if not vim.fn.filereadable(alt_file) and not vim.fn.bufexists(alt_file) and not bang then
vim.notify("couldn't find " .. alt_file, vim.lsp.log_levels.ERROR)
vim.notify("couldn't find " .. alt_file, vim.log.levels.ERROR)
return
elseif #cmd <= 1 then
local ocmd = "e " .. alt_file

@ -42,7 +42,7 @@ function M.make(...)
local optarg, _, reminder = getopt.get_opts(args, short_opts, long_opts)
log(makeprg, args, short_opts, optarg, reminder)
if vim.fn.empty(makeprg) == 0 and args[1] == 'go' then
vim.notify('makeprg is already set to ' .. makeprg .. ' args: '.. vim.inspect(args), vim.lsp.log_levels.WARN)
vim.notify('makeprg is already set to ' .. makeprg .. ' args: '.. vim.inspect(args), vim.log.levels.WARN)
end
-- local indent = "%\\%( %\\)"
if not makeprg then
@ -286,7 +286,7 @@ function M.make(...)
cmd = table.concat(cmd, " ")
end
local info = cmd
local level = vim.lsp.log_levels.INFO
local level = vim.log.levels.INFO
if #errorlines > 0 then
if #lines > 0 then
vim.list_extend(errorlines, lines)
@ -322,12 +322,12 @@ function M.make(...)
if tonumber(data) ~= 0 then
failed = true
info = info .. " exited with code: " .. tostring(data)
level = vim.lsp.log_levels.ERROR
level = vim.log.levels.ERROR
end
_GO_NVIM_CFG.job_id = nil
if failed then
cmd = cmd .. " go test failed"
level = vim.lsp.log_levels.WARN
level = vim.log.levels.WARN
util.quickfix('botright copen')
end

@ -48,7 +48,7 @@ function M.define(bufnr, name, opts, redefine)
if sign_define_cache[bufnr] == nil then
sign_define_cache[bufnr] = {}
end
-- vim.notify(bufnr .. name .. opts .. redefine, vim.lsp.log_levels.DEBUG)
-- vim.notify(bufnr .. name .. opts .. redefine, vim.log.levels.DEBUG)
if redefine then
sign_define_cache[bufnr][name] = nil
vfn.sign_undefine(name)
@ -215,7 +215,7 @@ M.read_cov = function(covfn)
local total_covered = 0
if vfn.filereadable(covfn) == 0 then
vim.notify(string.format('cov file %s not exist please run cover test first', covfn), vim.lsp.log_levels.WARN)
vim.notify(string.format('cov file %s not exist please run cover test first', covfn), vim.log.levels.WARN)
return
end
local cov = vfn.readfile(covfn)
@ -288,7 +288,7 @@ M.show_func = function()
end,
on_exit = function(_, data, _)
if data ~= 0 then
vim.notify('no coverage data', vim.lsp.log_levels.WARN)
vim.notify('no coverage data', vim.log.levels.WARN)
return
end
vim.fn.setqflist({}, ' ', {
@ -323,7 +323,7 @@ M.run = function(...)
local covfn = select(2, ...) or cov
table.remove(args, 1)
if vim.fn.filereadable(covfn) == 0 then
vim.notify('no cov file specified or existed, will rerun coverage test', vim.lsp.log_levels.INFO)
vim.notify('no cov file specified or existed, will rerun coverage test', vim.log.levels.INFO)
else
table.remove(args, 1)
local test_coverage = M.read_cov(covfn)
@ -420,7 +420,7 @@ M.run = function(...)
return
end
if data[1] == 'no test files' then
vim.notify(data[1], vim.lsp.log_levels.WARN)
vim.notify(data[1], vim.log.levels.WARN)
return
end
@ -439,16 +439,16 @@ M.run = function(...)
.. '\n'
.. 'ev '
.. event,
vim.lsp.log_levels.WARN
vim.log.levels.WARN
)
end,
on_exit = function(job_id, data, event)
if event ~= 'exit' then
vim.notify(string.format('%s %s %s', job_id, event, vim.inspect(data)), vim.lsp.log_levels.ERROR)
vim.notify(string.format('%s %s %s', job_id, event, vim.inspect(data)), vim.log.levels.ERROR)
end
local lp = table.concat(lines, '\n')
vim.notify(string.format('test finished:\n %s', lp), vim.lsp.log_levels.INFO)
vim.notify(string.format('test finished:\n %s', lp), vim.log.levels.INFO)
coverage = M.read_cov(cov)
if arg == '-m' then
M.toggle(true)

@ -388,7 +388,7 @@ M.run = function(...)
if err then
log(err, data)
-- print('ERROR: ', err)
vim.notify('dlv exited with code ' + tostring(err), vim.lsp.log_levels.WARN)
vim.notify('dlv exited with code ' + tostring(err), vim.log.levels.WARN)
end
if not data or data == '' then
return
@ -413,7 +413,7 @@ M.run = function(...)
if code ~= 0 then
vim.schedule(function()
log('Dlv exited', code)
vim.notify(string.format('Delve exited with exit code: %d', code), vim.lsp.log_levels.WARN)
vim.notify(string.format('Delve exited with exit code: %d', code), vim.log.levels.WARN)
_GO_NVIM_CFG.dap_port = _GO_NVIM_CFG.dap_port + 1
end)
end
@ -453,7 +453,7 @@ M.run = function(...)
-- if breakpoint is not set add breakpoint at current pos
local pts = require('dap.breakpoints').get()
if utils.empty(pts) then
vim.notify('no breakpoint set, add breakpoint at current line', vim.lsp.log_levels.INFO)
vim.notify('no breakpoint set, add breakpoint at current line', vim.log.levels.INFO)
require('dap').set_breakpoint()
end

@ -19,7 +19,7 @@ local goimport_args = _GO_NVIM_CFG.goimport_args
}
if vim.lsp.buf.format == nil then
-- vim.notify('the vim.lsp.buf.format is not available, some feature is missing if you are running old version of neovim (<0.8.0)', vim.lsp.log_levels.DEBUG)
-- vim.notify('the vim.lsp.buf.format is not available, some feature is missing if you are running old version of neovim (<0.8.0)', vim.log.levels.DEBUG)
-- neovim < 0.7 only
require('go.lsp') -- this set default value of format
end
@ -45,7 +45,7 @@ local run = function(fmtargs, bufnr, cmd)
local args = vim.deepcopy(fmtargs)
table.insert(args, api.nvim_buf_get_name(bufnr))
log('formatting buffer... ' .. vim.inspect(args), vim.lsp.log_levels.DEBUG)
log('formatting buffer... ' .. vim.inspect(args), vim.log.levels.DEBUG)
if bufnr == 0 then
if vfn.getbufinfo('%')[1].changed == 1 then
@ -68,11 +68,11 @@ local run = function(fmtargs, bufnr, cmd)
return
end
if not utils.check_same(old_lines, data) then
vim.notify('updating codes', vim.lsp.log_levels.DEBUG)
vim.notify('updating codes', vim.log.levels.DEBUG)
api.nvim_buf_set_lines(0, 0, -1, false, data)
vim.cmd('write')
else
vim.notify('already formatted', vim.lsp.log_levels.DEBUG)
vim.notify('already formatted', vim.log.levels.DEBUG)
end
-- log("stdout" .. vim.inspect(data))
old_lines = nil
@ -86,7 +86,7 @@ local run = function(fmtargs, bufnr, cmd)
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)
return vim.notify('golines failed ' .. tostring(data), vim.log.levels.ERROR)
end
old_lines = nil
vim.defer_fn(function()

@ -10,7 +10,7 @@ function m.help_complete(_, _, _)
if vim.v.shell_error ~= 0 then
vim.notify(
string.format('failed to run go help %d', vim.v.shell_error),
vim.lsp.log_levels.ERROR
vim.log.levels.ERROR
)
return
end

@ -520,7 +520,7 @@ M.test_file = function(...)
-- require sed
local tests = M.get_test_cases()
if not tests then
vim.notify('no test found fallback to package test', vim.lsp.log_levels.DEBUG)
vim.notify('no test found fallback to package test', vim.log.levels.DEBUG)
return M.test_package(...)
end
@ -529,7 +529,7 @@ M.test_file = function(...)
local run_in_floaterm = optarg['F'] or _GO_NVIM_CFG.run_in_floaterm
if vfn.empty(tests) == 1 then
vim.notify('no test found fallback to package test', vim.lsp.log_levels.DEBUG)
vim.notify('no test found fallback to package test', vim.log.levels.DEBUG)
M.test_package(...)
return
end

@ -26,10 +26,10 @@ function M.watch(args)
end
for _, line in ipairs(lines) do
if line:match('Errors') then
vim.notify(vfn.join(lines, ', '), vim.lsp.log_levels.ERROR)
vim.notify(vfn.join(lines, ', '), vim.log.levels.ERROR)
return
elseif line:match('PASS') or line:match('DONE') then
vim.notify(line, vim.lsp.log_levels.INFO)
vim.notify(line, vim.log.levels.INFO)
end
end
end,

@ -85,7 +85,7 @@ local guru_cmd = function(args)
if format == "json" then
local re = vim.json.decode(data)
if re.errors ~= nil or re.lines == nil or re["start"] == nil or re["start"] == 0 then
vim.notify("failed to run guru" .. vim.inspect(re), vim.lsp.log_levels.ERROR)
vim.notify("failed to run guru" .. vim.inspect(re), vim.log.levels.ERROR)
end
end
if #res > 0 then
@ -96,7 +96,7 @@ local guru_cmd = function(args)
})
end
vim.notify("guru " .. mode, vim.lsp.log_levels.INFO)
vim.notify("guru " .. mode, vim.log.levels.INFO)
end,
})
end

@ -53,7 +53,7 @@ local function go_install_sync(pkg)
if u == nil then
vim.notify(
'command ' .. pkg .. ' not supported, please update install.lua, or manually install it',
vim.lsp.log_levels.WARN
vim.log.levels.WARN
)
return
end
@ -62,9 +62,9 @@ local function go_install_sync(pkg)
local setup = { 'go', 'install', u }
local output = vim.fn.system(table.concat(setup, ' '))
if vim.v.shell_error ~= 0 then
vim.notify('install ' .. pkg .. ' failed: ' .. output, vim.lsp.log_levels.ERROR)
vim.notify('install ' .. pkg .. ' failed: ' .. output, vim.log.levels.ERROR)
else
vim.notify('install ' .. pkg .. ' success', vim.lsp.log_levels.INFO)
vim.notify('install ' .. pkg .. ' success', vim.log.levels.INFO)
end
end
@ -73,7 +73,7 @@ local function go_install(pkg)
if u == nil then
vim.notify(
'command ' .. pkg .. ' not supported, please update install.lua, or manually install it',
vim.lsp.log_levels.WARN
vim.log.levels.WARN
)
return
end
@ -92,7 +92,7 @@ local function go_install(pkg)
if #data > 1 then
msg = msg .. data
end
vim.notify(msg, vim.lsp.log_levels.INFO)
vim.notify(msg, vim.log.levels.INFO)
end,
})
end
@ -102,11 +102,11 @@ local function install(bin, verbose)
verbose = _GO_NVIM_CFG.verbose
end
if not is_installed(bin) then
vim.notify('installing ' .. bin, vim.lsp.log_levels.INFO)
vim.notify('installing ' .. bin, vim.log.levels.INFO)
go_install(bin)
else
if verbose then
vim.notify(bin .. ' installed, use GoUpdateBinary to update it', vim.lsp.log_levels.DEBUG)
vim.notify(bin .. ' installed, use GoUpdateBinary to update it', vim.log.levels.DEBUG)
end
end
return is_installed(bin)
@ -129,7 +129,7 @@ end
local function install_all_sync()
for key, _ in pairs(url) do
if not is_installed(key) then
vim.notify('installing ' .. key, vim.lsp.log_levels.INFO)
vim.notify('installing ' .. key, vim.log.levels.INFO)
go_install_sync(key)
end
end

@ -32,7 +32,7 @@ function M.run(opts)
if code ~= 0 or signal ~= 0 then
vim.notify(
'error code' .. tostring(code) .. ' ' .. tostring(signal) .. vim.inspect(output_buf or ''),
vim.lsp.log_levels.WARN
vim.log.levels.WARN
)
end
local output = vim.split(output_buf, '\n')

@ -43,7 +43,7 @@ local on_attach = function(client, bufnr)
if _GO_NVIM_CFG.lsp_codelens then
codelens_enabled = (client.server_capabilities.codeLensProvider ~= false)
if not codelens_enabled then
vim.notify('codelens not support by your gopls', vim.lsp.log_levels.WARN)
vim.notify('codelens not support by your gopls', vim.log.levels.WARN)
end
vim.lsp.codelens.refresh()
end
@ -113,7 +113,7 @@ function M.config()
return {}
end
if _GO_NVIM_CFG == nil then
return vim.notify('please setup go.nvim', vim.lsp.log_levels.WARN)
return vim.notify('please setup go.nvim', vim.log.levels.WARN)
end
gopls.on_attach = on_attach
if type(_GO_NVIM_CFG.lsp_on_attach) == 'function' then
@ -151,7 +151,7 @@ function M.setup()
local goplscfg = M.config()
local lspconfig = utils.load_plugin('nvim-lspconfig', 'lspconfig')
if lspconfig == nil then
vim.notify('failed to load lspconfig', vim.lsp.log_levels.WARN)
vim.notify('failed to load lspconfig', vim.log.levels.WARN)
return
end

@ -96,7 +96,7 @@ local function handler()
.. (entry.Test or '')
.. '\n please check quickfix!\n'
.. plines,
vim.lsp.log_levels.WARN
vim.log.levels.WARN
)
end
end
@ -116,7 +116,7 @@ return {
gotest = function()
local nulls = utils.load_plugin('null-ls', 'null-ls')
if nulls == nil then
vim.notify('failed to load null-ls', vim.lsp.log_levels.WARN)
vim.notify('failed to load null-ls', vim.log.levels.WARN)
return
end
@ -161,7 +161,7 @@ return {
-- can be noisy for things that run often (e.g. diagnostics), but can
-- be useful for things that run on demand (e.g. formatting)
vim.schedule_wrap(function()
vim.notify('go test failed: ' .. tostring(stderr), vim.lsp.log_levels.WARN)
vim.notify('go test failed: ' .. tostring(stderr), vim.log.levels.WARN)
end)
end

@ -53,7 +53,7 @@ local function fill(cmd)
end
local json = vfn.json_decode(str)
if #json == 0 then
vim.notify("reftools " .. cmd .. " finished with no result", vim.lsp.log_levels.DEBUG)
vim.notify("reftools " .. cmd .. " finished with no result", vim.log.levels.DEBUG)
end
local result = json[1]

@ -48,9 +48,9 @@ local run = function(to_identifier, ...)
-- local result = vfn.json_decode(data)
local result = vim.json.decode(data)
if result.errors ~= nil or result.lines == nil or result["start"] == nil or result["start"] == 0 then
vim.notify("failed to rename" .. vim.inspect(result), vim.lsp.log_levels.ERROR)
vim.notify("failed to rename" .. vim.inspect(result), vim.log.levels.ERROR)
end
vim.notify("renamed to " .. to_identifier, vim.lsp.log_levels.DEBUG)
vim.notify("renamed to " .. to_identifier, vim.log.levels.DEBUG)
end,
})
end

@ -37,7 +37,7 @@ local run = function(cmd, opts)
local function update_chunk_fn(err, chunk)
if err then
vim.schedule(function()
vim.notify('error ' .. tostring(err) .. vim.inspect(chunk or ''), vim.lsp.log_levels.WARN)
vim.notify('error ' .. tostring(err) .. vim.inspect(chunk or ''), vim.log.levels.WARN)
end)
end
@ -60,7 +60,7 @@ local run = function(cmd, opts)
log(locopts)
vim.schedule(function()
vim.fn.setloclist(0, {}, ' ', locopts)
vim.notify('run lopen to see output', vim.lsp.log_levels.INFO)
vim.notify('run lopen to see output', vim.log.levels.INFO)
end)
end
return lines
@ -126,7 +126,7 @@ local run = function(cmd, opts)
output_buf = output_buf or ''
vim.schedule( function()
vim.notify(cmd_str .. ' failed exit code ' .. tostring(code) .. output_buf, vim.lsp.log_levels.WARN)
vim.notify(cmd_str .. ' failed exit code ' .. tostring(code) .. output_buf, vim.log.levels.WARN)
end)
end
@ -154,7 +154,7 @@ local run = function(cmd, opts)
uv.read_start(stderr, function(err, data)
if err then
vim.notify('error ' .. tostring(err) .. tostring(data or ''), vim.lsp.log_levels.WARN)
vim.notify('error ' .. tostring(err) .. tostring(data or ''), vim.log.levels.WARN)
end
if data ~= nil then
log(data)

@ -22,7 +22,7 @@ tags.modify = function(...)
return
end
-- vim.notify("parnode" .. vim.inspect(ns), vim.lsp.log_levels.DEBUG)
-- vim.notify("parnode" .. vim.inspect(ns), vim.log.levels.DEBUG)
local struct_name = ns.name
local setup = { gomodify, '-format', 'json', '-file', fname, '-w' }
@ -71,7 +71,7 @@ tags.modify = function(...)
log(setup)
-- vim.notify(vim.inspect(setup), vim.lsp.log_levels.DEBUG)
-- vim.notify(vim.inspect(setup), vim.log.levels.DEBUG)
vim.fn.jobstart(setup, {
on_stdout = function(_, data, _)
data = utils.handle_job_data(data)
@ -79,10 +79,10 @@ tags.modify = function(...)
return
end
local tagged = vim.fn.json_decode(data)
-- vim.notify(vim.inspect(tagged), vim.lsp.log_levels.DEBUG)
-- vim.notify(tagged["start"] .. " " .. tagged["end"] .. " " .. tagged.lines, vim.lsp.log_levels.ERROR)
-- vim.notify(vim.inspect(tagged), vim.log.levels.DEBUG)
-- vim.notify(tagged["start"] .. " " .. tagged["end"] .. " " .. tagged.lines, vim.log.levels.ERROR)
if tagged.errors ~= nil or tagged.lines == nil or tagged['start'] == nil or tagged['start'] == 0 then
vim.notify('failed to set tags' .. vim.inspect(tagged), vim.lsp.log_levels.ERROR)
vim.notify('failed to set tags' .. vim.inspect(tagged), vim.log.levels.ERROR)
end
for index, value in ipairs(tagged.lines) do
tagged.lines[index] = utils.rtrim(value)
@ -90,7 +90,7 @@ tags.modify = function(...)
-- trim tail spaces?
vim.api.nvim_buf_set_lines(0, tagged['start'] - 1, tagged['start'] - 1 + #tagged.lines, false, tagged.lines)
vim.cmd('write')
vim.notify('struct updated ', vim.lsp.log_levels.DEBUG)
vim.notify('struct updated ', vim.log.levels.DEBUG)
end,
})
end

@ -237,7 +237,7 @@ M.nodes_in_buf = function(query, default, bufnr, row, col)
end
local ns = M.get_all_nodes(query, ft, default, bufnr, row, col, true)
if ns == nil then
vim.notify('Unable to find any nodes.', vim.lsp.log_levels.DEBUG)
vim.notify('Unable to find any nodes.', vim.log.levels.DEBUG)
ulog('Unable to find any nodes. place your cursor on a go symbol and try again')
return nil
end
@ -252,7 +252,7 @@ M.nodes_at_cursor = function(query, default, bufnr, ntype)
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft')
local ns = M.get_all_nodes(query, ft, default, bufnr, row, col, ntype)
if ns == nil then
vim.notify('Unable to find any nodes. place your cursor on a go symbol and try again', vim.lsp.log_levels.DEBUG)
vim.notify('Unable to find any nodes. place your cursor on a go symbol and try again', vim.log.levels.DEBUG)
ulog('Unable to find any nodes. place your cursor on a go symbol and try again')
return nil
end
@ -260,7 +260,7 @@ M.nodes_at_cursor = function(query, default, bufnr, ntype)
local nodes_at_cursor = M.sort_nodes(M.intersect_nodes(ns, row, col))
ulog(row, col, vim.inspect(nodes_at_cursor):sub(1, 100))
if nodes_at_cursor == nil or #nodes_at_cursor == 0 then
vim.notify('Unable to find any nodes at pos. ' .. tostring(row) .. ':' .. tostring(col), vim.lsp.log_levels.DEBUG)
vim.notify('Unable to find any nodes at pos. ' .. tostring(row) .. ':' .. tostring(col), vim.log.levels.DEBUG)
ulog('Unable to find any nodes at pos. ' .. tostring(row) .. ':' .. tostring(col))
return nil
end

@ -256,7 +256,7 @@ util.log = function(...)
if log_path ~= nil and #log_path > 3 then
local f, err = io.open(log_path, 'a+')
if err then
vim.notify('failed to open log' .. log_path .. err, vim.lsp.log_levels.ERROR)
vim.notify('failed to open log' .. log_path .. err, vim.log.levels.ERROR)
return
end
if not f then
@ -266,7 +266,7 @@ util.log = function(...)
io.write(str .. '\n')
io.close(f)
else
vim.notify(str .. '\n', vim.lsp.log_levels.DEBUG)
vim.notify(str .. '\n', vim.log.levels.DEBUG)
end
end
end
@ -453,19 +453,19 @@ end
-- log and messages
function util.warn(msg)
vim.notify('WARN: ' .. msg, vim.lsp.log_levels.WARN)
vim.notify('WARN: ' .. msg, vim.log.levels.WARN)
end
function util.error(msg)
vim.notify('ERR: ' .. msg, vim.lsp.log_levels.ERROR)
vim.notify('ERR: ' .. msg, vim.log.levels.ERROR)
end
function util.info(msg)
vim.notify('INF: ' .. msg, vim.lsp.log_levels.INFO)
vim.notify('INF: ' .. msg, vim.log.levels.INFO)
end
function util.debug(msg)
vim.notify('DEBUG: ' .. msg, vim.lsp.log_levels.DEBUG)
vim.notify('DEBUG: ' .. msg, vim.log.levels.DEBUG)
end
function util.rel_path(folder)

Loading…
Cancel
Save