GNU bug report logs - #62371
[PATCH] Fix go-ts-mode incorrect docstring inserted for methods

Previous Next

Package: emacs;

Reported by: Evgeni Kolev <evgeni.d.kolev <at> gmail.com>

Date: Wed, 22 Mar 2023 08:07:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 62371 <at> debbugs.gnu.org (full text, mbox):

From: Randy Taylor <dev <at> rjt.dev>
To: Yuan Fu <casouri <at> gmail.com>
Cc: evgeni.d.kolev <at> gmail.com, 62371 <at> debbugs.gnu.org
Subject: Re: bug#62371: [PATCH] Fix go-ts-mode incorrect docstring inserted
 for methods
Date: Sat, 25 Mar 2023 00:58:09 +0000
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!




This bug report was last modified 2 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.