This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (9)
- # aws (1)
- # beginners (4)
- # boot (197)
- # cider (38)
- # cljsrn (70)
- # clojure (128)
- # clojure-russia (36)
- # clojurecup (1)
- # clojurescript (86)
- # core-typed (2)
- # css (1)
- # datomic (35)
- # editors-rus (4)
- # hoplon (22)
- # ldnclj (2)
- # mount (19)
- # off-topic (45)
- # om (63)
- # onyx (7)
- # parinfer (8)
- # yada (2)
@malabarba: https://github.com/crocket/nrepl-figwheel-node-template is easier than those tutorials.
@cichli: I have https://github.com/clojure-emacs/cider/issues/1489#issuecomment-167415309 instead
I think the first two examples are expected;
cljs.repl is only automatically required in the
But the latter sounds like either a bug in the CLJS autocompletion code, or possibly a bug in the CLJS compiler itself (can you successfully use any of the macros in
cljs.repl that you didn't specifically impot?)
@cichli: I can execute
(cljs.repl/source cljs.repl/doc) after executing
(ns hello-world.test (:use-macros [cljs.repl :only [doc]])).
cljs.repl/source, etc are available for invocation. But, they are not available for auto-completion.
This issue might be specific to
cljs.repl, so we might just have to special-case that. I'll see if the issue occurs for other macro namespaces
I haven't tested other namespaces, yet. I think making it a special-case would be fragile since clojurescript can change later.
If everything in
cljs.repl is always available in all namespaces in CLJS REPLs, that's not too likely to change - it's hard not to special-case as we rely on data from the CLJS compiler to populate the completions, which doesn't have any knowledge of REPL-specific quirks like that namespace always being available
I wouldn't actually hardcode everything that's in
cljs.repl into the completions - I'd still introspect that NS and get all the public vars + macros
cljs.pprint is unavailable for auto-completion after moving to a new namespace. What is this?
Why do namespaces hide completely or expose themselves partially after moving to a new namespace?
cljs.repl/print-doc is always available for auto-completion, and the rest of
cljs.repl is available for only invocation when it's not required.
@cichli: If I launch figwheel on
cljs.repl is somehow available for auto-completion after invoking
Completion is contextual depending on the namespace because the following is not a valid ClojureScript program:
You can't use any namespaces that you haven't explicitly required (except
(ns foo) (cljs.pprint/pprint "bar")
cljs.coreobviously). We haven't done the work to make CIDER's completion be smart enough to differentiate between "completing in a code file" and "completing at the REPL", so the completions you get are as if you're editing the file for that namespace, and the only completions we show are those that would be valid to include in the file.