clojure-emacs / orchard

A fertile ground for Clojure tooling
Eclipse Public License 1.0
323 stars 54 forks source link

Make orchard.java/class-info* not initialize classes #235

Closed jpmonettas closed 2 months ago

jpmonettas commented 3 months ago

Haven't checked all PR requirements and there are tests failing. Adding this after the slack discussion here This is just for reference. Can be deleted after.

vemv commented 2 months ago

I'm not sure a PR is the right way to re-surface this topic, given that we observed that there wasn't a trivial fix.

Anyway, I'll ponder on the topic - feel free to ping me if there are no news.

jpmonettas commented 2 months ago

@vemv yeah I think this is going to be tricky to solve reliable. But I also think it is important since currently you can't work with Cider on a JavaFX project for example.

Maybe the easiest thing to do is to add some kind of blacklist for skipping initializing classes with a JVM property or something? I think this will be a low risk change and provide a solution for people working on this kind of projects and wanting to upgrade Cider (like me :P)

vemv commented 2 months ago

A blacklist would SGTM. It can be named e.g. orchard.edn with a :class-info-banlist k-v.

You can take a look at https://github.com/clojure-emacs/cider-nrepl/pull/863/files as an example of obtaining multiple identically-named resources and then combining them safely.

(Can also do myself)