I’m trying to understand how LuaSnip determines what snippets to use given the language. I’m currently using a modified kickstart.nvim with LuaSnip and friendly-snippets with C Sharp using seblyng/roslyn.nvim as my LSP. The snippets in friendly-snippets’ csharp.json file work fine, but those in csharpdoc.json do not. If I modify friendly-snippets’ package.json to associate csharpdoc.json with languages ["csharp", "cs"]
I get those snippets available.
But this feels like the wrong way to do it, particularly as the snippets show in the completion menu in inapplicable locations. I suspect that those snippets are associated with language "csharpdoc"
so that they are only listed inside of doc comments. I’d like to resolve this but I’m unfamiliar with the paradigm neovim is using.
I’d expect something (treesitter?) detects the language under the cursor so that snippets of the language at the current location can be listed. However, at least with treesitter, the language is always c_sharp
. And that doesn’t even match what the snippets are associated with (csharp
without the underscore).
How does LuaSnip connect the language of the snippets with the language of what is being edited?