- I have to press Ctrl+Z multiple times to undo "Extract Method"
- selected comments are deleted instead of moved to the new method
- I think extracted methods shouldn't be public by default
- When the whitespace at the start line is not included in the selection, the created method call is indented incorrectly
In this code:
static Instruction GetRealJumpTarget(Instruction instr)
{
if (instr == null)
return null;
// use hashset to ensure the loop stops even if analysing an infinite loop
HashSet<Instruction> hashset = new HashSet<Instruction>();
while (instr.OpCode == OpCode.Jump && hashset.Add(instr))
instr = instr.JumpTarget;
return instr;
}
- Extracting the loop: the created "instr" parameter should be a ref parameter because it's written to in the extracted code
- the loop body is not indented correctly (CSharpOutputVisitor bug?)
In this code:
public static void Run(Function function)
{
// eliminate jumps to unconditional jumps
foreach (Instruction instr in function.IntermediateCode)
instr.JumpTarget = GetRealJumpTarget(instr.JumpTarget);
}
Try to extract the loop body. The refactoring should generate a parameter "instr", but it's missing.