Fork me on GitHub
#cider
<
2020-01-20
>
megasd2119:01:07

Hi all! I am having some trouble making CIDER + shadow-cljs work with clj suitable. I cider-jack-in-cljs to my app and try to get JS autocompletion for instance in (.| js/console) (with | being my cursor) but with no result. The messages I get when I enable nrepl logging are

(-->
  id                        "25"
  op                        "complete"
  session                   "dbea4a15-21ca-4b01-b3de-79dd32d13472"
  time-stamp                "2020-01-20 21:22:35.206522000"
  context                   ":same"
  enhanced-cljs-completion? "t"
  ns                        "cljs.user"
  symbol                    #("." 0 1 (type "special-form" ns "cljs.core"))
)
(<--
  id          "25"
  session     "dbea4a15-21ca-4b01-b3de-79dd32d13472"
  time-stamp  "2020-01-20 21:22:35.244830000"
  completions ((dict "candidate" "." "ns" "cljs.core" "type" "special-form")
 (dict "candidate" ".." "ns" "cljs.core" "type" "macro"))
  status      ("done")
)
Any idea how I could further debug my issue?

robertkrahn20:01:20

So it should work out of the box with recent cider and shadow cljs versions. Does it work e.g. with figwheel or node cljs repls?

megasd2121:01:49

I tried with a figwheel-main project, unfortunately with the same results. One thing I was wondering is wether I should be seeing a context = `(prefix__ js/console)` in the message exchange with nrepl..

robertkrahn22:01:01

Here is what I'm seeing for

robertkrahn22:01:44

(-->
  id                        "31"
  op                        "complete"
  session                   "50c693bf-d907-4d7d-af0c-402105498456"
  time-stamp                "2020-01-25 23:07:46.616102642"
  context                   "(__prefix__ js/console)"
  enhanced-cljs-completion? "t"
  ns                        "foo.main"
  symbol                    "."
)
(<--
  id          "31"
  session     "50c693bf-d907-4d7d-af0c-402105498456"
  time-stamp  "2020-01-25 23:07:46.672047154"
  completions ((dict "candidate" "." "ns" "cljs.core" "type" "special-form") ...)
  status      ("done")
)

megasd2120:01:23

That should help me forward, I’ll try to replicate your example and see where I can go from there - thank you very much @!