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: Evgeni Kolev <evgenysw <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>,  Eli Zaretskii <eliz <at> gnu.org>
Cc: Randy Taylor <dev <at> rjt.dev>, 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: Mon, 20 Feb 2023 10:54:06 +0200
Thank you João for the input! I think something like this would make
sense in go-ts-mode.el:
```
(with-eval-after-load 'yasnippet
  (yas-define-snippets 'go-ts-mode
                       '(("return" (yas-expand-snippet
                                    (go-ts-mode-return)))
                         ("iferr" (yas-expand-snippet
                                   (format "if err != nil {\n%s\n}"
                                           (go-ts-mode-return)))))))
```

A custom variable go-ts-mode-want-yasnippet could be added to
optionally prevent adding the snippets.

Eli, would you consider something like the code above acceptable as an
alternative to an electric "return" mode?

Having optional yasnippet integration was also brought up by Theo in
this message[1] and this one [2].

[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60805#11
[2]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60805#17




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

Previous Next


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