Fork me on GitHub
#cursive
<
2021-12-01
>
stuartrexking00:12:54

I don’t do anything special for shadow. I start shadow from the terminal, then I connect to it’s nrepl from intellij run configuration. I choose the module in the connection settings. Once I’m connected, I (shadow/repl :main) or whatever your config is.

stuartrexking00:12:28

Sounds to me like your intellij module isn’t being correctly configured for your deps.edn setup.

stuartrexking00:12:39

Is there a module in your project settings?

Drew Verlee01:12:31

can you be more specific when you say "a module"?

Drew Verlee01:12:08

or phrase it a different way, i'm not sure exactly what that means.

Drew Verlee01:12:53

and yep, my plan was to start it from my terminal and then connect to it.

Drew Verlee01:12:41

Here is what my run config looks like

Drew Verlee01:12:19

and my settings...

Drew Verlee01:12:07

I assume the issue is in my "config" (first pic)

Drew Verlee01:12:01

if i click run i get a "repl run configuration is incorrect - no module selected"

Drew Verlee01:12:22

shadow-cljs - nREPL server started on port 43885

stuartrexking01:12:34

IntelliJ Modules

stuartrexking01:12:48

each of those is a deps.edn on it’s own.

stuartrexking01:12:06

What do you have in your modules list under Project Structure

Drew Verlee01:12:39

looking. I think i see the issue though, i didn't select the project root maybe.

Drew Verlee01:12:59

here are my modules with the correct project root selected...

stuartrexking01:12:21

Hard to tell your setup from that. Can you screenshot your project structure window?

Drew Verlee01:12:30

What does you run/debug configurations look like ? i have "remote repl": • connection type: nrepl • connect to server (bc i started shadow locally) w/ host->locahost port->port started for nrepl server by shadow. context module->name of project root.

Drew Verlee01:12:38

If i run the "run" then it says its trying to connect to a remote server and just hangs

stuartrexking01:12:53

Have you started shadow?

Drew Verlee01:12:44

shadow-cljs - HTTP server available at 
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.15.10 running at 
shadow-cljs - nREPL server started on port 43885
shadow-cljs - watching build :dev
[:dev] Configuring build.
[:dev] Compiling ...
[:dev] Build completed. (1512 files, 1 compiled, 0 warnings, 9.10s)

Drew Verlee01:12:53

maybe its working right now. i think i ran into this before were i expected a repl to pop up after i hit the run button and its like hiding

Drew Verlee01:12:41

it's telling me i can't send cljs forms to a clj repl. Which is fair, but shadow started the nrepl server at the port i selected for my remote repl. And when i started the repl i selected "cljs" though it immeditly changes to clj.

Drew Verlee01:12:03

ok i had to run (shadow/repl <my build>)

stuartrexking01:12:27

yes that’s right

Drew Verlee01:12:14

