Fork me on GitHub
#cursive
<
2020-04-29
>
steveb8n02:04:58

Q: I’m using Specter heavily in my code. I get lots of warnings about not being able to resolve Specter path navigators, even though they are valid Clojure. They are required using something like

[com.rpl.specter :refer [select select-first transform setval
                         ALL LAST FIRST NONE INDEXED-VALS MAP-VALS MAP-KEYS BEGINNING END
                         must pred compact submap collect-one index-nav walker]]

cfleming07:04:19

How are they defined? I suspect it’s because they’re defined via a macro rather than how they’re referred.

steveb8n22:04:02

defnav is a macro

steveb8n22:04:44

this is the result in a 2kloc integration test. is a bit difficult to see test failures

steveb8n22:04:52

any workarounds?

steveb8n02:04:00

cool. I didn’t connect the dots…that I can mark the macro used instead of the symbols created by the macro

steveb8n02:04:05

trying now…

steveb8n02:04:15

hmm. can’t figure it out. tried resolving ALL as com.rpl.specter/ALL but it won’t accept it

steveb8n02:04:32

also tried resolving defnav as def. didn’t change either

cfleming02:04:32

Resolving defnav as def should definitely do it.

cfleming02:04:00

One sec, I’m down in the weeds on another problem right now, will take a look in a bit.

steveb8n02:04:21

no probs. this is not urgent. just a nice to have

steveb8n02:04:56

Anyone know how to remove these warnings? I wonder if it is because Specter is a cljc based lib?

dpsutton03:04:06

little newbie help. I'm getting "Error running 'Unnamed:' Unknown error" when trying to run the repl. I don't know how to get more info or expand some pane that has the error in it. Freshly setup cursive and intellij on a mac. does anyone know what window to open to see more info?

dpsutton04:04:56

seems a restart cleared it whatever it was

kwladyka06:04:56

Is a way to print actual vs expected in more readable way? How do you deal with this? It works great with = but what about other fn to check conditions?

cfleming07:04:28

There isn’t at the moment but this is something I’m going to fix very soon.

kwladyka07:04:02

👍 will be great

kwladyka07:04:43

cursive it totally the best support for clojure coding so far just saying to make you happy 😉

cfleming08:04:36

I am happy 🙂

💯 1
dpsutton11:04:56

it seems navigate back and wrap with [] both share the shortcut cmd [. Is there a good way to regain the navigate back which seems pretty paramount? What do others use for this seemingly important keybinding?

cfleming21:04:01

You can always rebind action keys at Preferences | Keymap - no-one else has mentioned it, I think opinions differ on which actions are essential 🙂

💯 1
dpsutton21:04:24

fair point. thanks

salam02:04:13

actually… i filed a bug about this years ago: https://github.com/cursive-ide/cursive/issues/1892

cfleming02:04:45

Whoops, I stand corrected!

cfleming02:04:52

It’s a problem though - IntelliJ binds nearly all the keys to actions. For a long time Cursive didn’t bind anything by default and allowed users to set it up themselves, but then users complained about that (much more than they have complained about built-in actions being overridden).

salam02:04:16

were those complaints before cursive introduced parinfer? if that’s the case then i can totally get behind their complaints since back then paredit was the only option and it would make total sense for cursive to offer the default paredit key bindings out of the box. but with parinfer, especially with version 3, i would expect the paredit key bindings to be optional and can be switched on/off with one check box. it happened a few times to me, where i had to manually remove those key bindings one at a time for our new users because they kept getting surprises and didn’t really know what was happening as they just didn’t know such a thing as paredit and its key bindings.

cfleming02:04:04

Well, previously the way it worked was that Cursive didn’t bind any keys at all, and there was a preference pane which users could use to apply different sets of keybindings, i.e. bulk-enable keybindings. It was really confusing for users to understand. The problem with having those bindings be optional is that it involves modifying the keymap, which are immutable by default (if you want to modify some key bindings, you have to create your own keymap based off one of the immutable default ones). Getting users to understand how to configure that when they click a checkbox is tricky.

salam02:04:47

yes, i remember that. i was among those who were confused. truth be told, i still don’t understand how it worked to this day. 😁 yeah, i’m aware that intellij idea key maps are immutable but if a plugin can bind (dynamically) some keys after installation without changing the current key map then, i thought, they should be able to dynamically unbind those keys as well?

salam02:04:43

anyhow, this is just a minor inconvenience (some times.) an ideal experience, IMHO, would be: • having a separate checkbox for toggling structural editing/navigation • parinfer by default (with structural editing/navigation off and enabled) for new installation only • if user switches to paredit, turn structural editing/navigation on and leave it disabled • if user switches back to parinfer, turn structural editing/navigation off but leave it enabled for user to toggle it on, if she/he chooses to

cfleming03:04:10

Ok, thanks for the thoughtful feedback. I’ll take another look at this and see if I can make that work. I agree that parinfer should be on by default rather than paredit, I’ve been meaning to change that for a long time.

2