GNU bug report logs -
#62371
[PATCH] Fix go-ts-mode incorrect docstring inserted for methods
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62371 in the body.
You can then email your comments to 62371 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Wed, 22 Mar 2023 08:07:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Evgeni Kolev <evgeni.d.kolev <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 22 Mar 2023 08:07:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The docstring inserted with go-ts-mode's C-c C-d was incorrectly
prefixed with the receiver "(myStruct).":
// (myStruct).act
func (m *myStruct) act () {...}
The above docstring is not correct because the receiver "myStruct"
should not be in the docstring.
The issue is caused by imenu and go-ts-mode--defun-name using the same
code to determine the defun name. Instead, they should produce
different results - imenu should show the "myStruct" prefix, but the
docstring should not.
This commit fixes the incorrect behavior by introducing an optional
SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
now inserts just the method name:
// act
func (m *myStruct) act () {...}
* lisp/progmodes/go-ts-mode.el (go-ts-mode--defun-name): New optional
parameter SKIP-PREFIX. (go-ts-mode-docstring):
Call (go-ts-mode--defun-name t) instead of (treesit-defun-name).
[0001-Fix-go-ts-mode-incorrect-docstring-inserted-for-meth.patch (application/octet-stream, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Fri, 24 Mar 2023 18:22:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 62371 <at> debbugs.gnu.org (full text, mbox):
Evgeni Kolev <evgeni.d.kolev <at> gmail.com> writes:
> The docstring inserted with go-ts-mode's C-c C-d was incorrectly
> prefixed with the receiver "(myStruct).":
>
> // (myStruct).act
> func (m *myStruct) act () {...}
>
> The above docstring is not correct because the receiver "myStruct"
> should not be in the docstring.
>
> The issue is caused by imenu and go-ts-mode--defun-name using the same
> code to determine the defun name. Instead, they should produce
> different results - imenu should show the "myStruct" prefix, but the
> docstring should not.
>
> This commit fixes the incorrect behavior by introducing an optional
> SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
> now inserts just the method name:
>
> // act
> func (m *myStruct) act () {...}
>
Thanks! CC’ing Randy.
Yuan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sat, 25 Mar 2023 00:59:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 62371 <at> debbugs.gnu.org (full text, mbox):
On Friday, March 24th, 2023 at 14:21, Yuan Fu <casouri <at> gmail.com> wrote:
> Evgeni Kolev evgeni.d.kolev <at> gmail.com writes:
>
> > The docstring inserted with go-ts-mode's C-c C-d was incorrectly
> > prefixed with the receiver "(myStruct).":
> >
> > // (myStruct).act
> > func (m *myStruct) act () {...}
> >
> > The above docstring is not correct because the receiver "myStruct"
> > should not be in the docstring.
> >
> > The issue is caused by imenu and go-ts-mode--defun-name using the same
> > code to determine the defun name. Instead, they should produce
> > different results - imenu should show the "myStruct" prefix, but the
> > docstring should not.
> >
> > This commit fixes the incorrect behavior by introducing an optional
> > SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
> > now inserts just the method name:
> >
> > // act
> > func (m *myStruct) act () {...}
>
>
> Thanks! CC’ing Randy.
>
> Yuan
>
Thanks, I was going to look yesterday but I forgot :D.
Looks good to me!
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sat, 25 Mar 2023 12:18:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 62371 <at> debbugs.gnu.org (full text, mbox):
> From: Evgeni Kolev <evgeni.d.kolev <at> gmail.com>
> Date: Wed, 22 Mar 2023 10:05:56 +0200
>
> The docstring inserted with go-ts-mode's C-c C-d was incorrectly
> prefixed with the receiver "(myStruct).":
>
> // (myStruct).act
> func (m *myStruct) act () {...}
>
> The above docstring is not correct because the receiver "myStruct"
> should not be in the docstring.
>
> The issue is caused by imenu and go-ts-mode--defun-name using the same
> code to determine the defun name. Instead, they should produce
> different results - imenu should show the "myStruct" prefix, but the
> docstring should not.
>
> This commit fixes the incorrect behavior by introducing an optional
> SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
> now inserts just the method name:
>
> // act
> func (m *myStruct) act () {...}
>
> * lisp/progmodes/go-ts-mode.el (go-ts-mode--defun-name): New optional
> parameter SKIP-PREFIX. (go-ts-mode-docstring):
> Call (go-ts-mode--defun-name t) instead of (treesit-defun-name).
Thanks.
Dmitry, Yuan, Randy: any comments?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sat, 25 Mar 2023 19:38:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 62371 <at> debbugs.gnu.org (full text, mbox):
On Saturday, March 25th, 2023 at 08:17, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Evgeni Kolev evgeni.d.kolev <at> gmail.com
>
> > Date: Wed, 22 Mar 2023 10:05:56 +0200
> >
> > The docstring inserted with go-ts-mode's C-c C-d was incorrectly
> > prefixed with the receiver "(myStruct).":
> >
> > // (myStruct).act
> > func (m *myStruct) act () {...}
> >
> > The above docstring is not correct because the receiver "myStruct"
> > should not be in the docstring.
> >
> > The issue is caused by imenu and go-ts-mode--defun-name using the same
> > code to determine the defun name. Instead, they should produce
> > different results - imenu should show the "myStruct" prefix, but the
> > docstring should not.
> >
> > This commit fixes the incorrect behavior by introducing an optional
> > SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
> > now inserts just the method name:
> >
> > // act
> > func (m *myStruct) act () {...}
> >
> > * lisp/progmodes/go-ts-mode.el (go-ts-mode--defun-name): New optional
> > parameter SKIP-PREFIX. (go-ts-mode-docstring):
> > Call (go-ts-mode--defun-name t) instead of (treesit-defun-name).
>
>
> Thanks.
>
> Dmitry, Yuan, Randy: any comments?
I guess my email yesterday didn't make it through or got missed?
It looks good to me, feel free to install.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sun, 26 Mar 2023 01:57:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 62371 <at> debbugs.gnu.org (full text, mbox):
On 25/03/2023 14:17, Eli Zaretskii wrote:
> Dmitry, Yuan, Randy: any comments?
It also looks good to me. The commit message might be a little too
verbose, though -- what do you think?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sun, 26 Mar 2023 04:35:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 62371 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 25 Mar 2023 19:37:17 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> Cc: Evgeni Kolev <evgeni.d.kolev <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>, Yuan Fu <casouri <at> gmail.com>, 62371 <at> debbugs.gnu.org
>
> On Saturday, March 25th, 2023 at 08:17, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > > From: Evgeni Kolev evgeni.d.kolev <at> gmail.com
> >
> > > Date: Wed, 22 Mar 2023 10:05:56 +0200
> > >
> > > The docstring inserted with go-ts-mode's C-c C-d was incorrectly
> > > prefixed with the receiver "(myStruct).":
> > >
> > > // (myStruct).act
> > > func (m *myStruct) act () {...}
> > >
> > > The above docstring is not correct because the receiver "myStruct"
> > > should not be in the docstring.
> > >
> > > The issue is caused by imenu and go-ts-mode--defun-name using the same
> > > code to determine the defun name. Instead, they should produce
> > > different results - imenu should show the "myStruct" prefix, but the
> > > docstring should not.
> > >
> > > This commit fixes the incorrect behavior by introducing an optional
> > > SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
> > > now inserts just the method name:
> > >
> > > // act
> > > func (m *myStruct) act () {...}
> > >
> > > * lisp/progmodes/go-ts-mode.el (go-ts-mode--defun-name): New optional
> > > parameter SKIP-PREFIX. (go-ts-mode-docstring):
> > > Call (go-ts-mode--defun-name t) instead of (treesit-defun-name).
> >
> >
> > Thanks.
> >
> > Dmitry, Yuan, Randy: any comments?
>
> I guess my email yesterday didn't make it through or got missed?
It didn't. But gnu.org had severe DNS problems all day yesterday, so
many email messages were delivered with a long delay. I wrote the
above before I saw your response.
> It looks good to me, feel free to install.
I tried, but it failed to apply. Evgeni, could you please resubmit,
relative to the emacs-29 branch?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sun, 26 Mar 2023 05:23:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 62371 <at> debbugs.gnu.org (full text, mbox):
> Date: Sun, 26 Mar 2023 04:56:25 +0300
> Cc: 62371 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
>
> On 25/03/2023 14:17, Eli Zaretskii wrote:
> > Dmitry, Yuan, Randy: any comments?
>
> It also looks good to me. The commit message might be a little too
> verbose, though -- what do you think?
It could use some editing, yes.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Sun, 26 Mar 2023 11:45:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 62371 <at> debbugs.gnu.org (full text, mbox):
On Sunday, March 26th, 2023 at 00:34, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > Date: Sat, 25 Mar 2023 19:37:17 +0000
>
> > From: Randy Taylor dev <at> rjt.dev
> > Cc: Evgeni Kolev evgeni.d.kolev <at> gmail.com, Dmitry Gutov dgutov <at> yandex.ru, Yuan Fu casouri <at> gmail.com, 62371 <at> debbugs.gnu.org
> >
> > On Saturday, March 25th, 2023 at 08:17, Eli Zaretskii eliz <at> gnu.org wrote:
> >
> > > > From: Evgeni Kolev evgeni.d.kolev <at> gmail.com
> > >
> > > > Date: Wed, 22 Mar 2023 10:05:56 +0200
> > > >
> > > > The docstring inserted with go-ts-mode's C-c C-d was incorrectly
> > > > prefixed with the receiver "(myStruct).":
> > > >
> > > > // (myStruct).act
> > > > func (m *myStruct) act () {...}
> > > >
> > > > The above docstring is not correct because the receiver "myStruct"
> > > > should not be in the docstring.
> > > >
> > > > The issue is caused by imenu and go-ts-mode--defun-name using the same
> > > > code to determine the defun name. Instead, they should produce
> > > > different results - imenu should show the "myStruct" prefix, but the
> > > > docstring should not.
> > > >
> > > > This commit fixes the incorrect behavior by introducing an optional
> > > > SKIP-PREFIX parameter to (go-ts-mode--defun-name). Pressing C-c C-d
> > > > now inserts just the method name:
> > > >
> > > > // act
> > > > func (m *myStruct) act () {...}
> > > >
> > > > * lisp/progmodes/go-ts-mode.el (go-ts-mode--defun-name): New optional
> > > > parameter SKIP-PREFIX. (go-ts-mode-docstring):
> > > > Call (go-ts-mode--defun-name t) instead of (treesit-defun-name).
> > >
> > > Thanks.
> > >
> > > Dmitry, Yuan, Randy: any comments?
> >
> > I guess my email yesterday didn't make it through or got missed?
>
>
> It didn't. But gnu.org had severe DNS problems all day yesterday, so
> many email messages were delivered with a long delay. I wrote the
> above before I saw your response.
>
> > It looks good to me, feel free to install.
>
>
> I tried, but it failed to apply. Evgeni, could you please resubmit,
> relative to the emacs-29 branch?
It's for master, this feature didn't make it in to emacs-29.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sun, 26 Mar 2023 12:06:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Evgeni Kolev <evgeni.d.kolev <at> gmail.com>
:
bug acknowledged by developer.
(Sun, 26 Mar 2023 12:06:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 62371-done <at> debbugs.gnu.org (full text, mbox):
> Date: Sun, 26 Mar 2023 11:44:05 +0000
> From: Randy Taylor <dev <at> rjt.dev>
> Cc: evgeni.d.kolev <at> gmail.com, dgutov <at> yandex.ru, casouri <at> gmail.com, 62371 <at> debbugs.gnu.org
>
> > > It looks good to me, feel free to install.
> >
> >
> > I tried, but it failed to apply. Evgeni, could you please resubmit,
> > relative to the emacs-29 branch?
>
> It's for master, this feature didn't make it in to emacs-29.
Thanks, now installed on master, and closing the bug.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#62371
; Package
emacs
.
(Mon, 27 Mar 2023 10:06:01 GMT)
Full text and
rfc822 format available.
Message #37 received at 62371-done <at> debbugs.gnu.org (full text, mbox):
Thank you Eli, and everyone else!
The patch was meant for master, not emacs-29 - I should have stated
this. I also incorrectly sent the patch from my alternate mail
address, but the email in the patch was correct, so no harm done.
Thanks again!
On Sun, Mar 26, 2023 at 3:05 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > Date: Sun, 26 Mar 2023 11:44:05 +0000
> > From: Randy Taylor <dev <at> rjt.dev>
> > Cc: evgeni.d.kolev <at> gmail.com, dgutov <at> yandex.ru, casouri <at> gmail.com, 62371 <at> debbugs.gnu.org
> >
> > > > It looks good to me, feel free to install.
> > >
> > >
> > > I tried, but it failed to apply. Evgeni, could you please resubmit,
> > > relative to the emacs-29 branch?
> >
> > It's for master, this feature didn't make it in to emacs-29.
>
> Thanks, now installed on master, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 24 Apr 2023 11:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.