From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60805: [PATCH] Extend go-ts-mode with command to add docstring to function Date: Sat, 14 Jan 2023 14:08:37 +0100 Message-ID: <87sfgdtga2.fsf@thornhill.no> References: <83ilh98sln.fsf@gnu.org> <87358dz6hy.fsf@thornhill.no> <83tu0t718s.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20422"; mail-complaints-to="usenet@ciao.gmane.io" Cc: evgenysw@gmail.com, 60805@debbugs.gnu.org, dev@rjt.dev To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 14 14:09:24 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 1pGgHj-00056d-K7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Jan 2023 14:09:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGgHa-0007WF-0m; Sat, 14 Jan 2023 08:09:14 -0500 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 1pGgHV-0007Vi-OA for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 08:09:10 -0500 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 1pGgHO-0000Ci-IK for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 08:09:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGgHO-0005MK-E7 for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 08:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jan 2023 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60805 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60805-submit@debbugs.gnu.org id=B60805.167370172820578 (code B ref 60805); Sat, 14 Jan 2023 13:09:02 +0000 Original-Received: (at 60805) by debbugs.gnu.org; 14 Jan 2023 13:08:48 +0000 Original-Received: from localhost ([127.0.0.1]:53627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGgH9-0005Lq-NW for submit@debbugs.gnu.org; Sat, 14 Jan 2023 08:08:48 -0500 Original-Received: from out-202.mta0.migadu.com ([91.218.175.202]:29148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGgH3-0005La-QT for 60805@debbugs.gnu.org; Sat, 14 Jan 2023 08:08:45 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1673701720; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HO8GdsrbhKSvE3YpGKK9pa55BIJZzAv3YtvGKzuiFkY=; b=UXypr+hiANL8HSDeVs3kIZkMPW3lvY/BR2gnetfNq61zNQAx16CYIIRXQATNcaIHuL1rbf YKTXfI4YlPIXNi4/7XGRpbxj4rJ+HCO/2sFaHeB3tX9hedmhIht/SpqWELSjCoe/nNw1nL Jopn+wJ0s+iA7uGoXjummUTDv9nnV0Bo9WOk3C8h5FebRl/lNUgI5XnSlTtMGLfvQeQl27 vOyFBcSDkajV/5RBwEnI2h3YcAsFyIb8hw9faiKd+lXjrrlNdxCxCqBE4OV2IrMxP7+QfU ylbAn2kxFbS3CZx3z/2WpBhmupm2n6Dd8JyAkhA2y07cskVemHospLJRZ7xnCw== In-Reply-To: <83tu0t718s.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:253355 Archived-At: Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: Evgeni Kolev , dev@rjt.dev, 60805@debbugs.gnu.org >> Date: Sat, 14 Jan 2023 12:43:21 +0100 >> >> Should we maybe generalize this into something all *-ts-modes can use? > > I don't know how widespread are such features with other languages. > >> Maybe it also could support some syntax to be used by for example >> yasnippet? There are examples on how to do so in eglot.el, if I'm not >> mistaken. > > Maybe. I'd have to see code to have an opinion. Emacs never had such > features, AFAIR. >From eglot.el: ``` (defun eglot--snippet-expansion-fn () "Compute a function to expand snippets. Doubles as an indicator of snippet support." (and (boundp 'yas-minor-mode) (symbol-value 'yas-minor-mode) 'yas-expand-snippet)) ``` So if yasnippet is available, it will be expanded. We could have a similar function in treesit.el, adding support for such "skeleton" insertion features. A simple example for javascript could be: ``` import ${2:$1} from '${1:moduleName}'; ``` Which could be plugged into this patch, if I'm not mistaken. Theo