cursive

danm 2025-05-01T11:01:18.612149Z

In Settings->Editor->Code Style->Clojure->Form Parameters, is there something else I need to do for the + button to do anytihng and allow me to add new indentation settings? At the moment (cond-> is indenting like -> (inline with the first parameter), and I'd like it to be like cond (2 spaces), but I don't seem to be able to add a new var to the list.

roklenarcic 2025-05-01T20:02:56.924889Z

When I try to load clj-kondo.impl.var-info-gen in REPL via the shortcut Cmd+Shift+L from

clj-kondo/clj-kondo {:mvn/version "2025.04.07"}
I get message: Dependency cycle: var_info_gen.clj -> var_info_gen.clj -> var_info_gen.clj However if I just run in REPL:
(require 'clj-kondo.impl.var-info-gen)
it reports no error

Dave Conlin 2025-05-12T12:30:16.787739Z

Oh, thanks for fixing this. Had been affecting me too, took me ages to work out what was going on since the dependencies were several levels deep in the tree, and of course I couldn't reproduce it in just one module. Really appreciate how quickly you've been able to roll out a fix

roklenarcic 2025-05-02T07:12:48.252329Z

No

cfleming 2025-05-01T20:08:58.759169Z

Thanks, I'll try that - a few people have been reporting similar issues that I haven't managed to reproduce.

borkdude 2025-05-01T20:11:57.699219Z

perhaps because cursive statically analysis this?

cfleming 2025-05-01T20:21:04.318869Z

Yes, Cursive tries to work out the transitive closure of namespace deps, so that it can send a namespace and any out-of-date deps in dependency order. But statically figuring out whether there really are loops (especially with CLJC madness) can be tricky.

borkdude 2025-05-01T20:34:33.331439Z

yeah this var-info-gen namespace has a in-ns thing in it which may confuse cursive's analysis

borkdude 2025-05-01T20:35:27.935709Z

it's required from var-info, so you have var-info-gen required by var-info but var-info-gen does an in-ns of var-info

borkdude 2025-05-01T20:35:57.359299Z

it's kind of the same trick that clojure.core does with deftype etc

cfleming 2025-05-01T20:36:46.367959Z

Cursive used to handle that ok, perhaps something has either broken or changed in ways I didn't anticipate. I'll check that out anyway, thanks for the pointer.

cfleming 2025-05-01T21:45:01.225449Z

I can't reproduce with that ns either, I'm not sure what's going on.

roklenarcic 2025-05-01T22:33:29.344409Z

Clojure version 1.12.0, don’t know what else to help you

cfleming 2025-05-01T22:41:43.279989Z

@roklenarcic Does rebuilding indexes help (File | Invalidate Caches)?

roklenarcic 2025-05-05T12:37:06.742809Z

So yeah initially this happened in a development namespace, now it’s happening in more important namespaces

cfleming 2025-05-05T19:35:36.595759Z

Could you check the module that it's happening in (File | Project Structure | Modules | <your module> | Dependencies) and see if there are two versions of Kondo there?

roklenarcic 2025-05-05T22:02:21.355309Z

Hm there’s just one, but that one is 2023.07.13 version

cfleming 2025-05-05T22:23:29.000459Z

Ok, I'll try to reproduce using that version.

roklenarcic 2025-05-05T22:38:41.223249Z

I mean I tried to load both here:

roklenarcic 2025-05-05T22:39:13.852179Z

and they both have the same error when I try to load them like this from the opened source

roklenarcic 2025-05-05T22:43:47.649499Z

Ah I see what’s a problem, they 2023 version doesn’t work. The project has a module with 2023 and a module with 2025 version, so they both show up in the jar list and if I try to open var_info_gen I can choose which source from which lib to open, and both throw an error when I try to load them. Then if I remove 2023 completely, so only 2025 version exists in the project (which has several modules), then it works.

roklenarcic 2025-05-05T22:47:21.768519Z

Ok, now I started a repl in module that includes 2025 version only and it still throws an error

roklenarcic 2025-05-05T22:55:58.846209Z

Yeah this is weird. So basically the I have base-module, it has kondo 2025, then I have module 1 that depends on base module and module 2 that depends on base module, that also has dependency on kondo 2023. Starting REPL for ANY of these modules, opening the var_info_gen.clj from 2025 version and trying to load it into active repl will produce dependency cycle error. Then I update kondo 2023 dependency in module 2 deps to 2025. This is where it gets weird. Besides fixing module 2, that also fixes module 1 and base module, now REPLs for those modules can load the var_info_get.clj file just fine.

roklenarcic 2025-05-05T22:56:32.515829Z

Loading

cfleming 2025-05-06T00:06:33.324909Z

That sounds plausible. This is a result of this change: https://github.com/cursive-ide/cursive/issues/3023. As a result of widening the allowable scope, it now frequently pulls in multiple versions of the same lib, which didn't happen previously. I'll see if I can fix this, otherwise I'll roll back this change and find another way to support build REPLs.

cfleming 2025-05-06T03:02:52.852559Z

There's a fix for this out in 2025.1.1-eap1.

👍 1