Skip to content

Commit

Permalink
Add sensible category overrides for cider
Browse files Browse the repository at this point in the history
This possibility was enabled by #3226

It can be seen in use in SystemCrafters/crafted-emacs#241 or https://clojurians.slack.com/archives/C0617A8PQ/p1696684010392119?thread_ts=1696618691.247989&cid=C0617A8PQ|

It provides a better default experience for those using orderless or other newer styles.
  • Loading branch information
vemv committed Oct 8, 2023
1 parent 47d9a95 commit 295b84e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

### Changes

- Ensure that `cider` completion isn't used with completion styles that are currently unsupported (`flex` `initials` `partial-completion`, `orderless`, etc).
- This restores completions for users that favor those styles - otherwise the would see bad or no completions.
- Improve support for multiple forms in the same line by replacing `beginning-of-defun` fn.
- [#3390](https://github.com/clojure-emacs/cider/issues/3390): Enhance `cider-connect` to show all nREPLs available ports, instead of only Leiningen ones.
- [#3408](https://github.com/clojure-emacs/cider/issues/3408): `cider-connect`: check `.nrepl-port`-like files for liveness, hiding them if they don't reflect an active port.
Expand Down
5 changes: 5 additions & 0 deletions cider-completion.el
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ in the buffer."
cider-company-unfiltered-candidates
"CIDER backend-driven completion style."))

;; Currently CIDER completions only work for `basic`, and not `flex` `initials` `partial-completion`, `orderless`, etc.
;; So we ensure that those other styles aren't used with CIDER, otherwise one would see bad or no completions at all.
;; This `add-to-list` call can be removed once we implement the other completion styles.
(add-to-list 'completion-category-overrides '(cider (styles basic)))

(defun cider-company-enable-fuzzy-completion ()
"Enable backend-driven fuzzy completion in the current buffer."
(setq-local completion-styles '(cider)))
Expand Down

0 comments on commit 295b84e

Please sign in to comment.