This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-27
Channels
- # 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.
Do you get a stacktrace dumped to the REPL?
@cichli: I have https://github.com/clojure-emacs/cider/issues/1489#issuecomment-167415309 instead
Thanks, that's enough for me to replicate - I'll take a look this evening
I think the first two examples are expected; cljs.repl
is only automatically required in the cljs.user
namespace
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?)
Oh, I see, you're still seeing print-doc
in the completions for the first two cases
@cichli: I can execute (cljs.repl/source cljs.repl/doc)
after executing (ns hello-world.test (:use-macros [cljs.repl :only [doc]]))
.
Even after (ns something.core)
, cljs.repl/doc
, cljs.repl/source
, etc are available for invocation. But, they are not available for auto-completion.
Gotcha, thanks
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
Thanks for the detailed report
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
Ouch, 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 lein repl
, cljs.repl
is somehow available for auto-completion after invoking (ns)
.
Completion is contextual depending on the namespace because the following is not a valid ClojureScript program:
(ns foo)
(cljs.pprint/pprint "bar")
You can't use any namespaces that you haven't explicitly required (except cljs.core
obviously). 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.> The auto-completion is like a roller coaster for now. What's that supposed to mean?