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 19:37:17 +0000 Message-ID: References: <83o7ohc9eb.fsf@gnu.org> 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="3968"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Evgeni Kolev , 62371@debbugs.gnu.org, Yuan Fu , Dmitry Gutov To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 20:38:26 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 1pg9ib-0000lE-GW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 20:38:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg9iH-0001Ee-5w; Sat, 25 Mar 2023 15:38:05 -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 1pg9iE-0001EV-Md for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 15:38:03 -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 1pg9iE-0000cG-2D for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 15:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg9iD-0002ig-TA for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 15:38:01 -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 19:38:01 +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.167977305610420 (code B ref 62371); Sat, 25 Mar 2023 19:38:01 +0000 Original-Received: (at 62371) by debbugs.gnu.org; 25 Mar 2023 19:37:36 +0000 Original-Received: from localhost ([127.0.0.1]:43548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg9ho-0002i0-Ah for submit@debbugs.gnu.org; Sat, 25 Mar 2023 15:37:36 -0400 Original-Received: from mail-40136.proton.ch ([185.70.40.136]:21385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg9hl-0002hk-0H for 62371@debbugs.gnu.org; Sat, 25 Mar 2023 15:37:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail3; t=1679773046; x=1680032246; bh=oQ2aiUi6y8KvvKLAnRQ8azRnhhQueu1UEwLt0n0wqAM=; 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=2iIH58CNayuw3gm7A4UDZ/3Gg7EyLCSalYJS2dGsgyjGTy3Oy1Z3baoTDTGr1NOEr yOLybUDnuy1PPAhVx8tnquWaXJWK+/9V58VwhT0H/9Uh7yYU67A/UUV0b39nQjnyl+ QWViRXCO0PukjkJd6iHwlFz+SgVlNQu1vmSSQY777yLltMcQ1wGrJVXwzGr78kfKyu Iok7kgKAtWJaRPkkRvFuXGhBecdQBt6obF/wJXZhIFBYH17g5vKOhdmhSQMGQ60FVV vJpiUvixYVAqvAWIXtvhEexF1y7YM5RoBQ4R98ORgrlS45Af5GSJQtKE8yHg575x0q GSDt0uAQiGF1A== In-Reply-To: <83o7ohc9eb.fsf@gnu.org> 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:258625 Archived-At: On Saturday, March 25th, 2023 at 08:17, Eli Zaretskii wrote: >=20 > > From: Evgeni Kolev evgeni.d.kolev@gmail.com >=20 > > Date: Wed, 22 Mar 2023 10:05:56 +0200 > >=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 > > * 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). >=20 >=20 > Thanks. >=20 > 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.