Skip to content

Commit 68c2b0e

Browse files
committed
Pull and fix merge conflict
2 parents 23a5a4b + 6b0c56a commit 68c2b0e

File tree

5 files changed

+4
-53
lines changed

5 files changed

+4
-53
lines changed

RetailCoder.VBE/Refactorings/Rename/RenamePresenter.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private void RenameDeclaration()
251251
else
252252
{
253253
var members = _declarations[_view.Target.IdentifierName]
254-
.Where(item => item.Project == _view.Target.Project
254+
.Where(item => item.Project == _view.Target.Project
255255
&& item.ComponentName == _view.Target.ComponentName
256256
&& item.DeclarationType.HasFlag(DeclarationType.Property));
257257

@@ -372,13 +372,8 @@ private void RenameUsages(Declaration target, string interfaceName = null)
372372

373373
private string GetReplacementLine(string content, string newName, Selection selection)
374374
{
375-
// until we figure out how to replace actual tokens,
376-
// this is going to have to be done the ugly way...
377-
378-
// todo: come back after the identifier references are fixed
379375
var contentWithoutOldName = content.Remove(selection.StartColumn - 1, selection.EndColumn - selection.StartColumn);
380376
return contentWithoutOldName.Insert(selection.StartColumn - 1, newName);
381-
//return Regex.Replace(content, "\\b" + target + "\\b", newName);
382377
}
383378

384379
private string GetReplacementLine(CodeModule module, Declaration target, string newName)
@@ -412,8 +407,8 @@ private string GetReplacementLine(CodeModule module, Declaration target, string
412407
var functionStmtContext = context as VBAParser.FunctionStmtContext;
413408
if (functionStmtContext != null)
414409
{
415-
lastTokenIndex = functionStmtContext.asTypeClause() != null
416-
? functionStmtContext.asTypeClause().Stop.TokenIndex
410+
lastTokenIndex = functionStmtContext.asTypeClause() != null
411+
? functionStmtContext.asTypeClause().Stop.TokenIndex
417412
: functionStmtContext.argList().RPAREN().Symbol.TokenIndex;
418413
}
419414

@@ -475,7 +470,7 @@ private void AcquireTarget(out Declaration target, QualifiedSelection selection)
475470
{
476471
target = _declarations.Items
477472
.Where(item => !item.IsBuiltIn && item.DeclarationType != DeclarationType.ModuleOption)
478-
.FirstOrDefault(item => IsSelectedDeclaration(selection, item)
473+
.FirstOrDefault(item => IsSelectedDeclaration(selection, item)
479474
|| IsSelectedReference(selection, item));
480475

481476
PromptIfTargetImplementsInterface(ref target);

Rubberduck.Parsing/Rubberduck.Parsing.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
<Compile Include="Grammar\VBAVisitor.cs" />
6767
<Compile Include="IParseResultProvider.cs" />
6868
<Compile Include="IRubberduckParser.cs" />
69-
<Compile Include="Symbols\InterfaceImplementationListener.cs" />
7069
<Compile Include="Symbols\ExceptionErrorListener.cs" />
7170
<Compile Include="Symbols\IdentifierReferenceResolver.cs" />
7271
<Compile Include="Symbols\SyntaxErrorException.cs" />

Rubberduck.Parsing/Symbols/IdentifierReferenceResolver.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Text;
54
using Antlr4.Runtime;
65
using Rubberduck.Parsing.Grammar;
76
using Rubberduck.VBEditor;

Rubberduck.Parsing/Symbols/InterfaceImplementationListener.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

Rubberduck.Parsing/VBProjectParseResult.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,6 @@ private void OnProgress(VBComponentParseResult result)
4545

4646
public void Resolve()
4747
{
48-
// make a first pass to identify all interface implementations - resolver needs this to disembiguate members.
49-
//foreach (var componentParseResult in _parseResults)
50-
//{
51-
// try
52-
// {
53-
// var resolver = new IdentifierReferenceResolver(componentParseResult.QualifiedName, _declarations);
54-
// var listener = new InterfaceImplementationListener(resolver);
55-
// var walker = new ParseTreeWalker();
56-
// walker.Walk(listener, componentParseResult.ParseTree);
57-
// }
58-
// catch (WalkerCancelledException)
59-
// {
60-
// // exception is purposely thrown when walker exits the module's declarations section.
61-
// }
62-
//}
63-
64-
// second pass; resolve all identifier usages
6548
foreach (var componentParseResult in _parseResults)
6649
{
6750
OnProgress(componentParseResult);

0 commit comments

Comments
 (0)