File tree Expand file tree Collapse file tree 3 files changed +11
-17
lines changed Expand file tree Collapse file tree 3 files changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ public void Startup()
150
150
_appMenus . Initialize ( ) ;
151
151
_hooks . HookHotkeys ( ) ; // need to hook hotkeys before we localize menus, to correctly display ShortcutTexts
152
152
_appMenus . Localize ( ) ;
153
- Task . Delay ( 1000 ) . ContinueWith ( t => UiDispatcher . Invoke ( ( ) => _parser . State . OnParseRequested ( this ) ) ) . ConfigureAwait ( false ) ;
153
+ Task . Delay ( 1000 ) . ContinueWith ( t => UiDispatcher . Invoke ( ( ) => _parser . State . OnParseRequested ( this ) ) ) ;
154
154
UpdateLoggingLevel ( ) ;
155
155
}
156
156
Original file line number Diff line number Diff line change @@ -55,11 +55,8 @@ public async Task<IEnumerable<ICodeInspectionResult>> FindIssuesAsync(Rubberduck
55
55
return new ICodeInspectionResult [ ] { } ;
56
56
}
57
57
58
- await Task . Yield ( ) ;
59
-
60
58
state . OnStatusMessageUpdate ( RubberduckUI . CodeInspections_Inspecting ) ;
61
59
UpdateInspectionSeverity ( ) ;
62
- //OnReset();
63
60
64
61
var allIssues = new ConcurrentBag < ICodeInspectionResult > ( ) ;
65
62
@@ -72,31 +69,23 @@ public async Task<IEnumerable<ICodeInspectionResult>> FindIssuesAsync(Rubberduck
72
69
73
70
var inspections = _inspections . Where ( inspection => inspection . Severity != CodeInspectionSeverity . DoNotShow )
74
71
. Select ( inspection =>
75
- new Task ( ( ) =>
72
+ Task . Run ( ( ) =>
76
73
{
77
74
token . ThrowIfCancellationRequested ( ) ;
78
75
var inspectionResults = inspection . GetInspectionResults ( ) ;
79
76
var results = inspectionResults as IEnumerable < InspectionResultBase > ?? inspectionResults ;
80
77
81
78
if ( results . Any ( ) )
82
79
{
83
- //OnIssuesFound(results);
84
-
85
80
foreach ( var inspectionResult in results )
86
81
{
87
82
allIssues . Add ( inspectionResult ) ;
88
83
}
89
84
}
90
- } ) ) . ToArray ( ) ;
91
-
92
- foreach ( var inspection in inspections )
93
- {
94
- inspection . Start ( ) ;
95
- }
85
+ } ) ) . ToList ( ) ;
96
86
97
- Task . WaitAll ( inspections ) ;
87
+ await Task . WhenAll ( inspections ) ;
98
88
state . OnStatusMessageUpdate ( RubberduckUI . ResourceManager . GetString ( "ParserState_" + state . Status ) ) ; // should be "Ready"
99
-
100
89
return allIssues ;
101
90
}
102
91
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public class ExtractMethodSelectionValidation : IExtractMethodSelectionValidatio
15
15
private IEnumerable < Declaration > _declarations ;
16
16
17
17
18
-
18
+
19
19
public ExtractMethodSelectionValidation ( IEnumerable < Declaration > declarations )
20
20
{
21
21
_declarations = declarations ;
@@ -56,10 +56,15 @@ public bool withinSingleProcedure(QualifiedSelection qualifiedSelection)
56
56
{
57
57
procStartContext = procStart . Context as VBAParser . SubStmtContext ;
58
58
}
59
+ // TOOD: Doesn't support properties.
60
+ if ( procStartContext == null )
61
+ {
62
+ return false ;
63
+ }
59
64
var procEndOfSignature = procStartContext . endOfStatement ( ) as VBAParser . EndOfStatementContext ;
60
65
var procSignatureLastLine = procEndOfSignature . Start . Line ;
61
66
62
- return ( procEnd as Declaration ) . QualifiedSelection . Equals ( ( procStart as Declaration ) . QualifiedSelection )
67
+ return ( procEnd as Declaration ) . QualifiedSelection . Equals ( ( procStart as Declaration ) . QualifiedSelection )
63
68
&& ( procSignatureLastLine < startLine ) ;
64
69
65
70
}
You can’t perform that action at this time.
0 commit comments