From c9b7d35cbdb73f6c91e0b057eebe6f468c1cb801 Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Tue, 2 Apr 2024 17:48:58 +0300 Subject: [PATCH] docs(comment): add doc --- doc/gopher.nvim.txt | 9 +++++++++ lua/gopher/comment.lua | 5 +++++ scripts/docgen.lua | 1 + 3 files changed, 15 insertions(+) diff --git a/doc/gopher.nvim.txt b/doc/gopher.nvim.txt index b5c21db..7118e3c 100644 --- a/doc/gopher.nvim.txt +++ b/doc/gopher.nvim.txt @@ -15,6 +15,7 @@ Table of Contents Auto implementation of interface methods..................|gopher.nvim-impl| Generating unit tests boilerplate......................|gopher.nvim-gotests| Iferr....................................................|gopher.nvim-iferr| + Generate comments.....................................|gopher.nvim-comments| Setup `nvim-dap` for Go......................................|gopher.nvim-dap| ------------------------------------------------------------------------------ @@ -200,6 +201,14 @@ Usage ~ execute `:GoIfErr` near any err variable to insert the check +============================================================================== +------------------------------------------------------------------------------ + *gopher.nvim-comments* +Usage ~ +Execute `:GoCmt` to generate a comment for the current function/method/struct/etc on this line. +This module provides a way to generate comments for Go code. + + ============================================================================== ------------------------------------------------------------------------------ *gopher.nvim-dap* diff --git a/lua/gopher/comment.lua b/lua/gopher/comment.lua index 0a146fb..002894c 100644 --- a/lua/gopher/comment.lua +++ b/lua/gopher/comment.lua @@ -1,3 +1,8 @@ +---@toc_entry Generate comments +---@tag gopher.nvim-comments +---@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. + local function generate(row, col) local ts_utils = require "gopher._utils.ts" local comment, ns = nil, nil diff --git a/scripts/docgen.lua b/scripts/docgen.lua index 7d31e5e..f2deb8b 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -14,6 +14,7 @@ local files = { "lua/gopher/impl.lua", "lua/gopher/gotests.lua", "lua/gopher/iferr.lua", + "lua/gopher/comment.lua", "lua/gopher/dap.lua", }