feat: LOGGER™

This commit is contained in:
Smirnov Oleksandr 2024-04-17 18:32:24 +03:00
parent a2710261bf
commit a293b9e8d3
2 changed files with 6 additions and 2 deletions

View file

@ -9,7 +9,7 @@ function utils.deferred_notify(msg, lvl)
vim.notify(msg, lvl, { vim.notify(msg, lvl, {
title = c.___plugin_name, title = c.___plugin_name,
}) })
log.info(msg) log.debug(msg)
end, 0) end, 0)
end end
@ -20,7 +20,7 @@ function utils.notify(msg, lvl)
vim.notify(msg, lvl, { vim.notify(msg, lvl, {
title = c.___plugin_name, title = c.___plugin_name,
}) })
log.info(msg) log.debug(msg)
end end
-- safe require -- safe require

View file

@ -3,6 +3,8 @@
---@usage Execute `:GoCmt` to generate a comment for the current function/method/struct/etc on this line. ---@usage Execute `:GoCmt` to generate a comment for the current function/method/struct/etc on this line.
---@text This module provides a way to generate comments for Go code. ---@text This module provides a way to generate comments for Go code.
local log = require "gopher._utils.log"
local function generate(row, col) local function generate(row, col)
local ts_utils = require "gopher._utils.ts" local ts_utils = require "gopher._utils.ts"
local comment, ns = nil, nil local comment, ns = nil, nil
@ -38,6 +40,8 @@ return function()
local row, col = unpack(vim.api.nvim_win_get_cursor(0)) local row, col = unpack(vim.api.nvim_win_get_cursor(0))
local comment, ns = generate(row + 1, col + 1) local comment, ns = generate(row + 1, col + 1)
log.debug("generated comment: " .. comment)
vim.api.nvim_win_set_cursor(0, { vim.api.nvim_win_set_cursor(0, {
ns.dim.s.r, ns.dim.s.r,
ns.dim.s.c, ns.dim.s.c,