Skip to content

Commit cc00383

Browse files
rksmbbatsov
authored andcommitted
Add cider-enhanced-cljs-completion-p flag (enabled by default) to make suitable cljs-completions optional (#2717)
See also #clojure-emacs/cider-nrepl/648
1 parent 5fe24df commit cc00383

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
* [#2711](https://github.com/clojure-emacs/cider/pull/2711): `cider-selector` has more robust handling for edge cases.
1111
* [#2572](https://github.com/clojure-emacs/cider/issues/2572): Make it possible to a start a one off ClojureScript REPL without defining a new REPL type.
12+
* Dynamic cljs completions (via suitable) can be disable by setting `cider-enhanced-cljs-completion-p` to nil.
1213

1314
### Bugs fixed
1415

cider-client.el

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ Value is a symbol. The possible values are the symbols in the
6262
:group 'cider
6363
:package-version '(cider . "0.10.0"))
6464

65+
(defcustom cider-enhanced-cljs-completion-p t
66+
"This setting enables dynamic cljs completions.
67+
That is, expressions at point are evaluated and the properties of the
68+
resulting value are used to compute completions."
69+
:type 'boolean
70+
:group 'cider
71+
:package-version '(cider . "0.24.0"))
72+
6573
(defun cider-spinner-start (buffer)
6674
"Start the evaluation spinner in BUFFER.
6775
Do nothing if `cider-show-eval-spinner' is nil."
@@ -511,7 +519,8 @@ CONTEXT represents a completion context for compliment."
511519
(when-let* ((dict (thread-first `("op" "complete"
512520
"ns" ,(cider-current-ns)
513521
"symbol" ,str
514-
"context" ,context)
522+
"context" ,context
523+
,@(when cider-enhanced-cljs-completion-p '("enhanced-cljs-completion?" "t")))
515524
(cider-nrepl-send-sync-request (cider-current-repl)
516525
'abort-on-input))))
517526
(nrepl-dict-get dict "completions")))

0 commit comments

Comments
 (0)