-
Notifications
You must be signed in to change notification settings - Fork 842
Description
"Variable" might be the wrong name, but you get the picture.
Given the following code:
<code before>
let bar = foo |> doSomething param1 param2 param3 |> thenSomethingElse
<code after>I frequently want to hightlight any valid sub-expression, say doSomething param1 param2 param3, and press a keyboard shortcut to get this:
<code before>
let curried = doSomething param1 param2 param3
let bar = foo |> curried |> thenSomethingElse
<code after>Naturally, upon execution, this refactor will end up in a rename operation on the name of the extracted value so that I can pick one myself.
I realize also that some decision will need to be taken if you try to extract something from a one-liner, e.g.
let foo = somethingToExtract somethingElsemight become
let foo =
let bar = somethingToExtract
bar somethingElseFurthermore, I frequently have need for the exact opposite: Place the caret on a variable name and use a hypothetical "inline variable" refactoring to inline the definition everywhere it's used.
In sum, these are probably the refactorings I miss the most when working in F#.