Fork me on GitHub
#cursive
<
2016-10-03
>
puzzler00:10:12

Should I set an "if-let"-style macro to mimic resolution of "let"? Is that considered "close enough" to do the right thing?

cfleming00:10:07

Yes. The only issue is that the bound variable will be incorrectly available in the else clause.

puzzler00:10:54

Actually, after trying it out more carefully, it looks to me like maybe Indent of "0" works like functions do.

cfleming00:10:12

That might be true, actually, depending on whether I specified that "body" values should all be indented two spaces, or should all be aligned - I can’t remember off the top of my head.

puzzler00:10:48

Well, I think I've successfully got Cursive recognizing for indenting and resolution purposes the cond, if-let, when-let, and defnc constructs in my better-cond library. Thanks. Only issue remaining is that if I use the "rename" feature of require, Cursive doesn't recognize the new names (I filed an issue about this yesterday). I want to rename defnc as defn, so that's an issue for me, but for now I'll avoid renaming.

cfleming00:10:32

Yes, someone else reported a similar issue - I’ll look into that since I added support for that and I believe it has unit tests. Something may have broken though.

cfleming01:10:01

@kenny @bfabry BTW I just looked into the namespaced maps issue. Here’s how this works: nREPL has a middleware called pr-values, which is responsible for converting values into strings to be passed back from the server to the client. This currently just calls pr, and is supremely un-customisable: http://dev.clojure.org/jira/browse/NREPL-55

cfleming01:10:19

I haven’t looked at Whidbey yet to see if I can use its solution.

cfleming01:10:59

I checked that Cursive’s pretty-printing will happily pprint whatever is returned from that, so I may be able to customise this at some point.

kenny01:10:16

Cool. Thanks for the update!

shaun-mahood16:10:21

This might be a bad idea, but is there any way to run leiningen tasks from within cursive? I see there's a run external tool option when adding a new REPL config, but I haven't tried it with anything. Really it's just me being lazy so that I can run lein ancient without having to open a command prompt on Windows, so it's about as low on the list of importance as it gets.

cfleming18:10:53

@shaun-mahood Yes, you can create a Leiningen run configuration.

shaun-mahood19:10:00

Great, thanks! One more win for laziness.

cfleming19:10:26

@kenny I’ve fixed the source root outside of project root problem for the next EAP, so you should be good to do your boot magic when that drops.

cfleming19:10:08

@shaun-mahood I’ve actually considered integrating lein-ancient into Cursive, so you could just see the warnings in the IDE all the time, and perhaps fix them with a quickfix. I haven’t looked at what lein-ancient does in enough detail to know how feasible that is, though.

kenny19:10:53

@cfleming Perfect, thanks!

shaun-mahood20:10:06

@cfleming: That would be kind of cool, not sure how much effort it would be worth though - seems like a nice bit of polish if you have nothing else to do 🙂

cfleming21:10:50

@shaun-mahood Well, that might not be for a while 🙂. But I’m planning some lein support upgrades using IntelliJ’s repo indexes, so it might fit nicely with that.

puzzler21:10:23

Is there a way to move back and forth from editor to REPL with keystroke? Is there a way to disable that ESC moves from REPL to editor ? (sometimes when I use ESC to stop the auto-complete in the REPL, it moves me back to the editor when that's not what I want)

bfabry21:10:13

there is a keybinding for focus on repl, I use that. I haven't found an equivalent 'jump back to editor' binding

spieden22:10:43

anyone else having issues with reloading of transitive namespaces when using the “Sync files in REPL” action?

spieden22:10:05

it’s not happening for me anymore.. not sure why

spieden22:10:22

it will load the file that was changed, but not others that require it and are loaded in the REPL

cfleming23:10:59

@puzzler You can bind keys to jump to the editor and to the output pane, but there’s no way to disable ESC as the way to jump back. That’s a UI rule that is pretty hard and fast in IntelliJ, although it has some bad side effects (especially for Vim users).

cfleming23:10:59

The actions for REPL jumping are under Tools-&gt;REPL-&gt;Jump to REPL Editor and Tools-&gt;REPL-&gt;Jump to REPL Output Pane.

cfleming23:10:28

@spieden There’s a config item that controls that - have you unselected that somehow?

spieden23:10:43

hmm let me check

cfleming23:10:08

Settings-&gt;Languages &amp; Frameworks-&gt;Clojure-&gt;Load out-of-date dependencies transitively

cfleming23:10:28

Ok, no messages in your log?

spieden23:10:36

hmm, i do have that issue where lein deps can’t resolve due to the cred environment variables for my private repo not being used

cfleming23:10:42

Oh, one thing in your question - sync files in REPL will reload changed files in dependency order. It will not reload namespaces that depend on changed items, if they haven’t been changed themselves.

spieden23:10:44

maybe that’s leaking into general dep resolution

cfleming23:10:00

Oh, that was the env var issue, right?

spieden23:10:37

hmm, what does that setting control, then?

spieden23:10:52

"Load out-of-date dependencies transitively"

cfleming23:10:53

Load out of date etc?

cfleming23:10:17

So that one doesn’t actually do anything for “Sync files”, since that will load all changed files anyway.

cfleming23:10:41

However for “Load file in REPL” it controls whether that file’s modified deps are loaded first.

cfleming23:10:58

I’m open to opinions as to whether namespaces that depend on changed files should also be reloaded.

cfleming23:10:07

I actually have to step out a bit, sorry - back later.

spieden23:10:16

ah so if i go back and “Load file” in my core namespace that will pull in everything that changed?

spieden23:10:30

ok sure, ttyl

cfleming23:10:56

Only files that the file you’re loading depends on.

cfleming23:10:01

Not files that depend on it.

spieden23:10:44

for when you get back: my use case is modifying the code of a persistent service and wanting to test the changes. i expected “sync files” to go up the dependency tree from the file i modified and load everything back to the core namespace. then i stop/start the service to clear the stale bytecodes from memory and test my changes with the fresh ones

spieden23:10:40

if cursive could run a line of my choosing in the REPL after the sync this would be down to a single keystroke

spieden23:10:40

1) edit code 2) (for me) CMD+S 3) try changes in browser

spieden23:10:23

sounds like i can use “Load file” on my core ns to get most of the way there

spieden23:10:20

hmm, although trying it just now it doesn’t seem to hop over an unmodified file to reach a modified one during the traversal

spieden23:10:29

doesn’t seem to go to a depth greater than one either way actually(?)

puzzler23:10:29

@cfleming So is there a way to kill a auto-completion pop-up other than ESC?