Fork me on GitHub

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


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


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


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.


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.


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.


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


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


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.


Cool. Thanks for the update!


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.


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


Great, thanks! One more win for laziness.


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


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


@cfleming Perfect, thanks!


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


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


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)


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


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


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


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


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


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.


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


hmm let me check


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


Ok, no messages in your log?


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


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.


maybe that’s leaking into general dep resolution


Oh, that was the env var issue, right?


hmm, what does that setting control, then?


"Load out-of-date dependencies transitively"


Load out of date etc?


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


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


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


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


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


ok sure, ttyl


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


Not files that depend on it.


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


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


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


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


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


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


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