Skip to content

Commit 12f4f07

Browse files
committed
Merge remote-tracking branch 'upstream/next' into Issue5408_SettingsWindowAccessKeys
2 parents 8b4881f + e498d95 commit 12f4f07

File tree

804 files changed

+26436
-9695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

804 files changed

+26436
-9695
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<img alt="Rubberduck Open-Source VBE Add-In - VBA6 | VBA7 x86/x64 | VB6" src="https://user-images.githubusercontent.com/5751684/48656196-a507af80-e9ef-11e8-9c09-1ce3c619c019.png" />
2-
3-
<!-- campaign is no longer accepting donations
4-
### Donate!
52

6-
If you like this project and would like to thank its contributors, you are welcome to support our GoFundMe campaign to finance Rubberduck swag and international shipping - contributors will be getting t-shirts, mugs, and other cool things.
7-
8-
[![GoFundMe campaign](https://user-images.githubusercontent.com/5751684/29191799-e3d20b72-7dec-11e7-8ec6-0c69da4a3135.png)](https://www.gofundme.com/rubberduckvba)
9-
-->
3+
---
104

115
|Branch | Description | Build Status | Download link |
126
|------------|---|--------------|-|
@@ -20,9 +14,16 @@ If you like this project and would like to thank its contributors, you are welco
2014
[![Chat on stackexchange](https://img.shields.io/badge/chat-on%20stackexchange-blue.svg)](https://chat.stackexchange.com/rooms/14929/vba-rubberducking)
2115
[![License](https://img.shields.io/github/license/rubberduck-vba/Rubberduck.svg)](https://github.com/rubberduck-vba/Rubberduck/blob/next/LICENSE)
2216

17+
2318
> **[rubberduckvba.com](http://rubberduckvba.com)** | **[Rubberduck News](https://rubberduckvba.wordpress.com/)**
2419
| **[Twitter (@rubberduckvba)](https://twitter.com/rubberduckvba)** | **[Wiki](https://github.com/rubberduck-vba/Rubberduck/wiki)**
2520

21+
Rubberduck is free, but keeping it visible online isn't. Donate to help us pay for hosting and keep the blog free of ads!
22+
23+
|Donate|Note |
24+
|:------:|-|
25+
|<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=UY5K5X36B7T2S&currency_code=CAD&source=url"><img alt="Donate via PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"></a><p><sub>via PayPal</sub></p>|Donations in excess of what's needed to cover our fees will be donated to the <a href="https://mssociety.ca/">Multiple Sclerosis Society of Canada</a>.|
26+
2627
---
2728

2829
* [Attributions](https://github.com/rubberduck-vba/Rubberduck/blob/next/docs/Attributions.md)

Rubberduck.CodeAnalysis/Inspections/Abstract/ArgumentReferenceInspectionFromDeclarationsBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Rubberduck.Inspections.Abstract;
43
using Rubberduck.Parsing.Symbols;
54
using Rubberduck.Parsing.VBA;
65
using Rubberduck.Parsing.VBA.DeclarationCaching;
76

8-
namespace Rubberduck.Inspections.Inspections.Abstract
7+
namespace Rubberduck.CodeAnalysis.Inspections.Abstract
98
{
10-
public abstract class ArgumentReferenceInspectionFromDeclarationsBase : IdentifierReferenceInspectionFromDeclarationsBase
9+
internal abstract class ArgumentReferenceInspectionFromDeclarationsBase : IdentifierReferenceInspectionFromDeclarationsBase
1110
{
1211
protected ArgumentReferenceInspectionFromDeclarationsBase(RubberduckParserState state)
1312
: base(state) { }
@@ -32,10 +31,11 @@ protected override bool IsResultReference(IdentifierReference reference, Declara
3231
}
3332
}
3433

35-
public abstract class ArgumentReferenceInspectionFromDeclarationsBase<T> : IdentifierReferenceInspectionFromDeclarationsBase<T>
34+
internal abstract class ArgumentReferenceInspectionFromDeclarationsBase<T> : IdentifierReferenceInspectionFromDeclarationsBase<T>
3635
{
37-
protected ArgumentReferenceInspectionFromDeclarationsBase(RubberduckParserState state)
38-
: base(state) { }
36+
protected ArgumentReferenceInspectionFromDeclarationsBase(IDeclarationFinderProvider declarationFinderProvider)
37+
: base(declarationFinderProvider)
38+
{}
3939

4040
protected abstract (bool isResult, T properties) IsUnsuitableArgumentWithAdditionalProperties(ArgumentReference reference, DeclarationFinder finder);
4141

Rubberduck.CodeAnalysis/Inspections/Abstract/DeclarationInspectionBase.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Rubberduck.Inspections.Results;
4-
using Rubberduck.Parsing.Inspections.Abstract;
3+
using Rubberduck.CodeAnalysis.Inspections.Results;
54
using Rubberduck.Parsing.Symbols;
65
using Rubberduck.Parsing.VBA;
76
using Rubberduck.Parsing.VBA.DeclarationCaching;
87
using Rubberduck.VBEditor;
98

10-
namespace Rubberduck.Inspections.Abstract
9+
namespace Rubberduck.CodeAnalysis.Inspections.Abstract
1110
{
12-
public abstract class DeclarationInspectionBase : DeclarationInspectionBaseBase
11+
internal abstract class DeclarationInspectionBase : DeclarationInspectionBaseBase
1312
{
14-
protected DeclarationInspectionBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
15-
: base(state, relevantDeclarationTypes)
13+
protected DeclarationInspectionBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
14+
: base(declarationFinderProvider, relevantDeclarationTypes)
1615
{}
1716

18-
protected DeclarationInspectionBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
19-
: base(state, relevantDeclarationTypes, excludeDeclarationTypes)
17+
protected DeclarationInspectionBase(IDeclarationFinderProvider declarationFinderProvider, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
18+
: base(declarationFinderProvider, relevantDeclarationTypes, excludeDeclarationTypes)
2019
{}
2120

2221
protected abstract bool IsResultDeclaration(Declaration declaration, DeclarationFinder finder);
@@ -44,14 +43,14 @@ protected virtual IInspectionResult InspectionResult(Declaration declaration)
4443
}
4544
}
4645

47-
public abstract class DeclarationInspectionBase<T> : DeclarationInspectionBaseBase
46+
internal abstract class DeclarationInspectionBase<T> : DeclarationInspectionBaseBase
4847
{
49-
protected DeclarationInspectionBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
50-
: base(state, relevantDeclarationTypes)
48+
protected DeclarationInspectionBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
49+
: base(declarationFinderProvider, relevantDeclarationTypes)
5150
{}
5251

53-
protected DeclarationInspectionBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
54-
: base(state, relevantDeclarationTypes, excludeDeclarationTypes)
52+
protected DeclarationInspectionBase(IDeclarationFinderProvider declarationFinderProvider , DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
53+
: base(declarationFinderProvider, relevantDeclarationTypes, excludeDeclarationTypes)
5554
{}
5655

5756
protected abstract (bool isResult, T properties) IsResultDeclarationWithAdditionalProperties(Declaration declaration, DeclarationFinder finder);
Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,52 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Rubberduck.Parsing.Inspections.Abstract;
43
using Rubberduck.Parsing.Symbols;
54
using Rubberduck.Parsing.VBA;
65
using Rubberduck.Parsing.VBA.DeclarationCaching;
76
using Rubberduck.VBEditor;
87

9-
namespace Rubberduck.Inspections.Abstract
8+
namespace Rubberduck.CodeAnalysis.Inspections.Abstract
109
{
11-
public abstract class DeclarationInspectionBaseBase : InspectionBase
10+
/// <summary>
11+
/// This is a base class for the other declaration inspection base classes. It should not be implemented directly by concrete inspections.
12+
/// </summary>
13+
internal abstract class DeclarationInspectionBaseBase : InspectionBase
1214
{
13-
protected readonly DeclarationType[] RelevantDeclarationTypes;
14-
protected readonly DeclarationType[] ExcludeDeclarationTypes;
15+
private readonly DeclarationType[] _relevantDeclarationTypes;
16+
private readonly DeclarationType[] _excludeDeclarationTypes;
1517

16-
protected DeclarationInspectionBaseBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
17-
: base(state)
18+
protected DeclarationInspectionBaseBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
19+
: base(declarationFinderProvider)
1820
{
19-
RelevantDeclarationTypes = relevantDeclarationTypes;
20-
ExcludeDeclarationTypes = new DeclarationType[0];
21+
_relevantDeclarationTypes = relevantDeclarationTypes;
22+
_excludeDeclarationTypes = new DeclarationType[0];
2123
}
2224

23-
protected DeclarationInspectionBaseBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
24-
: base(state)
25+
protected DeclarationInspectionBaseBase(IDeclarationFinderProvider declarationFinderProvider, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
26+
: base(declarationFinderProvider)
2527
{
26-
RelevantDeclarationTypes = relevantDeclarationTypes;
27-
ExcludeDeclarationTypes = excludeDeclarationTypes;
28+
_relevantDeclarationTypes = relevantDeclarationTypes;
29+
_excludeDeclarationTypes = excludeDeclarationTypes;
2830
}
2931

30-
protected abstract IEnumerable<IInspectionResult> DoGetInspectionResults(QualifiedModuleName module, DeclarationFinder finder);
31-
32-
protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
32+
protected override IEnumerable<IInspectionResult> DoGetInspectionResults(DeclarationFinder finder)
3333
{
34-
var finder = DeclarationFinderProvider.DeclarationFinder;
35-
3634
return finder.UserDeclarations(DeclarationType.Module)
3735
.Concat(finder.UserDeclarations(DeclarationType.Project))
3836
.Where(declaration => declaration != null)
3937
.SelectMany(declaration => DoGetInspectionResults(declaration.QualifiedModuleName, finder))
4038
.ToList();
4139
}
4240

43-
protected virtual IEnumerable<IInspectionResult> DoGetInspectionResults(QualifiedModuleName module)
44-
{
45-
var finder = DeclarationFinderProvider.DeclarationFinder;
46-
return DoGetInspectionResults(module, finder);
47-
}
48-
4941
protected virtual IEnumerable<Declaration> RelevantDeclarationsInModule(QualifiedModuleName module, DeclarationFinder finder)
5042
{
51-
var potentiallyRelevantDeclarations = RelevantDeclarationTypes.Length == 0
43+
var potentiallyRelevantDeclarations = _relevantDeclarationTypes.Length == 0
5244
? finder.Members(module)
53-
: RelevantDeclarationTypes
45+
: _relevantDeclarationTypes
5446
.SelectMany(declarationType => finder.Members(module, declarationType))
5547
.Distinct();
5648
return potentiallyRelevantDeclarations
57-
.Where(declaration => !ExcludeDeclarationTypes.Contains(declaration.DeclarationType));
49+
.Where(declaration => !_excludeDeclarationTypes.Contains(declaration.DeclarationType));
5850
}
5951
}
6052
}

Rubberduck.CodeAnalysis/Inspections/Abstract/DeclarationInspectionMultiResultBase.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Rubberduck.Inspections.Results;
4-
using Rubberduck.Parsing.Inspections.Abstract;
3+
using Rubberduck.CodeAnalysis.Inspections.Results;
54
using Rubberduck.Parsing.Symbols;
65
using Rubberduck.Parsing.VBA;
76
using Rubberduck.Parsing.VBA.DeclarationCaching;
87
using Rubberduck.VBEditor;
98

10-
namespace Rubberduck.Inspections.Abstract
9+
namespace Rubberduck.CodeAnalysis.Inspections.Abstract
1110
{
12-
public abstract class DeclarationInspectionMultiResultBase<T> : DeclarationInspectionBaseBase
11+
internal abstract class DeclarationInspectionMultiResultBase<T> : DeclarationInspectionBaseBase
1312
{
14-
protected DeclarationInspectionMultiResultBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
15-
: base(state, relevantDeclarationTypes)
13+
protected DeclarationInspectionMultiResultBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
14+
: base(declarationFinderProvider, relevantDeclarationTypes)
1615
{}
1716

18-
protected DeclarationInspectionMultiResultBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
19-
: base(state, relevantDeclarationTypes, excludeDeclarationTypes)
17+
protected DeclarationInspectionMultiResultBase(IDeclarationFinderProvider declarationFinderProvider, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
18+
: base(declarationFinderProvider, relevantDeclarationTypes, excludeDeclarationTypes)
2019
{}
2120

2221
protected abstract IEnumerable<T> ResultProperties(Declaration declaration, DeclarationFinder finder);

Rubberduck.CodeAnalysis/Inspections/Abstract/DeclarationInspectionUsingGlobalInformationBase.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Rubberduck.Inspections.Results;
4-
using Rubberduck.Parsing.Inspections.Abstract;
3+
using Rubberduck.CodeAnalysis.Inspections.Results;
54
using Rubberduck.Parsing.Symbols;
65
using Rubberduck.Parsing.VBA;
76
using Rubberduck.Parsing.VBA.DeclarationCaching;
87
using Rubberduck.VBEditor;
98

10-
namespace Rubberduck.Inspections.Abstract
9+
namespace Rubberduck.CodeAnalysis.Inspections.Abstract
1110
{
12-
public abstract class DeclarationInspectionUsingGlobalInformationBase<TGlobalInfo> : DeclarationInspectionUsingGlobalInformationBaseBase<TGlobalInfo>
11+
internal abstract class DeclarationInspectionUsingGlobalInformationBase<TGlobalInfo> : DeclarationInspectionUsingGlobalInformationBaseBase<TGlobalInfo>
1312
{
14-
protected DeclarationInspectionUsingGlobalInformationBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
15-
: base(state, relevantDeclarationTypes)
13+
protected DeclarationInspectionUsingGlobalInformationBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
14+
: base(declarationFinderProvider, relevantDeclarationTypes)
1615
{}
1716

18-
protected DeclarationInspectionUsingGlobalInformationBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
19-
: base(state, relevantDeclarationTypes, excludeDeclarationTypes)
17+
protected DeclarationInspectionUsingGlobalInformationBase(IDeclarationFinderProvider declarationFinderProvider, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
18+
: base(declarationFinderProvider, relevantDeclarationTypes, excludeDeclarationTypes)
2019
{}
2120

2221
protected abstract bool IsResultDeclaration(Declaration declaration, DeclarationFinder finder, TGlobalInfo globalInfo);
@@ -44,14 +43,14 @@ protected virtual IInspectionResult InspectionResult(Declaration declaration)
4443
}
4544
}
4645

47-
public abstract class DeclarationInspectionUsingGlobalInformationBase<TGlobalInfo,TProperties> : DeclarationInspectionUsingGlobalInformationBaseBase<TGlobalInfo>
46+
internal abstract class DeclarationInspectionUsingGlobalInformationBase<TGlobalInfo,TProperties> : DeclarationInspectionUsingGlobalInformationBaseBase<TGlobalInfo>
4847
{
49-
protected DeclarationInspectionUsingGlobalInformationBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
50-
: base(state, relevantDeclarationTypes)
48+
protected DeclarationInspectionUsingGlobalInformationBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
49+
: base(declarationFinderProvider, relevantDeclarationTypes)
5150
{}
5251

53-
protected DeclarationInspectionUsingGlobalInformationBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
54-
: base(state, relevantDeclarationTypes, excludeDeclarationTypes)
52+
protected DeclarationInspectionUsingGlobalInformationBase(IDeclarationFinderProvider declarationFinderProvider, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
53+
: base(declarationFinderProvider, relevantDeclarationTypes, excludeDeclarationTypes)
5554
{}
5655

5756
protected abstract (bool isResult, TProperties properties) IsResultDeclarationWithAdditionalProperties(Declaration declaration, DeclarationFinder finder, TGlobalInfo globalInformation);

Rubberduck.CodeAnalysis/Inspections/Abstract/DeclarationInspectionUsingGlobalInformationBaseBase.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Rubberduck.Parsing.Inspections.Abstract;
43
using Rubberduck.Parsing.Symbols;
54
using Rubberduck.Parsing.VBA;
65
using Rubberduck.Parsing.VBA.DeclarationCaching;
76
using Rubberduck.VBEditor;
87

9-
namespace Rubberduck.Inspections.Abstract
8+
namespace Rubberduck.CodeAnalysis.Inspections.Abstract
109
{
11-
public abstract class DeclarationInspectionUsingGlobalInformationBaseBase<T> : InspectionBase
10+
internal abstract class DeclarationInspectionUsingGlobalInformationBaseBase<T> : InspectionBase
1211
{
1312
protected readonly DeclarationType[] RelevantDeclarationTypes;
1413
protected readonly DeclarationType[] ExcludeDeclarationTypes;
1514

16-
protected DeclarationInspectionUsingGlobalInformationBaseBase(RubberduckParserState state, params DeclarationType[] relevantDeclarationTypes)
17-
: base(state)
15+
protected DeclarationInspectionUsingGlobalInformationBaseBase(IDeclarationFinderProvider declarationFinderProvider, params DeclarationType[] relevantDeclarationTypes)
16+
: base(declarationFinderProvider)
1817
{
1918
RelevantDeclarationTypes = relevantDeclarationTypes;
2019
ExcludeDeclarationTypes = new DeclarationType[0];
2120
}
2221

23-
protected DeclarationInspectionUsingGlobalInformationBaseBase(RubberduckParserState state, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
24-
: base(state)
22+
protected DeclarationInspectionUsingGlobalInformationBaseBase(IDeclarationFinderProvider declarationFinderProvider, DeclarationType[] relevantDeclarationTypes, DeclarationType[] excludeDeclarationTypes)
23+
: base(declarationFinderProvider)
2524
{
2625
RelevantDeclarationTypes = relevantDeclarationTypes;
2726
ExcludeDeclarationTypes = excludeDeclarationTypes;
@@ -38,9 +37,8 @@ protected virtual T GlobalInformation(QualifiedModuleName module, DeclarationFin
3837
return GlobalInformation(finder);
3938
}
4039

41-
protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
40+
protected override IEnumerable<IInspectionResult> DoGetInspectionResults(DeclarationFinder finder)
4241
{
43-
var finder = DeclarationFinderProvider.DeclarationFinder;
4442
var globalInformation = GlobalInformation(finder);
4543

4644
return finder.UserDeclarations(DeclarationType.Module)
@@ -50,9 +48,8 @@ protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
5048
.ToList();
5149
}
5250

53-
protected virtual IEnumerable<IInspectionResult> DoGetInspectionResults(QualifiedModuleName module)
51+
protected override IEnumerable<IInspectionResult> DoGetInspectionResults(QualifiedModuleName module, DeclarationFinder finder)
5452
{
55-
var finder = DeclarationFinderProvider.DeclarationFinder;
5653
var globalInformation = GlobalInformation(module, finder);
5754
return DoGetInspectionResults(module, finder, globalInformation);
5855
}

0 commit comments

Comments
 (0)