github L3MON4D3/LuaSnip v2.2.0
2.2.0

latest release: v2.3.0
10 months ago

Highlights

Overhaul of vscode/snipmate/lua-loaders

The implementation of the loaders was greatly refactored, and there are a few new features:

  • We can now reload files when they are updated in another neovim-instance/in some other editor (via libuv).
    This can be enabled by passing fs_event_providers = {libuv=true} to the load-call, like so
require("luasnip.loaders.from_lua").lazy_load({paths = "./luasnippets", fs_event_providers = {libuv=true}})
  • Files that are created after the load-call will be loaded (which was not the case previously)
  • Similarly to the above, it is also possible to "register" a snippet-collection for loading as soon as it is created.
    To enable this for some collection, pass it to the lazy_paths-key in load:
require("luasnip.loaders.from_lua").load({lazy_paths = ".luasnippets"})

(this example is especially useful since it will load a snippet-collection in the current directory, which could be a project-specific one)

  • The lua-loader may define dependencies on files, such that the snippet-files that depend on some file will be reloaded when the file is edited. Load a file via ls_tracked_dofile or a package via ls_tracked_dopackageto make use of this.

All of these features are also documented in DOC.md, take a look for more details.

What's Changed

  • Use libuv-file-watcher to update loaded snippet-collections. by @L3MON4D3 in #1033
  • add option to skip indent nodes by @TwIStOy in #1072
  • feat(builtin): support vscode snippet variable CURRENT_TIMEZONE_OFFSET by @masakichi in #1091
  • Minor DOC.md modifications for panvimdoc lists by @Ote-Leo in #1097
  • Add quotes to jsregexp make commands by @louis-vs in #1099

New Contributors

A hearty Thank You! to all contributors :)

Full Changelog: v2.1.1...v2.2.0

Don't miss a new LuaSnip release

NewReleases is sending notifications on new releases.