Skip to content

Commit 4594df1

Browse files
committed
Moved StepIsNotSpecifiedInspection and StepOneIsRedundantInspection to .settings file
1 parent b1d96ff commit 4594df1

File tree

7 files changed

+53
-41
lines changed

7 files changed

+53
-41
lines changed

RetailCoder.VBE/Properties/Settings.Designer.cs

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/Properties/Settings.settings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@
260260
<CodeInspection Name="VariableTypeNotDeclaredInspection" Severity="Warning" InspectionType="LanguageOpportunities" />
261261
<CodeInspection Name="WriteOnlyPropertyInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" />
262262
<CodeInspection Name="DefTypeStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" />
263+
<CodeInspection Name="StepIsNotSpecifiedInspection" Severity="DoNotShow" InspectionType="LanguageOpportunities" />
264+
<CodeInspection Name="StepOneIsRedundantInspection" Severity="Hint" InspectionType="LanguageOpportunities" />
263265
</CodeInspections>
264266
<WhitelistedIdentifiers />
265267
<RunInspectionsOnSuccessfulParse>true</RunInspectionsOnSuccessfulParse>

RetailCoder.VBE/app.config

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
<Rubberduck.Properties.Settings>
1818
<setting name="DefaultHotkey_CodePaneRefactorRenameCommand" serializeAs="Xml">
1919
<value>
20-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
20+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
2122
<Key1>R</Key1>
2223
<IsEnabled>true</IsEnabled>
2324
<HasShiftModifier>true</HasShiftModifier>
@@ -27,9 +28,11 @@
2728
</HotkeySetting>
2829
</value>
2930
</setting>
30-
<setting name="DefaultHotkey_RefactorEncapsulateFieldCommand" serializeAs="Xml">
31+
<setting name="DefaultHotkey_RefactorEncapsulateFieldCommand"
32+
serializeAs="Xml">
3133
<value>
32-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
34+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
35+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3336
<Key1>F</Key1>
3437
<IsEnabled>true</IsEnabled>
3538
<HasShiftModifier>true</HasShiftModifier>
@@ -41,7 +44,8 @@
4144
</setting>
4245
<setting name="DefaultHotkey_RefactorExtractMethodCommand" serializeAs="Xml">
4346
<value>
44-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
47+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
4549
<Key1>M</Key1>
4650
<IsEnabled>true</IsEnabled>
4751
<HasShiftModifier>true</HasShiftModifier>
@@ -51,9 +55,11 @@
5155
</HotkeySetting>
5256
</value>
5357
</setting>
54-
<setting name="DefaultHotkey_RefactorMoveCloserToUsageCommand" serializeAs="Xml">
58+
<setting name="DefaultHotkey_RefactorMoveCloserToUsageCommand"
59+
serializeAs="Xml">
5560
<value>
56-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
61+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
62+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
5763
<Key1>C</Key1>
5864
<IsEnabled>true</IsEnabled>
5965
<HasShiftModifier>true</HasShiftModifier>
@@ -65,7 +71,8 @@
6571
</setting>
6672
<setting name="DefaultHotkey_CodeExplorerCommand" serializeAs="Xml">
6773
<value>
68-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
74+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
75+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
6976
<Key1>R</Key1>
7077
<IsEnabled>true</IsEnabled>
7178
<HasShiftModifier>false</HasShiftModifier>
@@ -77,7 +84,8 @@
7784
</setting>
7885
<setting name="DefaultHotkey_ExportAllCommand" serializeAs="Xml">
7986
<value>
80-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
87+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
88+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
8189
<Key1>E</Key1>
8290
<IsEnabled>true</IsEnabled>
8391
<HasShiftModifier>true</HasShiftModifier>
@@ -89,7 +97,8 @@
8997
</setting>
9098
<setting name="DefaultHotkey_FindSymbolCommand" serializeAs="Xml">
9199
<value>
92-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
100+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
101+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
93102
<Key1>T</Key1>
94103
<IsEnabled>true</IsEnabled>
95104
<HasShiftModifier>false</HasShiftModifier>
@@ -101,7 +110,8 @@
101110
</setting>
102111
<setting name="DefaultHotkey_IndentCurrentModuleCommand" serializeAs="Xml">
103112
<value>
104-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
113+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
114+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
105115
<Key1>M</Key1>
106116
<IsEnabled>true</IsEnabled>
107117
<HasShiftModifier>false</HasShiftModifier>
@@ -113,7 +123,8 @@
113123
</setting>
114124
<setting name="DefaultHotkey_IndentCurrentProcedureCommand" serializeAs="Xml">
115125
<value>
116-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
126+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
127+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
117128
<Key1>P</Key1>
118129
<IsEnabled>true</IsEnabled>
119130
<HasShiftModifier>false</HasShiftModifier>
@@ -125,7 +136,8 @@
125136
</setting>
126137
<setting name="DefaultHotkey_InspectionResultsCommand" serializeAs="Xml">
127138
<value>
128-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
139+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
140+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
129141
<Key1>I</Key1>
130142
<IsEnabled>true</IsEnabled>
131143
<HasShiftModifier>true</HasShiftModifier>
@@ -137,7 +149,8 @@
137149
</setting>
138150
<setting name="DefaultHotkey_ReparseCommand" serializeAs="Xml">
139151
<value>
140-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
152+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
153+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
141154
<Key1>`</Key1>
142155
<IsEnabled>true</IsEnabled>
143156
<HasShiftModifier>false</HasShiftModifier>
@@ -149,7 +162,8 @@
149162
</setting>
150163
<setting name="DefaultHotkey_SourceControlCommand" serializeAs="Xml">
151164
<value>
152-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
165+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
166+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
153167
<Key1>D6</Key1>
154168
<IsEnabled>true</IsEnabled>
155169
<HasShiftModifier>true</HasShiftModifier>
@@ -161,7 +175,8 @@
161175
</setting>
162176
<setting name="DefaultHotkey_TestExplorerCommand" serializeAs="Xml">
163177
<value>
164-
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
178+
<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
179+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
165180
<Key1>T</Key1>
166181
<IsEnabled>true</IsEnabled>
167182
<HasShiftModifier>true</HasShiftModifier>
@@ -361,6 +376,10 @@
361376
InspectionType="CodeQualityIssues" />
362377
<CodeInspection Name="DefTypeStatementInspection" Severity="Suggestion"
363378
InspectionType="LanguageOpportunities" />
379+
<CodeInspection Name="StepIsNotSpecifiedInspection" Severity="DoNotShow"
380+
InspectionType="LanguageOpportunities" />
381+
<CodeInspection Name="StepOneIsRedundantInspection" Severity="Hint"
382+
InspectionType="LanguageOpportunities" />
364383
</CodeInspections>
365384
<WhitelistedIdentifiers />
366385
<RunInspectionsOnSuccessfulParse>true</RunInspectionsOnSuccessfulParse>

Rubberduck.Inspections/Concrete/StepIsNotSpecifiedInspection.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Rubberduck.Inspections.Abstract;
2-
using System;
32
using System.Collections.Generic;
43
using System.Linq;
54
using Rubberduck.Parsing.Inspections.Abstract;
@@ -17,9 +16,7 @@ namespace Rubberduck.Inspections.Concrete
1716
{
1817
public sealed class StepIsNotSpecifiedInspection : ParseTreeInspectionBase
1918
{
20-
public StepIsNotSpecifiedInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.DoNotShow) { }
21-
22-
public override CodeInspectionType InspectionType => CodeInspectionType.LanguageOpportunities;
19+
public StepIsNotSpecifiedInspection(RubberduckParserState state) : base(state) { }
2320

2421
protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
2522
{
@@ -50,7 +47,7 @@ public void ClearContexts()
5047
_contexts.Clear();
5148
}
5249

53-
public override void EnterForNextStmt([NotNull] VBAParser.ForNextStmtContext context)
50+
public override void EnterForNextStmt([NotNull] ForNextStmtContext context)
5451
{
5552
StepStmtContext stepStatement = context.stepStmt();
5653

Rubberduck.Inspections/Concrete/StepOneIsRedundantInspection.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Rubberduck.Inspections.Abstract;
2-
using System;
32
using System.Collections.Generic;
43
using System.Linq;
54
using Rubberduck.Parsing.Inspections.Abstract;
@@ -17,9 +16,7 @@ namespace Rubberduck.Inspections.Concrete
1716
{
1817
public sealed class StepOneIsRedundantInspection : ParseTreeInspectionBase
1918
{
20-
public StepOneIsRedundantInspection(RubberduckParserState state) : base(state, CodeInspectionSeverity.Hint) { }
21-
22-
public override CodeInspectionType InspectionType => CodeInspectionType.LanguageOpportunities;
19+
public StepOneIsRedundantInspection(RubberduckParserState state) : base(state) { }
2320

2421
protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
2522
{
@@ -50,7 +47,7 @@ public void ClearContexts()
5047
_contexts.Clear();
5148
}
5249

53-
public override void EnterForNextStmt([NotNull] VBAParser.ForNextStmtContext context)
50+
public override void EnterForNextStmt([NotNull] ForNextStmtContext context)
5451
{
5552
StepStmtContext stepStatement = context.stepStmt();
5653

Rubberduck.Inspections/QuickFixes/AddStepOneQuickFix.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
using Antlr4.Runtime;
2-
using Antlr4.Runtime.Tree;
3-
using Rubberduck.Inspections.Abstract;
1+
using Rubberduck.Inspections.Abstract;
42
using Rubberduck.Inspections.Concrete;
53
using Rubberduck.Parsing.Inspections.Abstract;
64
using Rubberduck.Parsing.Inspections.Resources;
75
using Rubberduck.Parsing.Rewriter;
86
using Rubberduck.Parsing.VBA;
97
using System;
10-
using System.Collections.Generic;
11-
using System.Linq;
12-
using System.Text;
13-
using System.Threading.Tasks;
148
using static Rubberduck.Parsing.Grammar.VBAParser;
159

1610
namespace Rubberduck.Inspections.QuickFixes
@@ -25,11 +19,11 @@ public AddStepOneQuickFix(RubberduckParserState state)
2519
_state = state;
2620
}
2721

28-
public override bool CanFixInProcedure => false;
22+
public override bool CanFixInProcedure => true;
2923

30-
public override bool CanFixInModule => false;
24+
public override bool CanFixInModule => true;
3125

32-
public override bool CanFixInProject => false;
26+
public override bool CanFixInProject => true;
3327

3428
public override string Description(IInspectionResult result)
3529
{

Rubberduck.Inspections/QuickFixes/RemoveStepOneQuickFix.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public RemoveStepOneQuickFix(RubberduckParserState state)
1717
_state = state;
1818
}
1919

20-
public override bool CanFixInProcedure => false;
20+
public override bool CanFixInProcedure => true;
2121

22-
public override bool CanFixInModule => false;
22+
public override bool CanFixInModule => true;
2323

24-
public override bool CanFixInProject => false;
24+
public override bool CanFixInProject => true;
2525

2626
public override string Description(IInspectionResult result)
2727
{

0 commit comments

Comments
 (0)