Skip to content

Conversation

sghng
Copy link

@sghng sghng commented Sep 15, 2025

This resolves #1679.

@Saghen
Copy link
Owner

Saghen commented Sep 26, 2025

Tricky part is that treesitter parsers don't map 1 to 1 with neovim filetypes. I maintain a list of mappings in blink.pairs, derived from nvim-treesitter: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/context/treesitter.lua#L7. I think we should provide a top level require('blink.cmp').language_at_position(cursor) that does this and performs the mapping.

@sghng
Copy link
Author

sghng commented Sep 26, 2025

Tricky part is that treesitter parsers don't map 1 to 1 with neovim filetypes. I maintain a list of mappings in blink.pairs, derived from nvim-treesitter: https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/context/treesitter.lua#L7. I think we should provide a top level require('blink.cmp').language_at_position(cursor) that does this and performs the mapping.

Looks awesome, I can rewrite my PR when this util is added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a way to use snippets based on the _syntax name_, rather than the _filetype_?
2 participants