File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
RetailCoder.VBE/Inspections Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
2
using System . Linq ;
3
+ using Rubberduck . Parsing . Grammar ;
3
4
using Rubberduck . Parsing . VBA ;
4
5
using Rubberduck . Parsing . Symbols ;
5
6
@@ -16,10 +17,27 @@ public SelfAssignedDeclarationInspection(RubberduckParserState state)
16
17
public override string Description { get { return InspectionsUI . SelfAssignedDeclarationInspectionResultFormat ; } }
17
18
public override CodeInspectionType InspectionType { get { return CodeInspectionType . CodeQualityIssues ; } }
18
19
20
+ private static readonly IEnumerable < string > ValueTypes = new [ ]
21
+ {
22
+ Tokens . Boolean ,
23
+ Tokens . Byte ,
24
+ Tokens . Currency ,
25
+ Tokens . Date ,
26
+ Tokens . Decimal ,
27
+ Tokens . Double ,
28
+ Tokens . Integer ,
29
+ Tokens . Long ,
30
+ Tokens . LongLong ,
31
+ Tokens . Single ,
32
+ Tokens . String
33
+ } ;
34
+
19
35
public override IEnumerable < InspectionResultBase > GetInspectionResults ( )
20
36
{
21
37
return UserDeclarations
22
38
. Where ( declaration => declaration . IsSelfAssigned
39
+ && declaration . IsTypeSpecified ( )
40
+ && ! ValueTypes . Contains ( declaration . AsTypeName )
23
41
&& declaration . DeclarationType == DeclarationType . Variable
24
42
&& declaration . ParentScope == declaration . QualifiedName . QualifiedModuleName . ToString ( )
25
43
&& declaration . ParentDeclaration != null
You can’t perform that action at this time.
0 commit comments