Skip to content

Commit 6fde07e

Browse files
committed
added IInspection support
1 parent 7281f31 commit 6fde07e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Rubberduck.Parsing/Symbols/Declaration.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Collections.Generic;
1010
using System.Diagnostics;
1111
using System.Linq;
12+
using Rubberduck.Parsing.Inspections.Abstract;
1213
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
1314

1415
namespace Rubberduck.Parsing.Symbols
@@ -393,6 +394,16 @@ public void AddReference(
393394
annotations));
394395
}
395396

397+
private readonly ConcurrentBag<IInspectionResult> _inspectionResults
398+
= new ConcurrentBag<IInspectionResult>();
399+
400+
public IEnumerable<IInspectionResult> InspectionResults { get { return _inspectionResults; } }
401+
402+
public void Annotate(IInspectionResult inspectionResult)
403+
{
404+
_inspectionResults.Add(inspectionResult);
405+
}
406+
396407
private readonly Selection _selection;
397408
/// <summary>
398409
/// Gets a <c>Selection</c> representing the position of the declaration in the code module.

Rubberduck.Parsing/Symbols/IdentifierReference.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using System.Linq;
77
using System.Diagnostics;
88
using System;
9+
using System.Collections.Concurrent;
10+
using Rubberduck.Parsing.Inspections.Abstract;
911

1012
namespace Rubberduck.Parsing.Symbols
1113
{
@@ -45,6 +47,16 @@ public IdentifierReference(
4547
private readonly Selection _selection;
4648
public Selection Selection { get { return _selection; } }
4749

50+
private readonly ConcurrentBag<IInspectionResult> _inspectionResults
51+
= new ConcurrentBag<IInspectionResult>();
52+
53+
public IEnumerable<IInspectionResult> InspectionResults { get { return _inspectionResults; } }
54+
55+
public void Annotate(IInspectionResult inspectionResult)
56+
{
57+
_inspectionResults.Add(inspectionResult);
58+
}
59+
4860
private readonly Declaration _parentScopingDeclaration;
4961
/// <summary>
5062
/// Gets the scoping <see cref="Declaration"/> that contains this identifier reference,

0 commit comments

Comments
 (0)