Skip to content

Commit 66043bd

Browse files
committed
Merge branch 'next' into FixFunctionReturnValueNotUsedInspection
# Conflicts: # Rubberduck.Resources/Inspections/InspectionInfo.resx # Rubberduck.Resources/Inspections/InspectionNames.resx # Rubberduck.Resources/Inspections/InspectionResults.resx
2 parents 2384e28 + 60f6985 commit 66043bd

File tree

25 files changed

+263
-51
lines changed

25 files changed

+263
-51
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using Rubberduck.Inspections.Abstract;
4+
using Rubberduck.Parsing.VBA;
5+
using Rubberduck.Parsing.Inspections.Abstract;
6+
using Rubberduck.Inspections.Results;
7+
using Rubberduck.Parsing.Symbols;
8+
using Rubberduck.Resources.Inspections;
9+
10+
namespace Rubberduck.CodeAnalysis.Inspections.Concrete
11+
{
12+
public sealed class ImplicitlyTypedConstInspection : InspectionBase
13+
{
14+
public ImplicitlyTypedConstInspection(RubberduckParserState state)
15+
: base(state) { }
16+
17+
protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
18+
{
19+
var declarationFinder = State.DeclarationFinder;
20+
21+
var implicitlyTypedConsts = declarationFinder.UserDeclarations(DeclarationType.Constant)
22+
.Where(declaration => !declaration.IsTypeSpecified);
23+
24+
return implicitlyTypedConsts.Select(Result);
25+
}
26+
27+
private IInspectionResult Result(Declaration declaration)
28+
{
29+
var description = string.Format(InspectionResults.ImplicitlyTypedConstInspection, declaration.IdentifierName);
30+
31+
return new DeclarationInspectionResult(
32+
this,
33+
description,
34+
declaration);
35+
}
36+
}
37+
}

Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<Product>Rubberduck.CodeAnalysis</Product>
55
<Description>Assembly Containing the Code Analysis features exposed by Rubberduck</Description>

Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public SelfClosingPairHandler(ICodePaneHandler pane, SelfClosingPairCompletionSe
4040
public override bool Handle(AutoCompleteEventArgs e, AutoCompleteSettings settings, out CodeString result)
4141
{
4242
result = null;
43-
if (!_scpInputLookup.TryGetValue(e.Character, out var pair) && e.Character != '\b')
43+
if (!settings.SelfClosingPairs.IsEnabled || !_scpInputLookup.TryGetValue(e.Character, out var pair) && e.Character != '\b')
4444
{
4545
// not an interesting keypress.
4646
return false;

Rubberduck.Core/Rubberduck.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<RootNamespace>Rubberduck</RootNamespace>
55
<AssemblyName>Rubberduck.Core</AssemblyName>

Rubberduck.Deployment.Build/Rubberduck.Deployment.Build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<Product>Rubberduck.Deployment.Build</Product>
55
<Copyright>Copyright © 2018</Copyright>

Rubberduck.Deployment/Rubberduck.Deployment.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<Product>Rubberduck.Deployment</Product>
55
<Copyright>Copyright © 2018-2019</Copyright>

Rubberduck.Interaction/Rubberduck.Interaction.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<Copyright>Copyright © 2018-2019</Copyright>
55
<Product>Rubberduck.Interaction</Product>

Rubberduck.JunkDrawer/Rubberduck.JunkDrawer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<Title>Rubberduck.JunkDrawer</Title>
55
<Product>Rubberduck.JunkDrawer</Product>

Rubberduck.Main/Rubberduck.Main.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Sunburst.NET.Sdk.WPF/1.0.47">
2+
<Project Sdk="Sunburst.NET.Sdk.WPF.Patched/1.0.49">
33
<PropertyGroup>
44
<RootNamespace>Rubberduck</RootNamespace>
55
<AssemblyName>Rubberduck</AssemblyName>

Rubberduck.Parsing/Grammar/PartialExtensions/VBAParserPartialExtensions.cs

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public Interval IdentifierTokens
4747
{
4848
get
4949
{
50-
Interval tokenInterval;
51-
Identifier.GetName(this, out tokenInterval);
50+
Identifier.GetName(this, out Interval tokenInterval);
5251
return tokenInterval;
5352
}
5453
}
@@ -84,8 +83,7 @@ public Interval IdentifierTokens
8483
{
8584
get
8685
{
87-
Interval tokenInterval;
88-
Identifier.GetName(this, out tokenInterval);
86+
Identifier.GetName(this, out Interval tokenInterval);
8987
return tokenInterval;
9088
}
9189
}
@@ -122,8 +120,7 @@ public Interval IdentifierTokens
122120
{
123121
get
124122
{
125-
Interval tokenInterval;
126-
Identifier.GetName(this, out tokenInterval);
123+
Identifier.GetName(this, out Interval tokenInterval);
127124
return tokenInterval;
128125
}
129126
}
@@ -160,8 +157,7 @@ public Interval IdentifierTokens
160157
{
161158
get
162159
{
163-
Interval tokenInterval;
164-
Identifier.GetName(this, out tokenInterval);
160+
Identifier.GetName(this, out Interval tokenInterval);
165161
return tokenInterval;
166162
}
167163
}
@@ -198,8 +194,7 @@ public Interval IdentifierTokens
198194
{
199195
get
200196
{
201-
Interval tokenInterval;
202-
Identifier.GetName(this, out tokenInterval);
197+
Identifier.GetName(this, out Interval tokenInterval);
203198
return tokenInterval;
204199
}
205200
}
@@ -213,8 +208,7 @@ public Interval IdentifierTokens
213208
{
214209
get
215210
{
216-
Interval tokenInterval;
217-
Identifier.GetName(this, out tokenInterval);
211+
Identifier.GetName(this, out Interval tokenInterval);
218212
return tokenInterval;
219213
}
220214
}
@@ -249,8 +243,7 @@ public Interval IdentifierTokens
249243
{
250244
get
251245
{
252-
Interval tokenInterval;
253-
Identifier.GetName(this, out tokenInterval);
246+
Identifier.GetName(this, out Interval tokenInterval);
254247
return tokenInterval;
255248
}
256249
}
@@ -285,8 +278,7 @@ public Interval IdentifierTokens
285278
{
286279
get
287280
{
288-
Interval tokenInterval;
289-
Identifier.GetName(this, out tokenInterval);
281+
Identifier.GetName(this, out Interval tokenInterval);
290282
return tokenInterval;
291283
}
292284
}
@@ -321,8 +313,7 @@ public Interval IdentifierTokens
321313
{
322314
get
323315
{
324-
Interval tokenInterval;
325-
Identifier.GetName(this, out tokenInterval);
316+
Identifier.GetName(this, out Interval tokenInterval);
326317
return tokenInterval;
327318
}
328319
}
@@ -357,8 +348,7 @@ public Interval IdentifierTokens
357348
{
358349
get
359350
{
360-
Interval tokenInterval;
361-
Identifier.GetName(this, out tokenInterval);
351+
Identifier.GetName(this, out Interval tokenInterval);
362352
return tokenInterval;
363353
}
364354
}
@@ -393,8 +383,7 @@ public Interval IdentifierTokens
393383
{
394384
get
395385
{
396-
Interval tokenInterval;
397-
Identifier.GetName(this, out tokenInterval);
386+
Identifier.GetName(this, out Interval tokenInterval);
398387
return tokenInterval;
399388
}
400389
}
@@ -429,8 +418,7 @@ public Interval IdentifierTokens
429418
{
430419
get
431420
{
432-
Interval tokenInterval;
433-
Identifier.GetName(this, out tokenInterval);
421+
Identifier.GetName(this, out Interval tokenInterval);
434422
return tokenInterval;
435423
}
436424
}
@@ -465,8 +453,7 @@ public Interval IdentifierTokens
465453
{
466454
get
467455
{
468-
Interval tokenInterval;
469-
Identifier.GetName(this, out tokenInterval);
456+
Identifier.GetName(this, out Interval tokenInterval);
470457
return tokenInterval;
471458
}
472459
}
@@ -501,8 +488,7 @@ public Interval IdentifierTokens
501488
{
502489
get
503490
{
504-
Interval tokenInterval;
505-
Identifier.GetName(this, out tokenInterval);
491+
Identifier.GetName(this, out Interval tokenInterval);
506492
return tokenInterval;
507493
}
508494
}
@@ -537,8 +523,7 @@ public Interval IdentifierTokens
537523
{
538524
get
539525
{
540-
Interval tokenInterval;
541-
Identifier.GetName(this, out tokenInterval);
526+
Identifier.GetName(this, out Interval tokenInterval);
542527
return tokenInterval;
543528
}
544529
}
@@ -573,8 +558,7 @@ public Interval IdentifierTokens
573558
{
574559
get
575560
{
576-
Interval tokenInterval;
577-
Identifier.GetName(this, out tokenInterval);
561+
Identifier.GetName(this, out Interval tokenInterval);
578562
return tokenInterval;
579563
}
580564
}

0 commit comments

Comments
 (0)