conjure
conjure copied to clipboard
Error when attempting to use ClojureScript suggestions with figwheel-main
NVIM: v0.8.3 Clojure CLI: version 1.11.1.1224 Conjure: latest release
I'm trying to use Conjure on NVIM to develop ClojureScript, and it works okay, except I can't get detailed suggestions for any ClojureScript-related libraries.
I set up a project in the following way, using the figwheel setup guide to help me.
First, I created a new figwheel-main
project named testname/testproject
:
clj -X:new :template figwheel-main :name testname/testproject :args '["+deps"]'
Then I downloaded the example nrepl.clj
from the setup guide to src/figwheel/nrepl.clj
changed my deps.edn
to resemble the one from the guide:
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/clojurescript {:mvn/version "1.11.4"}}
:paths ["src" "resources"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
org.slf4j/slf4j-nop {:mvn/version "1.7.30"}
com.bhauman/figwheel-main {:mvn/version "0.2.17"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:test {:main-opts ["-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "testname.test-runner"]}
:nrepl {:extra-deps {nrepl {:mvn/version "1.0.0"}
cider/piggieback {:mvn/version "0.5.3"}
cider/cider-nrepl {:mvn/version "0.30.0"}}
:main-opts ["-m" "figwheel.nrepl" "-b" "dev"]}}}
With the setup done, I start an nREPL session with clj -M:fig:nrepl
.
With the nREPL session running, I open src/testname/testproject.cljs
in Neovim and connect to the ClojureScript REPL with the command :ConjurePiggieback (figwheel.main.api/repl-env "dev")
.
I can write ClojureScript and evaluate things perfectly. If I evaluate the following code:
(ns ^:figwheel-hooks testname.testproject
(:require
[goog.dom :as gdom]))
and I begin to type (goog.)
, I get a list of top-level suggestions, such as goog.Uri
, goog.dom
, goog.array
, etc. However, upon typing (goog.dom/)
, suggestions do not appear and I get the following error in my nREPL window:
localhost:7888 (...gged/conjure/lua/conjure/client/clojure/nrepl/action.lua:736: invalid value (nil) at index 1 in table for 'concat'): .nrepl-port
Any ideas how I can diagnose the issue or it can be fixed? Thank you!
Hm not sure what exactly is going wrong, it could be the ^:figwheel-hooks
confusing the namespace name extraction code. I've updated the code that threw that error so it'll handle nil values properly now which might fix it or at least work around the issue.
Might need to update some namespace extraction code though, I actually thought it already handled this sort of metadata in the ns block, but maybe not!