Skip to content

Commit c8e45f6

Browse files
authored
Merge pull request #2572 from MDoerner/DeclarationFinderForCustomDeclarations
CustomDeclarationLoaders now use finder on parser state
2 parents e8061aa + f2edd01 commit c8e45f6

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

Rubberduck.Parsing/Symbols/DeclarationLoaders/AliasDeclarations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public IReadOnlyList<Declaration> Load()
5656

5757
private IReadOnlyList<Declaration> AddAliasDeclarations()
5858
{
59-
var finder = new DeclarationFinder(_state.AllDeclarations, new IAnnotation[] { });
59+
var finder = _state.DeclarationFinder;;
6060

6161
if (WeHaveAlreadyLoadedTheDeclarationsBefore(finder))
6262
{

Rubberduck.Parsing/Symbols/DeclarationLoaders/DebugDeclarations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public DebugDeclarations(RubberduckParserState state)
1818

1919
public IReadOnlyList<Declaration> Load()
2020
{
21-
var finder = new DeclarationFinder(_state.AllDeclarations, new IAnnotation[] { });
21+
var finder = _state.DeclarationFinder;;
2222

2323
if (WeHaveAlreadyLoadedTheDeclarationsBefore(finder))
2424
{

Rubberduck.Parsing/Symbols/DeclarationLoaders/FormEventDeclarations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public IReadOnlyList<Declaration> Load()
2828

2929
private static Declaration FormsClassModuleFromParserState(RubberduckParserState state)
3030
{
31-
var finder = new DeclarationFinder(state.AllDeclarations, new IAnnotation[] { });
31+
var finder = state.DeclarationFinder;
3232

3333
var msForms = finder.FindProject("MSForms");
3434
if (msForms == null)

Rubberduck.Parsing/Symbols/DeclarationLoaders/SpecialFormDeclarations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public SpecialFormDeclarations(RubberduckParserState state)
1919

2020
public IReadOnlyList<Declaration> Load()
2121
{
22-
var finder = new DeclarationFinder(_state.AllDeclarations, new IAnnotation[] { });
22+
var finder = _state.DeclarationFinder;
2323

2424
if (WeHaveAlreadyLoadedTheDeclarationsBefore(finder))
2525
{

Rubberduck.Parsing/VBA/ParseCoordinator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ public void Parse(CancellationTokenSource token)
107107
}
108108

109109
SyncComReferences(State.Projects);
110+
State.RefreshFinder(_hostApp);
111+
110112
AddBuiltInDeclarations();
113+
State.RefreshFinder(_hostApp);
111114

112115
foreach (var component in components)
113116
{
@@ -229,7 +232,10 @@ private void ParseAll(object requestor, CancellationTokenSource token)
229232
}
230233

231234
SyncComReferences(State.Projects);
235+
State.RefreshFinder(_hostApp);
236+
232237
AddBuiltInDeclarations();
238+
State.RefreshFinder(_hostApp);
233239

234240
// invalidation cleanup should go into ParseAsync?
235241
foreach (var key in _componentAttributes.Keys)

0 commit comments

Comments
 (0)