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

Not all completion items shown when item contains special characters #923

Open
2 tasks done
julienvincent opened this issue Jan 6, 2025 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working fuzzy Filtering and sorting of completion items

Comments

@julienvincent
Copy link
Contributor

julienvincent commented Jan 6, 2025

Make sure you have done the following

  • Updated to the latest version of blink.cmp
  • Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

Blink behaves weirdly if completion items contain special characters.

I'm sure the clojure language is a pretty good stress test for blink because clojure vars can and do contain a larger range of 'special' characters than other languages.

A very common one is the ! character to indicate mutation or side-effects and -> or >/< characters.

For example if I have a lib exporting the following:

(ns example.lib)

(defn ->thing [])

(defn do-something! [])

(defn do-something [])

and try autocomplete it as follows:

(ns example
  (:require 
    [exmaple.lib :as lib]))

(lib/|)

Then I only see:

lib/do-something

When I would expect to see all three exported vars.

If I comment out the do-something export then, surprisingly, I see the special-character exports:

;; example/lib.clj
...
;; (defn do-something [])
...

;; example.clj
lib/do-something!
lib/->something

And as a side-note, trying to autocomplete either of the two above items containing special characters results in:

(lib/lib/do-something!)

Which seems to be #46 raising its head again.


I recorded a short vid to demonstrate:

special-chars.mov

Just to be super explicit, I'm going to explain:

  1. The first autocomplete attempt shows only do-something when it should show all three exported functions. Accepting it does inserts the correct content into the buffer, which is good.
  2. Commenting out do-something as an exported var in the lib module results in both the two special-character containing exports to now show as expected.
  3. Accepting either of them inserts the incorrect content into the buffer (double-prefixed with their lib/ identifier).
  4. Attempting to auto-complete after the > character hides the autocompletion menu when, for clojure, I expect it to remain. This should still be considered a keyword (should this be made configurable in blink?)

Relevant configuration

No response

neovim version

0.10.2

blink.cmp version

main

@julienvincent julienvincent added the bug Something isn't working label Jan 6, 2025
@julienvincent
Copy link
Contributor Author

julienvincent commented Jan 6, 2025

I guess this is kinda multiple issues in one, but they are all somewhat related I think so leaving it bundled to not make more noise. I am happy to break this into multiple issues though if you prefer. Let me know!

@SuzumiK
Copy link
Contributor

SuzumiK commented Jan 8, 2025

I think what I see is the same issue (or at least related), but in this case with function parameters that contain special characters (dots/periods):

blink

  1. Typing legend shows available parameters. Note it includes legend.key and legend.key.height
  2. With legend.key, legend.key.height is no longer offered as completion.
  3. Continuing to type legend.key.s... showing legend.key.size and legend.key.spacing. Once the prefix includes a special character, blink appears to only look back to the previous special character.
  4. Inserting only replaces the typed siz prefix, duplicating legend.key

The language is R, set iskeyword? includes "."

@Saghen Saghen added the fuzzy Filtering and sorting of completion items label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fuzzy Filtering and sorting of completion items
Projects
None yet
Development

No branches or pull requests

3 participants