Fork me on GitHub
#cursive
<
2021-11-29
>
shinichy07:11:00

I created an IntelliJ plugin that enables navigation to Clojure https://github.com/weavejester/integrant component code. It supports navigation to init-key code from its key in a map. It also supports navigation from #ig/ref to its target. It’s useful when navigating a large code base using Integrant/duct. Please let me know if anyone finds an any issue. https://plugins.jetbrains.com/plugin/18019-integrant https://www.youtube.com/watch?v=kuv2f8Afv0o

👍 2
cfleming02:11:23

This is really cool! I had a quick look at the code, a few comments:

cfleming02:11:12

I think your FilesSearchScope can just use GlobalSearchScope#filesScope().

cfleming02:11:35

Actually, I thought I had another comment, but I think what you have is OK. Nice work! That must have taken some figuring out 🙂

shinichy06:11:40

Thanks! It’s my first plugin, so I appreciate your feedback! Yes, it took a lot of time to figure out Psi element tree 😅 It would be great if my plugin depends on only cursive.psi.api.* packages, but I couldn’t find a good way to achieve what I want without cursive.psi.impl.* packages.

shinichy06:11:16

May I ask a question about testing my plugin? I’m trying to add a test, but ClojureGoToSymbolContributor doesn’t seem to work in the test. Do you know how to enable it in the test? https://github.com/shinichy/integrant-intellij-plugin/blob/add-test/src/test/kotlin/com/github/shinichy/integrant/IntegrantNavigationProviderTest.kt#L52

cfleming09:11:14

Hmm, I don’t, sorry. What I would normally do is get the IntelliJ community source code, and look for other implementations of the base class (ChooseByNameContributor), and see where they’re used in tests. But I just checked a few implementations there and they don’t seem to be used in tests at all, at least not directly. It’s possible there are tests for higher-level things like Go To Symbol which use them under the hood, but I’m not sure, sorry.

shinichy21:11:17

No worries. Thanks for checking it!

helios09:11:06

Uh, JetBrains just announced Fleet, a new lightweight editor. https://www.jetbrains.com/fleet/ Since it's using intelliJ for the code-processing engine I'm curious to see what will come out of it, and if it could be a lightweight alternative for us clojurians (with cursive! 😉). I guess this is news also to you @cfleming?

cfleming19:11:25

It is news to me! I knew they have been working on various projects along these lines, but I didn’t know they were ready.

cfleming22:11:14

Looks like it will be a while before I can do anything to support this.

👍 1
Jakub Holý (HolyJak)15:11:49

Is there a way to run all tests from IntelliJ? (Using Lein) I assume that will make the results more navigable than just running lein test in the terminal. I have tried to add a run config. for clojure.test with "run all tests in module" but there was some IntelliJ error about the cursive config class that could not be cast to some II Base class and the run config does not run...

cfleming19:11:06

Could you send the exact error? Or even better, check to see if it appears in your log?

Jakub Holý (HolyJak)10:11:52

I don't know where to find it. It appeared in a pop up window which I killed.

Jakub Holý (HolyJak)10:11:46

Ok, I found II logs but not sure what to look for. I will try to re-create the error.

Ian Fernandez17:11:56

I've tried to get a Repl running clojure from clojure cli with this :jvm-opts :

"--add-modules" "java.base/jdk.internal.misc=ALL-UNNAMED"

Ian Fernandez17:11:12

it gives me an error:

Unrecognized option: --add-exports
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

cfleming02:11:34

Does this happen in Cursive or on the command line?

Ian Fernandez15:11:50

in cursive only

cfleming20:11:43

Can you send a screenshot of the error?

cfleming20:12:24

That looks to me like your project is using the JDK bundled with IntelliJ, and it doesn’t support that option. There’s more information here about the syntax of that option in different JDK versions: https://stackoverflow.com/questions/40313090/java-9-options-add-exports-vs-xaddexports-not-recognized/40369977

cfleming21:12:11

Actually, I misread part of the stacktrace, it’s not using the IntelliJ JVM. But regardless, it’s a problem with the JVM, so I guess your Cursive project is using a different JVM to the one that’s picked up on the command line.

1
Ian Fernandez17:11:21

why this happened?

cap10morgan21:11:36

Just updated to 1.12.0 (not sure what I had before but I am on EAP channel) on IDEA 2021.2.3 and lots of (but not all) clojure.core symbols have stopped resolving in a babashka project (e.g. defn, let, and ns don't resolve but def does). I tried invalidating caches and even deleted .idea and the .iml file and re-setup the project but no dice. Anyone else seeing that in babashka projects?

cap10morgan21:11:20

Oh, this is with babashka 0.6.6

borkdude21:11:23

Hmm, @cfleming - is there anything I can do to help here?

borkdude21:11:52

I think I found the issue

borkdude21:11:23

the print-deps result contains a local/root dependency which doesn't make sense for this use case

borkdude21:11:31

I'll make an issue and fix that

borkdude22:11:12

What a co-incidence, I had this issue open in my browser and you commented on it just now: https://github.com/oracle/graal/issues/2666#issuecomment-982087148

😆 1
borkdude22:11:41

I pushed a fix for this to master, releasing now

borkdude22:11:00

will take 15 minutes or so (if CI cooperates)

borkdude23:11:32

done, 0.6.7 released

👍 1
cap10morgan00:11:26

confirming 0.6.7 fixed it here too. thanks again @U04V15CAJ!