From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#62371: [PATCH] Fix go-ts-mode incorrect docstring inserted for methods Date: Fri, 24 Mar 2023 11:21:38 -0700 Message-ID: <13B38FE4-FE4E-4809-9636-78D5F265F79C@gmail.com> References: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) 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="28131"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Randy Taylor , 62371@debbugs.gnu.org To: evgeni.d.kolev@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 24 23:04:23 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 1pfpWI-00079u-57 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Mar 2023 23:04:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfpTD-000438-9o; Fri, 24 Mar 2023 18:01:11 -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 1pfpTB-00040T-Mr for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 18:01:09 -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 1pfpTB-0000eY-Ch for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 18:01:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pfm38-00018U-1m for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 14:22:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Mar 2023 18:22: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.16796821214363 (code B ref 62371); Fri, 24 Mar 2023 18:22:02 +0000 Original-Received: (at 62371) by debbugs.gnu.org; 24 Mar 2023 18:22:01 +0000 Original-Received: from localhost ([127.0.0.1]:41343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfm37-00018G-90 for submit@debbugs.gnu.org; Fri, 24 Mar 2023 14:22:01 -0400 Original-Received: from mail-pl1-f173.google.com ([209.85.214.173]:34646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfm34-000181-A7 for 62371@debbugs.gnu.org; Fri, 24 Mar 2023 14:21:59 -0400 Original-Received: by mail-pl1-f173.google.com with SMTP id o11so2622178ple.1 for <62371@debbugs.gnu.org>; Fri, 24 Mar 2023 11:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679682112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=yHdBkobi1jY6DSM7PY1WaqPmxK7u2fHSREZf7sjLiEs=; b=KKXYv5JPXIkSFaVZFvTVm35SgiF4EfJN96F4uRhKN5vCSy3lBDw2nmowYokFJnZADm 1FzQcCaZ6OZq0qayBNogIcPJ70ulBnyFibKeckT6XzuYRTVtsYS2Z0wqCvNlVekWKPT5 9TSjWlDdLjOX7ZEdZiPnT21RBGvynL73fWvGxl4eNuCJ1z0P9RTvT8KoQ9dF4CT6NvQN yowKp3e05lsMmD1CvAqnvgh5LvrpadqPD2pzBk30fZrBeswPOgwpH9aRQsasEttdF1VP 8+NjlRb/VlFFnjHd9/d+mWLT98KP9vnZ3Gvp7TSlHzq6xpcY3/H60aK45GC8mTGV8o5W dR4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679682112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yHdBkobi1jY6DSM7PY1WaqPmxK7u2fHSREZf7sjLiEs=; b=YzDMU3ajHjcUWRPHKa5QcubgZ1JXnnHQ+TSFmRUspK1zBaFmhhuWCh8Pb5PDfZ01df tgECTf9/3Jp7RZSiFH/8gxL7PRMiO6hLRAb+qrduEEoByyRpRc7wuOffp3FLyd3gTt01 lbc88vsSm/OdRBv6OXQqcdSlWxmpwwl+szMJ4N+HyRaVBuiy3Gbuh2EnrPMBiBAdnvZU vcZSuDPcXwdaBddN5af/fr1yISH3e5it+mQMZr3+pm3RPdp9VRZ8GWLQBM1B/CPVlS80 pHJ+mlKjft45OkHTJLOTSM1yGNiZOAGtdAN/g9P8eLkFnujbJfHEoTIKXUJYmy8t8Q2C 7wiw== X-Gm-Message-State: AO0yUKUM0ZUUb9CtJCRynwxpZjI1Gcj1ewtiIHbcmgC4gnLIXhLzNmWK +MjDnB/yruNFaJRA8ofw37E= X-Google-Smtp-Source: AK7set+1wa5amTx6gJzVpPs5U6kUAD5yIRjx/MdwCpgGVs/pXzrXCXAW+3x/HWI9p+gZBaUm9aUNZw== X-Received: by 2002:a05:6a20:8009:b0:da:4be2:caff with SMTP id e9-20020a056a20800900b000da4be2caffmr3584791pza.56.1679682112586; Fri, 24 Mar 2023 11:21:52 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id s26-20020aa7829a000000b00628c0988d94sm5579182pfm.55.2023.03.24.11.21.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2023 11:21:52 -0700 (PDT) X-Mailer: Apple Mail (2.3731.400.51.1.1) 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:258521 Archived-At: Evgeni Kolev 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=E2=80=99ing Randy. Yuan