i should be get auto complete on a ns i require into another right e.g re-frame/* with * as my cursor should show everything in the re-frame ns. i don't and they are highlited telling me that that "re-frame" cannot be resolved.

stuartrexking01:12:55

Yeah you should. That’s normally the Module not correctly imported or created.

Drew Verlee01:12:38

Is this module setup by intelliji on load? like why wouldn't it be created correctly?

stuartrexking01:12:16

Impossible to tell from here.

stuartrexking01:12:23

One thing you could do is delete all the .idea and *.iml files and recreate your project.

Drew Verlee01:12:15

ill try that.

Drew Verlee01:12:02

that fixed it.

Drew Verlee02:12:26

Interesting. auto completion works, but it's inconstant. Like 1/4 times it won't give them on the same symbol.

Drew Verlee02:12:29

but thats enough diving into this for today 🙂

Drew Verlee02:12:36

i swear to god, everytime i try out a different editor then emacs bc something isn't working (auto completion) it scares emacs into working

stuartrexking02:12:13

There is no silver bullet unfortunately. Every few months I find myself flirting with a different editor because Cursive doesn’t have exactly what I want, but I always end up returning (happily I might add)

Drew Verlee02:12:46

Yep. The autocomplete thing is an utter mystery in this project. From file to file in the same folder it stops working

Drew Verlee02:12:00

What i need to do is see if it fails the same way across a couple tools.

Drew Verlee02:12:34

I'm going to find a compiler bug or something. My claim to fame.

Drew Verlee02:12:55

files with the letter "f" don't work on saturdays when there is a high tide.

cfleming03:12:03

We can’t send email more than 500 miles: https://www.ibiblio.org/harris/500milemail.html

👏 2
agigao07:12:21

Hey guys, I wonder why load file to REPL doesn’t eval the content? What is equivalent of cider-eval-buffer in Cursive?

cfleming07:12:49

Why do you think that load file doesn’t eval the content? It basically does a load-file (with some extra complication).

agigao08:12:05

:man-shrugging:

cfleming08:12:55

Was your hello command typed into the REPL editor? If so, that’s because the REPL namespace is not the same as the namespace of the file. If you do (test/hello "Cursive") instead, that should work.

agigao11:12:43

Nope, in the ns

cfleming20:12:43

Do you have Preferences | Languages &amp; Frameworks | Clojure | REPL Options | Evaluate forms in REPL namespace selected?

cfleming20:12:06

If you eval *ns* from the file, what does it show?

agigao07:12:11

1. Yes, it’s marked 2. Loading src/flx/awspricy.clj... loaded and then *ns* => #object[clojure.lang.Namespace 0x52bc6236 "user"]

cfleming23:12:37

Ok, that’s the problem. That checkbox is not checked by default. What that means is that if you send forms from an editor to the REPL, they will be evaluated in the current REPL ns rather than the ns of the file from which they came. So, when you load your file it’s loaded into the test ns as you would expect. Then when you evaluate (hello "Cursive") from your file, that happens in the user ns instead of your test ns, which is why hello can’t be found.

cursive 1
agigao09:12:11

Thank you!

scarytom12:12:43

hmm... I seem to be having some issues with deps.edn in cursive today. Has anyone seen a stack trace like this before?

java.lang.RuntimeException: Could not create shim
	at cursive.shim.ShimProvider.getShim(Shim.kt:148)
	at cursive.shim.ShimProvider.withShim(Shim.kt:115)
	at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:176)
	at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:87)
	at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:45)
	at cursive.build.BuildSystemProjectsManager.reimportAllProjects$lambda-3$lambda-2(BuildSystemManager.kt:149)
	at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:83)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
	...
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: Syntax error compiling at (cursive/deps/command.clj:28:40).
	at clojure.lang.Compiler.analyze(Compiler.java:6808)
        ...
	at clojure.lang.Var.invoke(Var.java:384)
	at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.require(ClojureRuntimeShimImpl.java:73)
	at cursive.shim.ShimBootstrap.apply(ShimBootstrap.java:29)
	at cursive.shim.Shim.createShimProvider$lambda-1(Shim.kt:80)
	at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:155)
	at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:153)
	at cursive.application.ApplicationKt.onPooledThread$lambda-2(Application.kt:16)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:263)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	... 7 more
Caused by: java.lang.RuntimeException: No such var: deps/make-classpath-map
	at clojure.lang.Util.runtimeException(Util.java:221)
	at clojure.lang.Compiler.resolveIn(Compiler.java:7388)
	at clojure.lang.Compiler.resolve(Compiler.java:7358)
	at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7319)
	at clojure.lang.Compiler.analyze(Compiler.java:6768)
	... 110 more

Alex Miller (Clojure team)12:12:17

Fyi, if you hit the lightning icon and “create a text snippet”, it doesn't spam the channel quite as bad

scarytom14:12:36

Thanks @U064X3EF3, I wasn't expecting the stack trace to be so huge when I pasted it in! I'll move it into this thread to avoid the spam in the channel.

scarytom14:12:53

full stack trace

scarytom14:12:54

I have submitted Exception report #21858 @U0567Q30W

scarytom14:12:09

I've tried re-opening the project against a clean check-out of the code and it now fails as soon as I try to "add as a clojure deps project"

cfleming20:12:49

Thanks, I’ll check that.

cfleming20:12:34

@UCQV87CN7 Does upgrading deps fix that? IIRC that was me trying to fix a deprecation warning in deps, and that var might not exist in older versions.

Alex Miller (Clojure team)20:12:59

it is true that it does not exist in (much) older versions

scarytom21:12:19

hmm, it is possible that my clojure cli is a little out of date...

clj --version
Clojure CLI version 1.10.3.855

scarytom21:12:22

upgraded to 1.10.3.1040 and that seems to have immediately fixed things -- thanks a lot \o/

scarytom21:12:30

I wonder if it is worth getting Cursive to pop up a balloon in IntelliJ warning if the clojure cli version is out of date?

cfleming21:12:16

It actually does do that, but I made that change without considering that this might be a problem. I’ll figure out what the new minimum version is and update that.

👍 1
1
cfleming21:12:00

Actually IIRC I feature test rather than having a hard-coded version, can’t remember the details right now but I’ll update after this fix regardless.

scarytom21:12:13

fantastic, thanks.

scarytom21:12:36

let me know if you need me to harvest any more details for you.