From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#62371: [PATCH] Fix go-ts-mode incorrect docstring inserted for methods Date: Sat, 25 Mar 2023 00:58:09 +0000 Message-ID: References: <13B38FE4-FE4E-4809-9636-78D5F265F79C@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7462"; mail-complaints-to="usenet@ciao.gmane.io" Cc: evgeni.d.kolev@gmail.com, 62371@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 01:59:35 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfsFq-0001hZ-V0 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 01:59:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfsFQ-0003TC-Su; Fri, 24 Mar 2023 20:59:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfsFL-0003Qt-ES for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 20:59:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pfsFK-0001RY-P4 for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 20:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pfsFK-0008RX-7V for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 20:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2023 00:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62371 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62371-submit@debbugs.gnu.org id=B62371.167970590632405 (code B ref 62371); Sat, 25 Mar 2023 00:59:02 +0000 Original-Received: (at 62371) by debbugs.gnu.org; 25 Mar 2023 00:58:26 +0000 Original-Received: from localhost ([127.0.0.1]:41785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfsEk-0008Qa-6a for submit@debbugs.gnu.org; Fri, 24 Mar 2023 20:58:26 -0400 Original-Received: from mail-4022.proton.ch ([185.70.40.22]:56669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfsEg-0008QH-Sp for 62371@debbugs.gnu.org; Fri, 24 Mar 2023 20:58:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail3; t=1679705896; x=1679965096; bh=OeJLV21yrErBEeCthuEfKzMs4/JNimosl2IVJR3DCj4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=JwHhwjdYpJ1MFermv3XZAlM9HsaDHkqT83Zes49aixuAfvuduDDi5bc25pglDWKSm +dF1cobIsQqX08zjJuuUKmervanK9EyUGqGpGhVEtXkJU6iUdbQcQq0buoFsYuV1mO NkIrOzFgYaUshVKs4K3/3ZMRzW+RE8nkIZ+hlK31JJPvB7/ZDa2jRfNBEqIzytUW/U QYH5mucuY+8DwWRBs12aK3MlymWfe1wVgogkUByVfjcLVqE/B2To18ihlrIKjaVYxj BTamVsE1FIdMtZuJ9g5DJ36l4NMWSOPFrlPUgb3vfHG9LN1NfkJCpp9ton3MEbsqdA qPnJxm5Pzf8LQ== In-Reply-To: <13B38FE4-FE4E-4809-9636-78D5F265F79C@gmail.com> Feedback-ID: 44397038:user:proton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258536 Archived-At: On Friday, March 24th, 2023 at 14:21, Yuan Fu wrote:=20 > Evgeni Kolev evgeni.d.kolev@gmail.com writes: >=20 > > The docstring inserted with go-ts-mode's C-c C-d was incorrectly > > prefixed with the receiver "(myStruct).": > >=20 > > // (myStruct).act > > func (m *myStruct) act () {...} > >=20 > > The above docstring is not correct because the receiver "myStruct" > > should not be in the docstring. > >=20 > > 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. > >=20 > > 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: > >=20 > > // act > > func (m *myStruct) act () {...} >=20 >=20 > Thanks! CC=E2=80=99ing Randy. >=20 > Yuan >=20 Thanks, I was going to look yesterday but I forgot :D. Looks good to me!