@@ -37,18 +37,27 @@ is already properly indented.
37
37
38
38
== Completion styles
39
39
40
- CIDER defines (via the `completion-styles-alist` Elisp variable) a completion category named `cider`.
40
+ CIDER defines a specialized completion category through the `cider-complete-at-point` function,
41
+ added to `completion-at-point-functions`, establishing a dedicated completion category named
42
+ `cider`.
41
43
42
- The `cider` completion category currently only supports `basic` completion styles (and not `partial-completion`, `orderless`, etc),
43
- and `flex`, optionally (read more below).
44
+ The CIDER completion at point function supports most completion styles, including
45
+ `partial-completion`, `orderless` and `flex` (read more below).
44
46
45
- CIDER declares so in this fashion:
47
+
48
+ Sometimes the user may want to use a different completion style just for the CIDER
49
+ complete at point function. That can be achieved by setting
50
+ `completion-category-overrides`, overwriting the completion style of the CIDER
51
+ complete at point function. The following snippet accomplishes that:
46
52
47
53
[source,lisp]
48
54
----
49
55
(add-to-list 'completion-category-overrides '(cider (styles basic)))
50
56
----
51
57
58
+ This specifies that the `cider` completion category should employ the basic completion style by
59
+ default.
60
+
52
61
You can also enable the `flex` completion style by activating xref:usage/code_completion.adoc#fuzzy-candidate-matching[fuzzy candidate matching].
53
62
54
63
== Auto-completion
@@ -131,13 +140,14 @@ without needing to hit an extra key, please customize:
131
140
132
141
=== Fuzzy candidate matching
133
142
134
- By default, CIDER will provide completion candidates with the
135
- assumption that whatever you've typed so far is a prefix of what
136
- you're really trying to type. For example, if you type `map-` then
137
- you'll only get completion candidates that have `map-` as the
138
- beginning of their names. Sometimes, you don't know the exact prefix
139
- for the item you want to type. In this case, you can get
140
- CIDER-specific "fuzzy completion" by setting up in your Emacs init file:
143
+ By default, CIDER will use the completion styles defined in
144
+ `completion-styles`, the defaults being `(basic partial-completion
145
+ emacs22)` since Emacs 23. For a better description of how those
146
+ completion styles operates, refer to the official Emacs manual on
147
+ https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion-Styles.html[how completion alternatives are chosen].
148
+
149
+ CIDER provides a function to enable the `flex` completion style for CIDER-specific
150
+ completions. If you wish to enable that, you can add this to your config:
141
151
142
152
[source,lisp]
143
153
----
@@ -146,11 +156,11 @@ CIDER-specific "fuzzy completion" by setting up in your Emacs init file:
146
156
147
157
This adds the `flex` completion style, as introduced in Emacs 27.
148
158
149
- Now, `company-mode` will accept certain fuzziness when matching
150
- candidates against the prefix. For example, typing `mi` will show you
151
- ` map-indexed` as one of the possible completion candidates and `cji`
152
- will complete to `clojure.java.io`. Different completion examples are
153
- shown
159
+ Now, `company-mode` (and other completion packages like `corfu`) will
160
+ accept certain fuzziness when matching candidates against the
161
+ prefix. For example, typing `mi` will show you ` map-indexed` as one of
162
+ the possible completion candidates and `cji` will complete to
163
+ `clojure.java.io`. Different completion examples are shown
154
164
https://github.com/alexander-yakushev/compliment/wiki/Examples[here].
155
165
156
166
NOTE: `cider-company-enable-fuzzy-completion` (now deprecated) should be used for Emacs < 27.
@@ -189,18 +199,6 @@ keys to cancel the prompt by customizing:
189
199
(funcall f a b))))
190
200
----
191
201
192
- === Changing the completion style
193
-
194
- Sometimes the user may want to use a different completion style just for the CIDER
195
- complete at point function. That can be achieved by setting
196
- `completion-category-defaults`, overriting the completion style of the CIDER
197
- complete at point function. The following snippet accomplishes that:
198
-
199
- [source,lisp]
200
- ----
201
- (add-to-list 'completion-category-defaults '(cider (styles basic)))
202
- ----
203
-
204
202
=== Updating stale classes and methods cache
205
203
206
204
Sometimes, the completion fails to recognize new classes that came with
0 commit comments