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

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

bug#62371: [PATCH] Fix go-ts-mode incorrect docstring inserted for metho


From: Yuan Fu
Subject: bug#62371: [PATCH] Fix go-ts-mode incorrect docstring inserted for methods
Date: Fri, 24 Mar 2023 11:21:38 -0700

Evgeni Kolev <evgeni.d.kolev@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





reply via email to

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