Path source: relative paths without leading dot do not work
Make sure you have done the following
- [X] I have updated to the latest version of
blink.cmp - [X] I have read the README
Bug Description
dirA
|____dirB
|_____file.txt
with the working directory set as dirA, entering ./dirB/ triggers completion with the suggestion file.txt. Omitting the dot (ie. entering dirB/) does not work.
The completion is rejected here: https://github.com/Saghen/blink.cmp/blob/02528e8ccbe4d0cef5e1df52eda419c5ed557ad3/lua/blink/cmp/sources/path/lib.lua#L32
I am not really sure if this is a bug or a feature, but it took me by surprise.
Relevant configuration
No response
neovim version
nightly
blink.cmp version: branch, tag, or commit
v0.7.6
This might be tricky because it could activate when you wouldn't want it to (i.e. typing foo/bar in markdown, or str/trim in clojure). We should likely enable this per language by checking the treesitter node under the cursor (:h vim.treesitter.get_node) to ensure we're in a comment/string. To start though, it could be enough to allow the user to toggle this via the opts table on the source. PR welcome!
Would this also be an issue if foo/bar or str/trim does not exist in the current working directory?
It wouldn't be an issue in that case but it seems like a good idea to keep it disabled by default, in case a directory does exist, if we we're not checking the treesitter node
Merging this with #966