Cider: `js` namespace is not available for auto-completion on `(cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env))`.

Created on 31 Dec 2015  ·  6Comments  ·  Source: clojure-emacs/cider

Steps to reproduce:

  • Create a leiningen project
  • Add clojurescript and cemerick.piggieback as dependencies
  • Launch a cider clojure REPL
  • Execute (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)) to launch a nodejs REPL.
  • Type js/ and press TAB

Expected Result:

Auto-completion should show me a list of variables in js namespace.

Actual Result:

I see nothing.

ClojureScript

Most helpful comment

This is finally fixed in CIDER 0.22. All the credit goes to @rksm and his wonderful clj-suitable project, which CIDER leverages to provide better completions.

All 6 comments

@cichli Can you take a look at this, please?

I've looked at this before, with an enhancement to the CLJS compiler we could at least provide completion of externs - http://dev.clojure.org/jira/browse/CLJS-1047.

General completion of everything in the JS runtime requires eval which might block the REPL, or block if there's an eval op already running. The completions would also only be known to be valid at REPL-time, whereas in general the CLJS autocompletion only tries to suggest things that will actually work in your compiled CLJS. For example, you might define some variable on window in the JS environment you're connected to with your REPL, but then that variable won't necessarily be defined when your ClojureScript program is running in another environment.

Is it possible to complete built-in functions and objects? Like js/document.querySelector etc.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@arichiardi Is this something you can help with?

This is finally fixed in CIDER 0.22. All the credit goes to @rksm and his wonderful clj-suitable project, which CIDER leverages to provide better completions.

Was this page helpful?
0 / 5 - 0 ratings