Skip to content

Some values are lost when wrapping a custom completer. #1190

Open
@Zylvian

Description

@Zylvian

Tried wrapping my custom completer in a FuzzyCompleter, and had some problems:

  • 'document.getWordBeforeCursor()' is empty, thus not allowing me to debug, as well as flat out rejecting some completions which works unwrapped.
  • some yielded Completions inexplicably don't work. I am using the "emojis" library, and in my normal completer, I return this and it works fine
x = self.data['emoji_map'][val]
val_emoji = emojis.encode(x)
yield Completion(text=val_emoji, display_meta=val, start_position=-len(word))

whereas when wrapping it, the completion doesn't show up at all. Although reversing the text and display_meta works, as in:
yield Completion(text=val, display_meta=val_emoji, start_position=-len(word))

I've therefore had to remove fuzzy matching, which is a big sad.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions