blink.cmp icon indicating copy to clipboard operation
blink.cmp copied to clipboard

Source defined keyword regex

Open saghen opened this issue 1 year ago • 1 comments
trafficstars

Feature Description

nvim-cmp allows sources to define their own keyword_regex to match on and control when the source is refetched. Blink's fuzzy matcher uses a scoring system that increases with longer matches, making sorting with different length keywords tricky.

saghen avatar Nov 10 '24 23:11 saghen

I ran into some unicode issues in the blink-ripgrep plugin. The issue was that lua regex are not capable of matching unicode characters. This will probably not matter for LSP results because most programming languages more or less use ASCII characters, but for human text it can be a useful feature to support.

I worked around this issue in my plugin by using vim.lpeg (lua parsing expression grammar) to parse the prefix instead of regex:

https://github.com/mikavilpas/blink-ripgrep.nvim/blob/40eee5698b3a6ffe8721c67e7481f26249eec888/lua/blink-ripgrep/init.lua#L16-L36

This is a non issue for me currently, but if a deeper integration is needed (e.g. for sorting results), maybe a function could be supported in addition to a regex?

mikavilpas avatar Nov 13 '24 08:11 mikavilpas

Decided against implementing this

saghen avatar Jan 03 '25 21:01 saghen