File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
RetailCoder.VBE/Inspections
RubberduckTests/Inspections Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 5
5
using System . Threading ;
6
6
using System . Threading . Tasks ;
7
7
using Antlr4 . Runtime . Tree ;
8
+ using NLog ;
8
9
using Rubberduck . Parsing ;
9
10
using Rubberduck . Parsing . Grammar ;
10
11
using Rubberduck . Parsing . VBA ;
@@ -82,7 +83,14 @@ public async Task<IEnumerable<ICodeInspectionResult>> FindIssuesAsync(Rubberduck
82
83
}
83
84
} , token ) ) . ToList ( ) ;
84
85
85
- await Task . WhenAll ( inspections ) ;
86
+ try
87
+ {
88
+ await Task . WhenAll ( inspections ) ;
89
+ }
90
+ catch ( Exception e )
91
+ {
92
+ LogManager . GetCurrentClassLogger ( ) . Error ( e ) ;
93
+ }
86
94
state . OnStatusMessageUpdate ( RubberduckUI . ResourceManager . GetString ( "ParserState_" + state . Status , UI . Settings . Settings . Culture ) ) ; // should be "Ready"
87
95
return allIssues ;
88
96
}
Original file line number Diff line number Diff line change
1
+ using System ;
1
2
using System . Collections . Generic ;
2
3
using System . Linq ;
3
4
using Rubberduck . Common ;
@@ -68,6 +69,7 @@ private IEnumerable<ParameterCanBeByValInspectionResult> GetResults(List<Declara
68
69
. ThenBy ( t => t . Selection . StartColumn )
69
70
. ToList ( ) ;
70
71
72
+ if ( ! declarationParameters . Any ( ) ) { continue ; }
71
73
var parametersAreByRef = declarationParameters . Select ( s => true ) . ToList ( ) ;
72
74
73
75
var members = declarationMembers . Any ( a => a . DeclarationType == DeclarationType . Event )
@@ -85,9 +87,10 @@ private IEnumerable<ParameterCanBeByValInspectionResult> GetResults(List<Declara
85
87
86
88
for ( var i = 0 ; i < parameters . Count ; i ++ )
87
89
{
88
- parametersAreByRef [ i ] = parametersAreByRef [ i ] && ! IsUsedAsByRefParam ( declarations , parameters [ i ] ) &&
89
- ( ( VBAParser . ArgContext ) parameters [ i ] . Context ) . BYVAL ( ) == null &&
90
- ! parameters [ i ] . References . Any ( reference => reference . IsAssignment ) ;
90
+ parametersAreByRef [ i ] = parametersAreByRef [ i ] &&
91
+ ! IsUsedAsByRefParam ( declarations , parameters [ i ] ) &&
92
+ ( ( VBAParser . ArgContext ) parameters [ i ] . Context ) . BYVAL ( ) == null &&
93
+ ! parameters [ i ] . References . Any ( reference => reference . IsAssignment ) ;
91
94
}
92
95
}
93
96
Original file line number Diff line number Diff line change 3
3
using Microsoft . VisualStudio . TestTools . UnitTesting ;
4
4
using Moq ;
5
5
using Rubberduck . Inspections ;
6
- using Rubberduck . Parsing ;
7
6
using Rubberduck . Parsing . VBA ;
8
- using Rubberduck . VBEditor ;
9
7
using Rubberduck . VBEditor . Application ;
10
8
using Rubberduck . VBEditor . Events ;
11
9
using Rubberduck . VBEditor . SafeComWrappers ;
You can’t perform that action at this time.
0 commit comments