Skip to content

Commit 807183c

Browse files
committed
[Docs] Introduce a dedicated ClojureScript configuration section
1 parent 4cc4280 commit 807183c

File tree

3 files changed

+68
-53
lines changed

3 files changed

+68
-53
lines changed

doc/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* ClojureScript Setup
77
** xref:cljs/overview.adoc[Overview]
88
** xref:cljs/up_and_running.adoc[Up and Running]
9+
** xref:cljs/configuration.adoc[Configuration]
910
** xref:cljs/figwheel.adoc[Using Figwheel]
1011
** xref:cljs/shadow-cljs.adoc[Using shadow-cljs]
1112
** xref:cljs/other_repls.adoc[Using Other REPLs]
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
= Configuration
2+
3+
== Setting a Default ClojureScript REPL Type
4+
5+
If you frequently use the same ClojureScript REPL, you can set
6+
`cider-default-cljs-repl` and CIDER will skip the prompt and use this
7+
instead. For example, the following will make Nashorn the default:
8+
9+
[source,lisp]
10+
----
11+
(setq cider-default-cljs-repl 'nashorn)
12+
----
13+
14+
== Defining Custom ClojureScript REPL Types
15+
16+
All supported ClojureScript REPLs are stored in
17+
`cider-cljs-repl-types`. If you need to extend it, you should use
18+
`cider-register-cljs-repl-type` in your Emacs configuration.
19+
20+
[source,lisp]
21+
----
22+
(cider-register-cljs-repl-type 'super-cljs "(do (...))" optional-requirements-function)
23+
----
24+
25+
You can also modify the known ClojureScript REPLs on a per-project basis using
26+
`.dir-locals.el`:
27+
28+
[source,lisp]
29+
----
30+
;; replace the list of REPL types and set some default
31+
((nil
32+
(cider-default-cljs-repl . super-cljs)
33+
(cider-cljs-repl-types . ((super-cljs "(do (foo) (bar))")))))
34+
----
35+
36+
[source,lisp]
37+
----
38+
;; modify the list of known REPLs and set some default
39+
((nil
40+
(eval . (cider-register-cljs-repl-type 'super-cljs "(do (foo) (bar))"))
41+
(cider-default-cljs-repl . super-cljs)))
42+
----
43+
44+
For one-off REPLs you can also use the custom REPL init form like this:
45+
46+
[source,lisp]
47+
----
48+
;; modify the list of known REPLs and set some default
49+
((nil
50+
(cider-custom-cljs-repl-init-form . "(do (foo) (bar))"
51+
(cider-default-cljs-repl . custom)))
52+
----
53+
54+
If you already have a Clojure REPL running and want to add a
55+
ClojureScript REPL, you can invoke
56+
`cider-jack-in-sibling-clojurescript` to add it.
57+
58+
== Enhanced Completion
59+
60+
By default CIDER will enrich the ClojureScript completion results using
61+
the https://github.com/rksm/clj-suitable[suitable] library. If case you run
62+
into any `suitable`-related issues you can disable the enhanced completion like this:
63+
64+
[source,lisp]
65+
----
66+
(setq cider-enhanced-cljs-completion-p nil)
67+
----

doc/modules/ROOT/pages/cljs/up_and_running.adoc

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -80,59 +80,6 @@ TIP: The only ClojureScript REPL type that doesn't require any additional
8080
setup is the Nashorn REPL. Unfortunately it's going to be removed in
8181
future versions of the JDK.
8282

83-
== Customization
84-
85-
If you frequently use the same ClojureScript REPL, you can set
86-
`cider-default-cljs-repl` and CIDER will skip the prompt and use this
87-
instead. For example, the following will make Nashorn the default:
88-
89-
[source,lisp]
90-
----
91-
(setq cider-default-cljs-repl 'nashorn)
92-
----
93-
94-
All supported ClojureScript REPLs are stored in
95-
`cider-cljs-repl-types`. If you need to extend it, you should use
96-
`cider-register-cljs-repl-type` in your Emacs configuration.
97-
98-
[source,lisp]
99-
----
100-
(cider-register-cljs-repl-type 'super-cljs "(do (...))" optional-requirements-function)
101-
----
102-
103-
You can also modify the known ClojureScript REPLs on a per-project basis using
104-
`.dir-locals.el`:
105-
106-
[source,lisp]
107-
----
108-
;; replace the list of REPL types and set some default
109-
((nil
110-
(cider-default-cljs-repl . super-cljs)
111-
(cider-cljs-repl-types . ((super-cljs "(do (foo) (bar))")))))
112-
----
113-
114-
[source,lisp]
115-
----
116-
;; modify the list of known REPLs and set some default
117-
((nil
118-
(eval . (cider-register-cljs-repl-type 'super-cljs "(do (foo) (bar))"))
119-
(cider-default-cljs-repl . super-cljs)))
120-
----
121-
122-
For one-off REPLs you can also use the custom REPL init form like this:
123-
124-
[source,lisp]
125-
----
126-
;; modify the list of known REPLs and set some default
127-
((nil
128-
(cider-custom-cljs-repl-init-form . "(do (foo) (bar))"
129-
(cider-default-cljs-repl . custom)))
130-
----
131-
132-
If you already have a Clojure REPL running and want to add a
133-
ClojureScript REPL, you can invoke
134-
`cider-jack-in-sibling-clojurescript` to add it.
135-
13683
== Working with `.cljc` files
13784

13885
Ordinarily, CIDER dispatches code from `clj` files to Clojure REPLs

0 commit comments

Comments
 (0)