feat(comment): add comment on a variable

This commit is contained in:
Oleksandr Smirnov 2025-09-04 15:52:48 +03:00
parent 9bffa2c212
commit 094afb2c21
No known key found for this signature in database
7 changed files with 45 additions and 0 deletions

View file

@ -25,6 +25,11 @@ local function generate(bufnr, line)
return u.indent(line, s_res.indent) .. "// " .. s_res.name .. " "
end
local v_ok, v_res = pcall(ts.get_variable_under_cursor, bufnr)
if v_ok then
return u.indent(line, v_res.indent) .. "// " .. v_res.name .. " "
end
local f_ok, f_res = pcall(ts.get_func_under_cursor, bufnr)
if f_ok then
return u.indent(line, f_res.indent) .. "// " .. f_res.name .. " "