feat(comment): add support for: interface methods, struct fields, variables (#123)
* refactor(comment): dont use unnecessary function * chore: quick way to open vim in dev mode * feat(comment): add comment on on interface method * feat(comment): add comment on a struct field * feat(comment): add comment on a variable * docs: add note about the generate function * docs: gopher.TsResult * fix(utils): handle case when indentation is wrong
This commit is contained in:
parent
295e21e637
commit
1e7af1b212
20 changed files with 250 additions and 33 deletions
|
|
@ -3,7 +3,7 @@ local log = require "gopher._utils.log"
|
|||
local utils = {}
|
||||
|
||||
---@param msg string
|
||||
---@param lvl? number by default `vim.log.levels.INFO`
|
||||
---@param lvl? integer by default `vim.log.levels.INFO`
|
||||
function utils.notify(msg, lvl)
|
||||
lvl = lvl or vim.log.levels.INFO
|
||||
vim.notify(msg, lvl, {
|
||||
|
|
@ -38,4 +38,16 @@ function utils.trimend(s)
|
|||
return r
|
||||
end
|
||||
|
||||
-- Since indentation can be spaces or tabs, that's my hack around it
|
||||
---@param line string
|
||||
---@param indent integer
|
||||
---@return string
|
||||
function utils.indent(line, indent)
|
||||
local char = string.sub(line, 1, 1)
|
||||
if char ~= " " and char ~= "\t" then
|
||||
char = " "
|
||||
end
|
||||
return string.rep(char, indent)
|
||||
end
|
||||
|
||||
return utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue