Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when attempting to use ClojureScript suggestions with figwheel-main #476

Open
negatethis opened this issue Apr 4, 2023 · 1 comment
Labels
bug Something isn't working client-clojure

Comments

@negatethis
Copy link

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!

@Olical
Copy link
Owner

Olical commented Apr 10, 2023

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!

@Olical Olical added bug Something isn't working client-clojure labels Apr 10, 2023
Olical added a commit that referenced this issue Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client-clojure
Projects
None yet
Development

No branches or pull requests

2 participants