-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose snippet reload function, enables integration with plugins like nvim-scissors #28
Comments
It looks like the way snippets are loaded makes it pretty tricky to do this cleanly, but it's currently possible to bust the cache in a highly undocumented way: local reset_snippets_cache = function()
local snippets_provider = vim.iter(require("blink.cmp").sources.providers):find(function(provider)
return provider.name == "Snippets"
end)
if not snippets_provider then
return
end
-- could theoretically scope this to a filetype, but not much point
snippets_provider.module.cache = {}
end I could imagine exposing a |
|
Thank you! |
Unfortunately, it appears the reload function is not working. |
Sorry about that, it got broken during the sources rework. Fixed in 407f2d5 |
thank you |
I am the maintainer of nvim-scissors, and would like to implement a hot-reload-support for blink.cmp. To be able to do that, blink.cmp needs to expose some sort of function that reloads a snippet file inside
providers → 'blink.cmp.sources.path' → opts.searchpaths.
.snippet engines usually expose such functionality, so other plugins can properly integrate with them, e.g.
require("luasnip.loaders").reload_file(path)
for luasnip: /~https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md#loadersIt would be great for blink.cmp to also expose such a function.
The text was updated successfully, but these errors were encountered: