emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62371: closed ([PATCH] Fix go-ts-mode incorrect docstring inserted f


From: GNU bug Tracking System
Subject: bug#62371: closed ([PATCH] Fix go-ts-mode incorrect docstring inserted for methods)
Date: Sun, 26 Mar 2023 12:06:02 +0000

Your message dated Sun, 26 Mar 2023 15:05:48 +0300
with message-id <83r0tbafab.fsf@gnu.org>
and subject line Re: bug#62371: [PATCH] Fix go-ts-mode incorrect docstring 
inserted for methods
has caused the debbugs.gnu.org bug report #62371,
regarding [PATCH] Fix go-ts-mode incorrect docstring inserted for methods
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
62371: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62371
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] Fix go-ts-mode incorrect docstring inserted for methods 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).

Attachment: 0001-Fix-go-ts-mode-incorrect-docstring-inserted-for-meth.patch
Description: Binary data


--- End Message ---
--- Begin Message --- Subject: Re: bug#62371: [PATCH] Fix go-ts-mode incorrect docstring inserted for methods Date: Sun, 26 Mar 2023 15:05:48 +0300
> Date: Sun, 26 Mar 2023 11:44:05 +0000
> From: Randy Taylor <dev@rjt.dev>
> Cc: evgeni.d.kolev@gmail.com, dgutov@yandex.ru, casouri@gmail.com, 
> 62371@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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]