From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: evgenysw@gmail.com, 60805@debbugs.gnu.org, dev@rjt.dev
Subject: bug#60805: [PATCH] Extend go-ts-mode with command to add docstring to function
Date: Sat, 14 Jan 2023 14:08:37 +0100 [thread overview]
Message-ID: <87sfgdtga2.fsf@thornhill.no> (raw)
In-Reply-To: <83tu0t718s.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Theodor Thornhill <theo@thornhill.no>
>> Cc: Evgeni Kolev <evgenysw@gmail.com>, 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
next prev parent reply other threads:[~2023-01-14 13:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-14 6:45 bug#60805: [PATCH] Extend go-ts-mode with command to add docstring to function Evgeni Kolev
2023-01-14 7:48 ` Eli Zaretskii
2023-01-14 11:43 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-14 12:24 ` Eli Zaretskii
2023-01-14 13:08 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-01-18 6:26 ` Evgeni Kolev
2023-01-18 11:59 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-20 9:41 ` Evgeni Kolev
2023-01-20 10:14 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-20 11:39 ` Evgeni Kolev
2023-01-20 14:56 ` Evgeni Kolev
2023-01-20 20:39 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 3:30 ` Randy Taylor
2023-01-21 6:48 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 7:34 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 14:39 ` Evgeni Kolev
2023-01-21 20:37 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-21 21:26 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 7:46 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfgdtga2.fsf@thornhill.no \
--to=bug-gnu-emacs@gnu.org \
--cc=60805@debbugs.gnu.org \
--cc=dev@rjt.dev \
--cc=eliz@gnu.org \
--cc=evgenysw@gmail.com \
--cc=theo@thornhill.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).