Closed cursive-ide closed 6 years ago
Is this in Cursive? I was not able to reproduce with copy paste. Latest EAP of cursive, Parinfer enabled.
@sooheon Yes, it is. You'll have to be careful that IntelliJ doesn't reformat on copy/paste. Turn parinfer off (structural editing: none), then Editor->General->Smart Keys->Reformat on paste->None. Then paste the code from here, re-enable parinfer and reproduce.
Is there a way for Cursive to disable Parinfer, before applying this change, then reapply after?
I don't think it's feasible to continue accreting complexity to Parinfer for large edit chains like this.
That is actually a really great idea that I can't believe I hadn't thought of. Yes, I should be able to tag certain actions as not requiring parinfer to be run after. Any actions which I'm confident won't mess up the structure (i.e. the paredit ones, and things like intention actions) would work like this.
I have the following code. It's oddly (but legally) indented because it's an intermediate step in a refactor:
I then use paredit's raise operation to raise the
(-> ...)
, deleting the surrounding(then ... )
. I end up with:Note that the raise operation is a combination of two deletes from the original code:
(then
and)
, and then a bunch of whitespace manipulation to indent the resulting form. Here is the code to reproduce this in the sandbox:The set of edits looks reasonable to me, but the end result is clearly incorrect.