Skip to content

cider-enable-flex-completion is not a sufficient replacement for cider-company-enable-fuzzy-completion #3653

Closed
@alexander-yakushev

Description

@alexander-yakushev

After I enabled cider-enable-flex-completion instead of cider-company-enable-fuzzy-completion, I noticed that my completion was acting up. Certain prefixes that used to complete correctly now failed to complete, and weird suggestions were popping up. The weird suggestions are understandable because of flex aggressive fuzzy policy, but that's not that big of an issue. The issue is the following completion scenarios supported by compliment that don't work in flex:

  1. Namespace completion by first letters of namespaces:
  • (cider-complete "cji") => (#("clojure.java.io" 0 1 (ns nil type "namespace")))
  • Tab with flex => no completions.
  1. FQ classname completions by first word:
  • (cider-complete "InputSt") => (#("java.io.InputStream" 0 1 (ns nil type "class")) #("java.io.InputStreamReader" 0 1 (ns nil type "class")) ...
  • Tab with flex => no completions.
  1. Fuzzy completion behind namespace prefix:
  • (cider-complete "str/sl") => (#("str/split-lines" 0 1 (ns "clojure.string" type "function")))
  • Tab with flex => no completions.

There are a couple of others but they are not as important as these.

Additionally, Emacs achieves this flex behavior by sending two requests to the backend: one with the normal prefix and one with empty prefix (""). Since we have no upper bound on the number of candidates we return, this may add some extra overhead/delay for the completion because CIDER has to deserialize all that output.

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