// Looks at the project item. If it's a supported file type it's added to the list, and if it's a filter it keeps digging into it. private async Task scanProjectItemForSourceFilesAsync(ProjectItem item, SourceFilesWithConfiguration configuredFiles, Configuration configuration, Project project) { await JoinableTaskFactory.SwitchToMainThreadAsync(); var itemType = await getTypeOfProjectItemAsync(item); if (itemType == ProjectItemType.folder) { foreach (ProjectItem subItem in item.ProjectItems) { await scanProjectItemForSourceFilesAsync(subItem, configuredFiles, configuration, project); } } else if (itemType == ProjectItemType.headerFile || itemType == ProjectItemType.cFile || itemType == ProjectItemType.cppFile) { var document = item.Document; if (document == null) { Debug.Fail("isCppFileAsync(item) is true, but item.Document is null!"); return; } SourceFile sourceFile = await createSourceFileAsync(document.FullName, configuration, project); configuredFiles.addFileIfDoesntExistAlready(sourceFile); } }
private void runSavedFileAnalysis(SourceFile file, Configuration currentConfig) { Debug.Assert(currentConfig != null); var configuredFiles = new SourceFilesWithConfiguration(); configuredFiles.addFileIfDoesntExistAlready(file); configuredFiles.Configuration = currentConfig; _ = System.Threading.Tasks.Task.Run(async delegate { await System.Threading.Tasks.Task.Delay(750); await JoinableTaskFactory.SwitchToMainThreadAsync(); runAnalysis(new List <SourceFilesWithConfiguration> { configuredFiles }, true); }); }