cursive

Issues at: https://git.io/cursive-issues
Casey 2021-02-19T08:04:50.191400Z

hey there đź‘‹ I'm working with fulcro and pathom using the fulcro-template. Out of the box fulcro's defsc seems recognized as a "def-like" macro. Guardrails' >defn wasn't but using the đź’ˇ popup I could tell Cursive to resolve it as a defn. However, with pathom's defresolver macro in the same file, the đź’ˇ menu only gives me spell checking options. Is there a way to resolve that macro as a defn too?

Casey 2021-02-19T08:06:07.192500Z

... and all of a sudden the resolve as option appears. Huh, maybe intellij wasn't done indexing? In any case, its working now, nevermind. Sorry for the noise.

Casey 2021-02-19T08:11:40.193Z

Been awhile since I used intellij+cursive, gotta remember to give it time to index 🙂

Casey 2021-02-19T08:13:26.194Z

Oh, man, and I remember my biggest beef with ideavim+cursive: paredit doesn't work when using vim commands.

Zak Singh 2021-02-19T09:17:38.195600Z

Is there any way to deal with these unresolved symbols inside of this defspec macro? I’ve added a symbol resolution to resolve defspec to deftest, and one for prop/for-all to let, but I still get the red squiggly errors

dazld 2021-02-19T13:00:32.197300Z

Is View expansion broken for projects using shadow-cljs? I get the following error expanding (identical? {} {})

------ REPL Error while processing ---------------------------------------------
(cljs.core/load-file "/Users/danpeddle/Library/Application Support/JetBrains/IntelliJIdea2020.3/plugins/clojure-plugin/lib/runtime.jar!/cursive/riddley/compiler.clj")
can only load .cljs and .cljc files
{:file-path "/Users/danpeddle/Library/Application Support/JetBrains/IntelliJIdea2020.3/plugins/clojure-plugin/lib/runtime.jar!/cursive/riddley/compiler.clj"}
ExceptionInfo: can only load .cljs and .cljc files
	shadow.cljs.repl/repl-load-file* (repl.clj:290)
	shadow.cljs.repl/repl-load-file* (repl.clj:282)
	shadow.cljs.repl/repl-load-file (repl.clj:330)
	shadow.cljs.repl/repl-load-file (repl.clj:328)
	shadow.cljs.repl/process-read-result (repl.clj:517)
	shadow.cljs.repl/process-read-result (repl.clj:497)
	shadow.cljs.repl/process-input (repl.clj:681)
	shadow.cljs.repl/process-input (repl.clj:659)
	shadow.cljs.devtools.server.worker.impl/eval17164/fn--17167 (impl.clj:754)
	clojure.lang.MultiFn.invoke (MultiFn.java:234)
	shadow.cljs.devtools.server.util/server-thread/fn--16793/fn--16794/fn--16802 (util.clj:284)
	shadow.cljs.devtools.server.util/server-thread/fn--16793/fn--16794 (util.clj:283)
	shadow.cljs.devtools.server.util/server-thread/fn--16793 (util.clj:256)
	java.lang.Thread.run (Thread.java:832)

Error initialising macroexpansion

thheller 2021-02-19T13:07:10.197600Z

looks like you are trying to load a .clj file? hmm or rather that cursive is trying to?

favila 2021-02-19T19:46:55.198900Z

I’ve had this problem for a while now (months?) where I can’t interact with the dialog that shows macroexpansion.

cfleming 2021-02-20T23:10:42.020300Z

I’ve just tried this, and I’m seeing the following exception thrown:

java.lang.StackOverflowError
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:471)
	at com.intellij.codeWithMe.ClientIdService$Companion.tryGetInstance(ClientIdService.kt:13)
	at com.intellij.codeWithMe.ClientId$Companion.getCurrentOrNull(ClientId.kt:77)
	at com.intellij.codeWithMe.ClientId$Companion.isCurrentlyUnderLocalId(ClientId.kt:60)
	at com.jetbrains.rdserver.ui.popup.bePopups.impl.BackendBePopupFactory.getChildPopups(BackendBePopupFactory.kt:137)
	at com.intellij.openapi.ui.popup.JBPopupFactory.getChildFocusedPopup(JBPopupFactory.java:208)
	at com.jetbrains.rdserver.ui.popup.bePopups.impl.BackendBePopupFactory.getChildFocusedPopup(BackendBePopupFactory.kt:156)
	at com.intellij.openapi.ui.popup.JBPopupFactory.getChildFocusedPopup(JBPopupFactory.java:212)

cfleming 2021-02-20T23:11:17.020500Z

Is that what you are both seeing as well? This must be fairly new since it seems to be a problem with Code With Me, probably trying to share the macroexpand results with other clients.

kenny 2021-02-20T23:14:11.020700Z

I’m on my Mac laptop right now and just tried. The popup won’t even appear now. I’m getting a different exception.

kenny 2021-02-20T23:14:24.020900Z

cfleming 2021-02-20T23:16:00.021300Z

Could you try to expand this form and see if it does the same thing?

(defn x [a]
  (+ 1 a))

cfleming 2021-02-20T23:17:07.021500Z

Just to have something simple as a baseline.

kenny 2021-02-20T23:17:31.021700Z

That one opens the window. The window isn’t intractable. Same error in the logs.

cfleming 2021-02-20T23:17:47.021900Z

The NPE?

