Closed seagle0128 closed 10 months ago
I seem to remember there is a way to hook snippets to be contextual. I did it once--years ago--where a snippet would do something in a comment and something else outside of it. But there was no way to really get the context outside of checking the font lock style. That was the only real context that existed in an emacs buffer at the time.
I suppose yasnippet should now consider major-mode-remap-alist
when deciding the snippets directory for the current mode.
Another interesting example of Tree Sitter snippet possibilities in Emacs can be seen here: https://blog.meain.io/2021/intelligent-snippets-treesitter/
Fancier snippets that make use of the richer syntax information provided by tree-sitter sound great. But these belong with the yasnippet-snippets rather than here, unless they require special support from YASnippet itself. So I'm closing this for now. Feel free to open a new issue if/when you find that such snippets indeed require special extra support from YASnippet.
I am always enjoying this great package. Thanks a lot!
Recently Emacs 29 introduces native
tree-sitter
, and I read this interesting post: https://xenodium.com/emacs-generate-a-swift-initializer/ .IMO, Context-aware yasnippets is amazing feature. I am not sure if it could be implemented in
yasnippet
, but please think about this idea. Thanks!