Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path source: relative paths without leading dot do not work #604

Open
2 tasks done
SuzumiK opened this issue Dec 16, 2024 · 3 comments
Open
2 tasks done

Path source: relative paths without leading dot do not work #604

SuzumiK opened this issue Dec 16, 2024 · 3 comments
Labels
bug Something isn't working sources Specific source provider or the system as a whole

Comments

@SuzumiK
Copy link
Contributor

SuzumiK commented Dec 16, 2024

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • 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:

accept = accept and not prefix:match('%a/$')

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

@SuzumiK SuzumiK added the bug Something isn't working label Dec 16, 2024
@Saghen Saghen added the sources Specific source provider or the system as a whole label Dec 16, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 17, 2024

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!

@SuzumiK
Copy link
Contributor Author

SuzumiK commented Dec 17, 2024

Would this also be an issue if foo/bar or str/trim does not exist in the current working directory?

@Saghen
Copy link
Owner

Saghen commented Dec 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sources Specific source provider or the system as a whole
Projects
None yet
Development

No branches or pull requests

2 participants