github L3MON4D3/LuaSnip v2.5.0

7 hours ago

Hello everyone, it's once again time for a new release of LuaSnip :)
While this is prompted by a fix to a breaking change in Neovim 0.12, it contains a relatively complete overhaul of snippet updates, which marinated for some time in #1137, and then on master.

Self-Dependent DynamicNode

This change allows dynamicNodes to trigger updates that completely replace them. While technically possible before, it is now fully supported and allows fun stuff like replacing spaces with underscores and uppercasing everything

recording.mp4

or "moving" entire expanded snippets around within choiceNodes via restoreNode (which does not require any changes, it's just possible now):

recording.mp4
Snippet source
s("test", {
    c(1, {
		fmta([[
			{
				"item1": "<c1>",
				"item2": "<c2>"
			}
		]], {
			c1 = r(1, "c1", i(1)),
			c2 = r(2, "c2", i(1)),
		}),
		fmta([[
			[
				"<c1>",
				"<c2>"
			]
		]], {
			c1 = r(1, "c1"),
			c2 = r(2, "c2"),
		})
    })
}

For more details, check the section in DOC.md

Other Additions

  • #1416 by @bew is the first landed PR of a longer sequence of yet-to-be-reviewed ( 😬 ) improvements to the accuracy of luasnip's annotations!
  • #1403 fixes a misbehaviour of extend_decorator with parse_snippet, by @SPLYASHKA.
  • #1430 is the patch the aforementioned breaking change in neovim, courtesy of @kmoschcau 🙏

New Contributors

As always, Thank You! to all new and recurring contributers, especially those that endure my long downtimes (@bew 👀) ❤️

Full Changelog: v2.4.1...v2.5.0

Don't miss a new LuaSnip release

NewReleases is sending notifications on new releases.