Skip to content

Commit 72a53d3

Browse files
authored
Merge pull request #3416 from Vogel612/tech-debt
Removed obsolete `DeclarationType.ModuleOption`, fixed bug with cleanup of `VBProjects` event handlers.
2 parents ab17635 + ce69be2 commit 72a53d3

File tree

9 files changed

+6
-15
lines changed

9 files changed

+6
-15
lines changed

RetailCoder.VBE/API/VBA/Declaration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ internal Declaration(RubberduckDeclaration declaration)
5656
{ Parsing.Symbols.DeclarationType.Control, DeclarationType.Control },
5757
{ Parsing.Symbols.DeclarationType.UserForm, DeclarationType.UserForm },
5858
{ Parsing.Symbols.DeclarationType.Document, DeclarationType.Document },
59-
{ Parsing.Symbols.DeclarationType.ModuleOption, DeclarationType.ModuleOption },
6059
{ Parsing.Symbols.DeclarationType.Procedure, DeclarationType.Procedure },
6160
{ Parsing.Symbols.DeclarationType.Function, DeclarationType.Function },
6261
{ Parsing.Symbols.DeclarationType.PropertyGet, DeclarationType.PropertyGet },

RetailCoder.VBE/API/VBA/DeclarationType.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public enum DeclarationType
1212
Control, //= 1 << 3,
1313
UserForm,// = 1 << 4,
1414
Document,// = 1 << 5,
15-
ModuleOption,// = 1 << 6,
1615
Procedure, //= 1 << 8,
1716
Function,// = 1 << 9,
1817
PropertyGet,// = 1 << 11,

RetailCoder.VBE/Refactorings/Rename/RenameModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public RenameModel(IVBE vbe, RubberduckParserState state, QualifiedSelection sel
4040
private void AcquireTarget(out Declaration target, QualifiedSelection selection)
4141
{
4242
target = _declarations
43-
.Where(item => item.IsUserDefined && item.DeclarationType != DeclarationType.ModuleOption)
43+
.Where(item => item.IsUserDefined)
4444
.FirstOrDefault(item => item.IsSelected(selection) || item.References.Any(r => r.IsSelected(selection)));
4545
}
4646
}

RetailCoder.VBE/UI/FindSymbol/FindSymbolViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public class FindSymbolViewModel : INotifyPropertyChanged
1414
{
1515
private static readonly DeclarationType[] ExcludedTypes =
1616
{
17-
DeclarationType.Control,
18-
DeclarationType.ModuleOption,
17+
DeclarationType.Control,
1918
DeclarationType.Project
2019
};
2120

Rubberduck.Inspections/Concrete/UseMeaningfulNameInspection.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public UseMeaningfulNameInspection(RubberduckParserState state, IPersistanceServ
3232

3333
private static readonly DeclarationType[] IgnoreDeclarationTypes =
3434
{
35-
DeclarationType.ModuleOption,
3635
DeclarationType.BracketedExpression,
3736
DeclarationType.LibraryFunction,
3837
DeclarationType.LibraryProcedure,

Rubberduck.Parsing/Symbols/Declaration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ internal set
467467
DeclarationType.LibraryProcedure,
468468
DeclarationType.LineLabel,
469469
DeclarationType.ProceduralModule,
470-
DeclarationType.ModuleOption,
471470
DeclarationType.Project,
472471
DeclarationType.Procedure,
473472
DeclarationType.PropertyGet,

Rubberduck.Parsing/Symbols/DeclarationFinder.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,7 @@ public Declaration FindSelectedDeclaration(ICodePane activeCodePane)
315315
return ModuleDeclaration(qualifiedSelection.Value.QualifiedName);
316316

317317
case 1:
318-
var match = matches.Single();
319-
return match.DeclarationType == DeclarationType.ModuleOption
320-
? match.ParentScopeDeclaration
321-
: match;
318+
return matches.Single();
322319

323320
default:
324321
// they're sorted by type, so a local comes before the procedure it's in

Rubberduck.Parsing/Symbols/DeclarationType.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public enum DeclarationType
1313
ClassModule = 1 << 3 | Module,
1414
UserForm = 1 << 4 | ClassModule,
1515
Document = 1 << 5 | ClassModule,
16-
ModuleOption = 1 << 6,
1716
Member = 1 << 7,
1817
Procedure = 1 << 8 | Member,
1918
Function = 1 << 9 | Member,

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ private void AddEventHandlers()
119119

120120
private void RemoveEventHandlers()
121121
{
122-
VBProjects.ProjectAdded += Sinks_ProjectAdded;
123-
VBProjects.ProjectRemoved += Sinks_ProjectRemoved;
124-
VBProjects.ProjectRenamed += Sinks_ProjectRenamed;
122+
VBProjects.ProjectAdded -= Sinks_ProjectAdded;
123+
VBProjects.ProjectRemoved -= Sinks_ProjectRemoved;
124+
VBProjects.ProjectRenamed -= Sinks_ProjectRenamed;
125125
VBComponents.ComponentAdded -= Sinks_ComponentAdded;
126126
VBComponents.ComponentRemoved -= Sinks_ComponentRemoved;
127127
VBComponents.ComponentRenamed -= Sinks_ComponentRenamed;

0 commit comments

Comments
 (0)