Fork me on GitHub

I get the following error when trying to start a Repl in Cursive with aot enabled for two namespaces that contain defprotocol and :gen-class: LinkageError loader constraint violation: when resolving method "com.whatever.KafkaProducerCollector.<init>(Lfranzy/clients/producer/protocols/FranzyProducer;)V" the class loader (instance of clojure/lang/DynamicClassLoader) of the current class, com/whatever/metrics$kafka_producer_collector, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, com/whatever/KafkaProducerCollector, have different Class objects for the type franzy/clients/producer/protocols/FranzyProducer used in the signature com.whatever.metrics/kafka-producer-collector (metrics.clj:16)


nevermind. A Refresh in the Leiningen tab fixed the issue


hmm, it keeps happening every now and then. Is this a known issue?


I can reproduce it by running lein clean and starting a new REPL. If I stop the REPL, and start it again then it works. It only fails when booting a REPL and the classes are not compiled yet.


Updating to the newest EAP has rebound my keybindings, is that expected? I knew there were changes, but didn't think it would affect existing users


In particular overriding Select Previous/Next Tab from the macOS defaults


@danielcompton I wouldn’t have expected that, no - it should have just changed the defaults. Also Cursive shouldn’t have touched that one at all since it’s not a Clojure action.


I just checked, Cursive definitely doesn’t bind anything to those actions.


@snoe Yes, unfortunately those inspections are not configurable - I’ve been meaning to fix that. I’ll try to do that in the next EAP.


You’ll still get some warnings though, e.g. UnityEngine.Input cannot be resolved.


@cfleming gotcha thanks!


@psalaberria002 That’s very strange. Does that also happen if you do lein clean and then lein repl on the command line?


I think the error went away after I changed the order of some required namespaces, and added more namespaces to aot. It only happened with Cursive Repl. lein clean lein repl worked fine. If it happens again I will notify here. thanks


Sorry wasn’t very clear, cursive wrap commands conflict with prev next tab


Just checked on my laptop and I didn’t have them bound before, so that’s why they were added.


@danielcompton Ugh, that’s a bummer.


I would only expect the key bindings to be added for new users, not existing ones


@cfleming Another question/observation. It feels to me that optimize imports has been a tough nut to crack. I wonder if as a stopgap wouldn’t be useful (simply (sort (rest require))


@danielcompton Unfortunately that’s hard, since I’m changing the way actions are mapped to the default keymaps. There’s no easy way to say “only do this if there’s nothing bound to that action, or if this action is already bound to something else”


But those are probably a bad choice for the wrapping on OSX though, which is unfortunate.


Can you set them based on the users parent keymap?


My key map is based off 10.5+ macOS


@snoe Yes, the problem with full optimise imports is that it has a lot of moving parts - rewriting the ns form with minimal changes is difficult, and once you’re rewriting it then you need a lot of options for formatting it, allowing lists or vectors for different forms etc. Even that issue you mention is harder than just (sort (rest require)) because of formatting. It is a lot easier though, you’re right.


@danielcompton That’s basically what this change does - it’s only actually modified the 10.5+ one, not your actual keymap.


I guess the issue is that you now have two keys bound to your wrapping commands - what you had before and the new default one, which conflicts with the tab commands. You can unbind that obviously, but it’s not ideal as a default.


@souenzzo Looking at that issue, Cursive doesn’t use DatatypeConverter anywhere that might get injected into your project, so I’m guessing that use is from your project code. You mention you’re adding the module JVM args, are you adding those to the REPL run config? If so, try adding them to your project.clj, which will mean they’ll be picked up by the stubs generation as well (and things like lein run or whatever)


Great, thanks for letting me know!


@snoe I did a long time ago, but I should take another look, thanks!


Is there any way to do copy/cut/delete of the current s-expression (the inner-most containing the cursor)?


@danielcompton No, that seems to just cut everything from the cursor to the end of the current s-expression. I've been working with atom and proto-repl for awhile, coming back to cursive now. One of the things I found is that cut/paste of entire expressions works nicely with parinfer (IMHO).


Maybe I could do it with a macro. That's effectively what I did with atom.


@dave.dixon expand-selection x3 (ctrl/cmd-w) works ok.


@dave.dixon Yes, I’m afraid that expand selection is really the only option right now.


Perhaps a “Select innermost sexp” would be a useful action.


Someone suggested an “Expand selection by sexps” which would work for this too, one expand by sexp and then select/copy/send to REPL