Skip to content

Commit

Permalink
Correctly check param-not-used for events and library procedures/func…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
Hosch250 committed Jun 6, 2016
1 parent f39821b commit 3f7c3cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions RetailCoder.VBE/Inspections/ParameterNotUsedInspection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public override IEnumerable<InspectionResultBase> GetInspectionResults()
var builtInHandlers = declarations.FindBuiltInEventHandlers();

var parameters = declarations.Where(parameter => parameter.DeclarationType == DeclarationType.Parameter
&& !(parameter.Context.Parent.Parent is VBAParser.EventStmtContext)
&& !(parameter.Context.Parent.Parent is VBAParser.DeclareStmtContext));
&& parameter.ParentDeclaration.DeclarationType != DeclarationType.Event
&& parameter.ParentDeclaration.DeclarationType != DeclarationType.LibraryFunction
&& parameter.ParentDeclaration.DeclarationType != DeclarationType.LibraryProcedure);

var unused = parameters.Where(parameter => !parameter.References.Any()).ToList();
var quickFixRefactoring =
Expand Down

0 comments on commit 3f7c3cd

Please sign in to comment.