GNU bug report logs - #61368
[PATCH] Extend go-ts-mode with support for pre-filling return statements

Previous Next

Package: emacs;

Reported by: Evgeni Kolev <evgenysw <at> gmail.com>

Date: Wed, 8 Feb 2023 15:29:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: João Távora <joaotavora <at> gmail.com>
To: Evgeni Kolev <evgenysw <at> gmail.com>
Cc: Randy Taylor <dev <at> rjt.dev>, Eli Zaretskii <eliz <at> gnu.org>, Theodor Thornhill <theo <at> thornhill.no>, 61368 <at> debbugs.gnu.org
Subject: bug#61368: [PATCH] Extend go-ts-mode with support for pre-filling return statements
Date: Sat, 18 Feb 2023 12:14:49 +0000
[Message part 1 (text/plain, inline)]
On Sat, Feb 18, 2023, 11:46 Evgeni Kolev <evgenysw <at> gmail.com> wrote:

> + João, author of yasnippet.
>
> Hi, João, I'd appreciate any suggestions you might have. I'm aiming to
> extend go-ts-mode with a snippet-like feature. go-ts-mode would be
> able to insert a "smart / context-aware" return statement. My question
> is - is there a way for major modes to provide yasnippet snippets? My
> understanding is the snippets are either created by each user
> individually, or distributed as a collection of snippets (e.g.
> yasnippet-snippets).


Snippets can be distributed as files, but that's not a very good way as I
see it today. One of the  reasons might be too leverage the TAB and menu
expansion of the yasnippet system. But probably you don't want this, and
snippets can also be defined programmatically, albeit not with a beautiful
language.

Are there any major modes which provide snippets
> (I wasn't able to find any in emacs' repo)?
>

That's because yasnippet is not part of the Emacs repo proper, i.e. the
"core". So adding snippets to major modes in the core would introduce into
the core a dependency on an non-core ELPA package.

Nevertheless, there are ways to conditionally provide functionality based
on whether the non-core package is detected.  A soft dependency. In my
opinion it makes sense for popular non-core packages: company,
markdown-mode, yasnippet, etc. Look at Eglot, for example.

João

João
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.