From: Eli Zaretskii <eliz@gnu.org>
To: Evgeni Kolev <evgenysw@gmail.com>
Cc: dev@rjt.dev, 60805@debbugs.gnu.org
Subject: bug#60805: [PATCH] Extend go-ts-mode with command to add docstring to function
Date: Sat, 14 Jan 2023 09:48:04 +0200 [thread overview]
Message-ID: <83ilh98sln.fsf@gnu.org> (raw)
In-Reply-To: <CAMCrgaUDsPdV8PPb2w+CRN8uqoL6gn-NtWNEPwVcCGTiR=HT7Q@mail.gmail.com> (message from Evgeni Kolev on Sat, 14 Jan 2023 08:45:31 +0200)
> Cc: Randy Taylor <dev@rjt.dev>
> From: Evgeni Kolev <evgenysw@gmail.com>
> Date: Sat, 14 Jan 2023 08:45:31 +0200
>
> [CC Randy Taylor, author of go-ts-mode]
>
> This patch extends go-ts-mode with a command to add docstring to
> current function. If a comment already exists, the point is instead
> moved to the top-most comment line.
Thanks. When accepted, this should go to the master branch, as it's a
new feature.
> First test, with this input, point inside the function body.
> ```
> func test1(a, b int) int {
> return a + b
> }
> ```
>
> Pressing C-c C-d results in:
> ```
> // test1
> func test1(a, b int) int {
> return a + b
> }
> ```
Is this really the best Emacs can do to produce such a comment? It's
not a very useful comment, is it? I understand that the user is then
expected to add some more meaningful text to make the comment useful,
but I'm asking whether Emacs could collect more information about the
function, and provide a skeleton of a useful doc comment for the user
to fill.
What do other IDEs do for this kind of functionality?
> Extend go-ts-mode with command to add docstring to function
>
> go-ts-mode is extended with command go-ts-mode-docstring which adds
> docstring comment to the defun at point. If a comment already exists,
^^
Please observe our convention of leaving 2 spaces between sentences.
> +(defun go-ts-mode-docstring ()
> + "Add docstring for the current function if it does not
> +exists. Otherwise, jump to it."
The first line of a doc string should be a complete sentence.
Finally, this change needs a NEWS entry.
next prev parent reply other threads:[~2023-01-14 7:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-14 6:45 bug#60805: [PATCH] Extend go-ts-mode with command to add docstring to function Evgeni Kolev
2023-01-14 7:48 ` Eli Zaretskii [this message]
2023-01-14 11:43 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-14 12:24 ` Eli Zaretskii
2023-01-14 13:08 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 6:26 ` Evgeni Kolev
2023-01-18 11:59 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-20 9:41 ` Evgeni Kolev
2023-01-20 10:14 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-20 11:39 ` Evgeni Kolev
2023-01-20 14:56 ` Evgeni Kolev
2023-01-20 20:39 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 3:30 ` Randy Taylor
2023-01-21 6:48 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 7:34 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 14:39 ` Evgeni Kolev
2023-01-21 20:37 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 21:26 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 7:46 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83ilh98sln.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=60805@debbugs.gnu.org \
--cc=dev@rjt.dev \
--cc=evgenysw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).