babashka.nrepl icon indicating copy to clipboard operation
babashka.nrepl copied to clipboard

Add type to completions

Open borkdude opened this issue 5 years ago • 2 comments

"function", "macro", etc.

borkdude avatar Jun 15 '20 10:06 borkdude

I discovered that in CIDER eldoc only "function" or "variable" were supported. Is this the same for completions? @bbatsov

borkdude avatar Jun 16 '20 09:06 borkdude

No, it's not. Completions support many types:

(defcustom cider-completion-annotations-alist
  '(("class" "c")
    ("field" "fi")
    ("function" "f")
    ("import" "i")
    ("keyword" "k")
    ("local" "l")
    ("macro" "m")
    ("method" "me")
    ("namespace" "n")
    ("protocol" "p")
    ("protocol-function" "pf")
    ("record" "r")
    ("special-form" "s")
    ("static-field" "sf")
    ("static-method" "sm")
    ("type" "t")
    ("var" "v"))
  "Controls the abbreviations used when annotating completion candidates.

Must be a list of elements with the form (TYPE . ABBREVIATION), where TYPE
is a possible value of the candidate's type returned from the completion
backend, and ABBREVIATION is a short form of that type."
  :type '(alist :key-type string :value-type string)
  :group 'cider
  :package-version '(cider . "0.9.0"))

bbatsov avatar Jun 16 '20 09:06 bbatsov