[Feature Request] Exclude treesitter snippets on extend
Treesitter snippets are dependent on lang which generally not working on another filetype to extend.
So these invalid snippets would be presented unexpectedly on the extended filetype.
Maybe we should add special identifier to snippets like treesitter_postfix so that they can be excluded on extend.
Or maybe it's more universal to add an identifier for all snippets to indicate whether they can be extended to another filetype.
It sounds like your issue comes from luasnip treating the treesitter languages as the same as the filetypes neovim provides, is that right?
Could you maybe give some more specific information on the problem you're facing?
Generally, I think issues like this can usually be solved by working with filetype_extends..
It sounds like your issue comes from luasnip treating the treesitter languages as the same as the filetypes neovim provides, is that right?
For example, if I have some treesitter_postfix snippets within javascript snippets, and I might extend javascript snippets to typescript.
The query might compatible but, lang is fixed so neovim would choose javascript parser to parse typescript file, which eventually make such snippets unusable.
Those unusable snippets would still take positions in completion list, that's the problem.
Ahh, I understand.
Excluding snippets from ft_extend sounds like a can of worms, what do you think of setting show_condition on the snippet to check the language of the buffer?
It's not possible to expand these snippets manually anyway, so hiding them from completion-menus should be enough to effectively disable them :)
I'd also be fine with just adding this to treesitter_postfix natively, it shouldn't destroy any existing workflow :D
I'd like show_condition as it sounds more universal