Fork me on GitHub
#cursive
<
2017-11-05
>
psalaberria00201:11:58

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)

psalaberria00201:11:52

nevermind. A Refresh in the Leiningen tab fixed the issue

psalaberria00201:11:26

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

psalaberria00202:11:41

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.

danielcompton21:11:10

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

danielcompton21:11:42

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

cfleming21:11:59

@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.

cfleming21:11:57

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

cfleming21:11:18

@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.

cfleming21:11:59

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

snoe21:11:39

@cfleming gotcha thanks!

cfleming21:11:51

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

psalaberria00208:11:10

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

danielcompton21:11:50

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

danielcompton21:11:22

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

cfleming21:11:48

@danielcompton Ugh, that’s a bummer.

danielcompton21:11:49

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

snoe21:11:00

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

cfleming21:11:46

@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”

cfleming21:11:38

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

danielcompton21:11:35

Can you set them based on the users parent keymap?

danielcompton21:11:55

My key map is based off 10.5+ macOS

cfleming21:11:13

@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.

cfleming21:11:53

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

cfleming21:11:39

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.

cfleming22:11:39

@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)

cfleming23:11:12

Great, thanks for letting me know!

cfleming22:11:37

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

sparkofreason23:11:31

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

sparkofreason23:11:47

@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).

sparkofreason23:11:57

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

snoe23:11:09

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

cfleming23:11:43

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

cfleming23:11:08

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

cfleming23:11:58

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