Skip to content

Commit 65383b8

Browse files
alexander-yakushevbbatsov
authored andcommitted
[completion] Disable client-side sorting
1 parent 8276e8b commit 65383b8

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [#3784](https://github.com/clojure-emacs/cider/issues/3784): Inspector: make point less erratic when navigating between inspector screens.
1818
- [#3790](https://github.com/clojure-emacs/cider/issues/3790): Stacktrace: show messages and data for all exception causes by default.
1919
- [#3789](https://github.com/clojure-emacs/cider/issues/3789): Refactor and simplify exception handling.
20+
- [#3789](https://github.com/clojure-emacs/cider/issues/3796): Completion: disable client-side sorting (defer to backend-provided candidate order).
2021

2122
## 1.17.1 (2025-02-25)
2223

cider-client.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ CONTEXT represents a completion context for compliment."
672672
"ns" ,(cider-current-ns)
673673
"prefix" ,prefix
674674
"context" ,context
675+
"sort-order" "by-name"
675676
,@(when cider-enhanced-cljs-completion-p '("enhanced-cljs-completion?" "t")))
676677
(cider-nrepl-send-sync-request (cider-current-repl)
677678
'abort-on-input))))

cider-completion.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ performed by `cider-annotate-completion-function'."
211211
;;
212212
;; This api is better described in the section
213213
;; '21.6.7 Programmed Completion' of the elisp manual.
214-
(cond ((eq action 'metadata) `(metadata (category . cider))) ;; defines a completion category named 'cider, used later in our `completion-category-overrides` logic.
214+
(cond ((eq action 'metadata)
215+
`(metadata
216+
(category . cider) ;; defines a completion category named 'cider, used later in our `completion-category-overrides` logic.
217+
(display-sort-function . identity))) ;; don't override sorting done by backend
215218
((eq (car-safe action) 'boundaries) nil)
216219
(t (with-current-buffer (current-buffer)
217220
(complete-with-action action (funcall complete) prefix pred)))))

0 commit comments

Comments
 (0)