@@ -193,7 +193,7 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
193193
194194 {
195195 CommandID selectionsMenuCommandID = new CommandID ( GuidList . guidCPPCheckPluginCmdSet , ( int ) PkgCmdIDList . cmdidCheckMultiItemCppcheck ) ;
196- menuCheckSelections = new MenuCommand ( onCheckSelectionsRequested , selectionsMenuCommandID ) ;
196+ menuCheckSelections = new MenuCommand ( onCheckSelectedProjects , selectionsMenuCommandID ) ;
197197 mcs . AddCommand ( menuCheckSelections ) ;
198198 }
199199
@@ -211,7 +211,7 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
211211
212212 {
213213 CommandID selectionsMenuCommandID = new CommandID ( GuidList . guidCPPCheckPluginMultiItemProjectCmdSet , ( int ) PkgCmdIDList . cmdidCheckMultiItemCppcheck1 ) ;
214- checkMultiSelections = new MenuCommand ( onCheckSelectionsRequested , selectionsMenuCommandID ) ;
214+ checkMultiSelections = new MenuCommand ( onCheckSelectedProjects , selectionsMenuCommandID ) ;
215215 mcs . AddCommand ( checkMultiSelections ) ;
216216 }
217217
@@ -247,8 +247,7 @@ private void onCheckCurrentProjectRequested(object sender, EventArgs e)
247247 {
248248 JoinableTaskFactory . Run ( async ( ) =>
249249 {
250- await JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
251- _ = checkFirstActiveProjectAsync ( ) ;
250+ await checkFirstActiveProjectAsync ( ) ;
252251 } ) ;
253252 }
254253
@@ -269,7 +268,7 @@ private void onCheckAllProjectsRequested(object sender, EventArgs e)
269268 } ) ;
270269 }
271270
272- private void onCheckSelectionsRequested ( object sender , EventArgs e )
271+ private void onCheckSelectedProjects ( object sender , EventArgs e )
273272 {
274273 JoinableTaskFactory . Run ( async ( ) =>
275274 {
@@ -461,6 +460,7 @@ private async Task<SourceFilesWithConfiguration> getAllSupportedFilesFromProject
461460 private async Task checkFirstActiveProjectAsync ( )
462461 {
463462 await JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
463+
464464
465465 var activeProjects = await findSelectedCppProjectsAsync ( ) ;
466466 Assumes . NotNull ( activeProjects ) ;
@@ -507,7 +507,10 @@ private async Task checkProjectsAsync(List<Project> projects)
507507
508508 foreach ( ProjectItem projectItem in project . ProjectItems )
509509 {
510+ Stopwatch sw = Stopwatch . StartNew ( ) ;
510511 await scanProjectItemForSourceFilesAsync ( projectItem , sourceFiles , config , project ) ;
512+ sw . Stop ( ) ;
513+ await AddTextToOutputWindowAsync ( "scanProjectItemForSourceFilesAsync for " + projectItem . Name + " took " + sw . ElapsedMilliseconds + " ms\n " ) ;
511514 }
512515
513516 // Although we're using the same base configuration, it's possible for each file to override that.
@@ -783,17 +786,17 @@ private async void scanProgressUpdated(int filesScanned)
783786 statusBar . Clear ( ) ;
784787 }
785788 }
786- catch ( Exception ) { }
789+ catch ( Exception ) { }
787790 }
788791
789792 private async void updateStatusBarProgress ( bool inProgress , string label , int currentPercentage )
790793 {
791- await JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
792794 try
793795 {
796+ await JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
794797 _dte . StatusBar . Progress ( inProgress , label , currentPercentage , 100 ) ;
795798 }
796- catch ( Exception ) { }
799+ catch ( Exception ) { }
797800 }
798801
799802 private async void checkProgressUpdated ( object sender , ICodeAnalyzer . ProgressEvenArgs e )
0 commit comments