kenny 2021-02-20T23:17:57.022100Z

No, yours.

kenny 2021-02-20T23:18:33.022300Z

To get mine, I tried macroexpanding my-macro in a comment form:

(defmacro my-macro
  [x]
  `(int? ~x))

(comment (my-macro 1))

cfleming 2021-02-20T23:18:42.022500Z

Ok, thanks. I’m going to have to ask JetBrains about that. Your NPE looks like a bug in the expander code itself. Are you able to share what you were trying to expand?

cfleming 2021-02-20T23:18:48.022700Z

Great, thanks, let me try that.

cfleming 2021-02-20T23:21:47.022900Z

Do you think it would be ok to open the macroexpander in a toolwindow, perhaps in a tab in the REPL one? I think for Code With Me, they’re planning to automatically sync toolwindows so that might make it easier.

kenny 2021-02-20T23:23:14.023100Z

Is that like how the test diff opens in a window?

cfleming 2021-02-20T23:23:39.023300Z

No, it would open in a tab in the REPL toolwindow, like multiple REPL sessions do now.

kenny 2021-02-20T23:24:32.023500Z

Oh. That seems wrong haha.

kenny 2021-02-20T23:24:52.023700Z

I probably want my active repl session in view while I have the macroexpand.

cfleming 2021-02-20T23:25:54.023900Z

Yeah, that was what I was thinking. The popups are really a pain though, and not very flexible from a user point of view. Perhaps in a new editor, like the other code editors?

kenny 2021-02-20T23:26:41.024100Z

What’s a new editor?

cfleming 2021-02-20T23:26:51.024300Z

I’d have to try that and see how it would work. A few people have requested that the REPL itself be shown in an editor tab rather than a toolwindow.

cfleming 2021-02-20T23:27:07.024500Z

Like a standard code editor, that would be open in a tab.

cfleming 2021-02-20T23:27:35.024700Z

IntelliJ does that for some diffs now, rather than opening them in a new window, although I haven’t managed to figure out when it actually does that.

kenny 2021-02-20T23:28:41.024900Z

Oh, yeah a new editor seems fine. The knobs for configuring the macroexpand go at the top? Kinda like markdown support?

cfleming 2021-02-20T23:28:59.025200Z

Right, exactly.

cfleming 2021-02-20T23:29:38.025400Z

So then you could switch to them using “Recent files” and the like too.

kenny 2021-02-20T23:29:43.025600Z

I always work with my repl opened in “Window” View Mode on a separate monitor. Switching to a regular editor tab does seem more general.

cfleming 2021-02-20T23:30:31.025800Z

Right, doing that you could have two repls side by side. My one issue with it is it then becomes more confusing which one is “active” when you send forms to it.

kenny 2021-02-20T23:31:51.026Z

Yeah, you’d definitely need some way of marking a repl as active.

cfleming 2021-02-20T23:31:52.026200Z

I reproduced your issue BTW: https://github.com/cursive-ide/cursive/issues/2510

kenny 2021-02-20T23:32:36.026500Z

The one thing that could be problematic with a new editor for macroexpand is usually you’d want the pre-expanded code in context. If macroexpanding opens you into a new tab, you lose that.

cfleming 2021-02-20T23:33:46.026700Z

Yeah, that’s true. I wonder if I could actually do the macroexpansion inline inside the editor with the new inlay stuff - that might be the best option if I can make that work in a non-confusing way.

kenny 2021-02-20T23:34:26.026900Z

Oh, interesting. Where would the macroexpand knobs go?

cfleming 2021-02-20T23:35:14.027100Z

Inline in the editor itself. IntelliJ uses that itself these days for code review comments in the diff views - you get Swing controls embedded in the editor itself.

cfleming 2021-02-20T23:35:30.027300Z

I’ll give that a try, since I’m working on some inlay stuff right now anyway.

cfleming 2021-02-20T23:35:45.027500Z

If I have something to try I’ll let you know so you can try it out.

kenny 2021-02-20T23:37:00.027700Z

Cool. People have been asking for inline for as long as I’ve been using Cursive haha. Seems like a good poc.

kenny 2021-02-20T23:37:20.027900Z

Curious what it looks like. Is there a public screenshot somewhere of the code review inline thing?

cfleming 2021-02-20T23:37:28.028100Z

Yeah, IntelliJ finally has the infrastructure for it. I’m dying to get the test diffs inline too.

cfleming 2021-02-20T23:39:40.028500Z

I don’t think that’s it because Upsource is an online tool.

cfleming 2021-02-20T23:39:45.028700Z

I can’t find one, though.

kenny 2021-02-20T23:40:06.028900Z

Oh haha. I thought it’s style didn’t quite match.

kenny 2021-02-20T23:42:34.029100Z

Anyway, happy to try it out. Inline seems like a powerful new UI concept. Curious how it’ll work with large data structures.

cfleming 2021-02-20T23:44:09.029300Z

I’ll let you know when I have something.

1
favila 2021-02-19T19:47:11.199Z

Has anyone else experienced this?

cfleming 2021-02-19T20:07:52.199200Z

I haven’t had any reports, but I also don’t use that view much and it’s hard to make automated tests for, so it may be broken.

cfleming 2021-02-19T20:08:09.199400Z

I’ll take a look and see if it works for me.

kenny 2021-02-19T20:43:28.199800Z

Yes. I’ve had this too.