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

Populate completions with metadata #3226

Merged
merged 11 commits into from
Jul 28, 2022
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### New features

- [#3226](https://github.com/clojure-emacs/cider/pull/3226): Populate completions metadata, making it possible to change the style of completion via `completion-category-override` or `completion-category-defaults`.

toniz4 marked this conversation as resolved.
Show resolved Hide resolved
- [#2946](https://github.com/clojure-emacs/cider/issues/2946): Add custom var `cider-merge-sessions` to allow combining sessions in two different ways: Setting `cider-merge-sessions` to `'host` will merge all sessions associated with the same host within a project. Setting it to `'project` will combine all sessions of a project irrespective of their host.

## Changes
Expand Down
10 changes: 8 additions & 2 deletions cider-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,18 @@ performed by `cider-annotate-completion-function'."
(when (and (cider-connected-p)
(not (or (cider-in-string-p) (cider-in-comment-p))))
(list (car bounds) (cdr bounds)
(completion-table-dynamic #'cider-complete)
(lambda (string pred action)
toniz4 marked this conversation as resolved.
Show resolved Hide resolved
(cond ((eq action 'metadata) `(metadata (category . cider)))
toniz4 marked this conversation as resolved.
Show resolved Hide resolved
((eq (car-safe action) 'boundaries) nil)
(t (with-current-buffer (current-buffer)
(complete-with-action action
(cider-complete string) string pred)))))
:annotation-function #'cider-annotate-symbol
:company-kind #'cider-company-symbol-kind
:company-doc-buffer #'cider-create-doc-buffer
:company-location #'cider-company-location
:company-docsig #'cider-company-docsig))))
:company-docsig #'cider-company-docsig
:exclusive 'no))))
toniz4 marked this conversation as resolved.
Show resolved Hide resolved

(defun cider-completion-flush-caches ()
"Force Compliment to refill its caches.
Expand Down