Skip to content

Commit df501ae

Browse files
committed
Finish fixing regex rename
1 parent 1362531 commit df501ae

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

RetailCoder.VBE/Refactorings/Rename/RenamePresenter.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ private void RenameControl()
276276
var module = handler.Project.VBComponents.Item(handler.ComponentName).CodeModule;
277277

278278
var content = module.Lines[handler.Selection.StartLine, 1];
279-
var newContent = GetReplacementLine(content, handler.IdentifierName, newMemberName, handler.Selection);
279+
var newContent = GetReplacementLine(content, newMemberName, handler.Selection);
280280
module.ReplaceLine(handler.Selection.StartLine, newContent);
281281
}
282282

@@ -308,7 +308,7 @@ private void RenameUsages(Declaration target, string interfaceName = null)
308308
var module = member.Project.VBComponents.Item(member.ComponentName).CodeModule;
309309

310310
var content = module.Lines[member.Selection.StartLine, 1];
311-
var newContent = GetReplacementLine(content, member.IdentifierName, newMemberName, member.Selection);
311+
var newContent = GetReplacementLine(content, newMemberName, member.Selection);
312312
module.ReplaceLine(member.Selection.StartLine, newContent);
313313
RenameUsages(member, target.ComponentName);
314314
}
@@ -334,12 +334,12 @@ private void RenameUsages(Declaration target, string interfaceName = null)
334334

335335
if (interfaceName == null)
336336
{
337-
newContent = GetReplacementLine(content, target.IdentifierName, _view.NewName,
337+
newContent = GetReplacementLine(content, _view.NewName,
338338
reference.Selection);
339339
}
340340
else
341341
{
342-
newContent = GetReplacementLine(content, target.IdentifierName,
342+
newContent = GetReplacementLine(content,
343343
interfaceName + "_" + _view.NewName,
344344
reference.Selection);
345345
}
@@ -363,14 +363,14 @@ private void RenameUsages(Declaration target, string interfaceName = null)
363363
}
364364

365365
var content = module.Lines[method.Selection.StartLine, 1];
366-
var newContent = GetReplacementLine(content, oldMemberName, newMemberName, member.Selection);
366+
var newContent = GetReplacementLine(content, newMemberName, member.Selection);
367367
module.ReplaceLine(method.Selection.StartLine, newContent);
368368
}
369369
}
370370
}
371371
}
372372

373-
private string GetReplacementLine(string content, string target, string newName, Selection selection)
373+
private string GetReplacementLine(string content, string newName, Selection selection)
374374
{
375375
// until we figure out how to replace actual tokens,
376376
// this is going to have to be done the ugly way...
@@ -459,7 +459,7 @@ private string GetReplacementLine(CodeModule module, Declaration target, string
459459

460460
return rewriter.GetText(new Interval(firstTokenIndex, lastTokenIndex));
461461
}
462-
return GetReplacementLine(content, target.IdentifierName, newName, target.Selection);
462+
return GetReplacementLine(content, newName, target.Selection);
463463
}
464464

465465
private static readonly DeclarationType[] ProcedureDeclarationTypes =

0 commit comments

Comments
 (0)