├── .editorconfig
├── .gitattributes
├── .github
├── FUNDING.yml
└── workflows
│ ├── addVsixLinkToIssues.yaml
│ └── push_pull.yaml
├── .gitignore
├── Art
├── Options-Global.png
├── Options-Project.png
├── Output-Coverage.png
├── Output-RiskHotspots.png
├── Output-Summary.png
├── librepay.png
├── logo-transparent.png
├── logo.png
└── preview-coverage.png
├── CHANGELOG.md
├── CONTRIBUTING.md
├── FineCodeCoverage.sln
├── FineCodeCoverage
├── FineCodeCoverage.csproj
├── Key.snk
├── Properties
│ └── AssemblyInfo.cs
├── dlls
│ ├── Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
│ └── Microsoft.VisualStudio.TestWindow.Interfaces.dll
├── source.extension.cs
└── source.extension.vsixmanifest
├── FineCodeCoverage2022
├── FineCodeCoverage2022.csproj
├── Properties
│ └── AssemblyInfo.cs
├── dlls
│ ├── Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
│ └── Microsoft.VisualStudio.TestWindow.Interfaces.dll
├── source.extension.cs
└── source.extension.vsixmanifest
├── FineCodeCoverageTests
├── AppOptionsProvider_Tests.cs
├── CoberturaDeserializer_Tests.cs
├── CoberturaUtil_Tests.cs
├── CoverageProject_Settings_Tests.cs
├── CoverageProject_Tests.cs
├── CoverageToolOutput_Tests
│ ├── AppOptionsCoverageToolOutputFolderSolutionProvider_Tests.cs
│ ├── CoverageToolOutputFolderFromSolutionProvider_Tests.cs
│ ├── CoverageToolOutputManager_Tests.cs
│ ├── CoverageToolOutput_Exports_Tests.cs
│ ├── FccOutputExistenceCoverageToolOutputFolderSolutionProvider_Tests.cs
│ └── SolutionFolderProvider_Tests.cs
├── CoverageUtilManager_Tests.cs
├── CoverletConsole_Tests.cs
├── CoverletDataCollectorGeneratedCobertura_Tests.cs
├── CoverletDataCollectorUtil_CanUseDataCollector_Tests.cs
├── CoverletDataCollectorUtil_Initialize_Tests.cs
├── CoverletDataCollectorUtil_RunAsync_Tests.cs
├── CoverletUtil_Tests.cs
├── DataCollectorSettingsBuilder_Tests.cs
├── DotNetToolList_Tests.cs
├── Editor
│ ├── DynamicCoverage
│ │ ├── BlazorCoverageContentType_Tests.cs
│ │ ├── BlazorFileCodeSpanRangeService_Tests.cs
│ │ ├── BlazorGeneratedFilePathMatcher_Tests.cs
│ │ ├── BufferLineCoverage_Tests.cs
│ │ ├── CPPCoverageContentType_Tests.cs
│ │ ├── CSharpCoverageContentType_Tests.cs
│ │ ├── CodeSpanRangeContainingCodeTrackerFactory_Tests.cs
│ │ ├── ContainingCodeTrackedLinesBuilder_Tests.cs
│ │ ├── CoverageCodeTracker_Tests.cs
│ │ ├── CoverageLine_Tests.cs
│ │ ├── DynamicCoverageManager_Tests.cs
│ │ ├── DynamicCoverageStore_Tests.cs
│ │ ├── LineExcluder_Tests.cs
│ │ ├── LineTracker_Tests.cs
│ │ ├── NewCodeTracker_Tests.cs
│ │ ├── OtherLinesTracker_Tests.cs
│ │ ├── RoslynFileCodeSpanRangeService_Tests.cs
│ │ ├── SerializedState_Tests.cs
│ │ ├── TextInfo_Tests.cs
│ │ ├── TrackedCoverageLines_Test.cs
│ │ ├── TrackedLines_Test.cs
│ │ ├── TrackedNewCodeLine_Tests.cs
│ │ ├── TrackingLineTracker_Tests.cs
│ │ ├── TrackingLine_Tests.cs
│ │ ├── TrackingSpanRangeUpdatingTracker_Tests.cs
│ │ ├── TrackingSpanRange_Tests.cs
│ │ └── VBCoverageContentType_Tests.cs
│ ├── IndicatorVisibility
│ │ └── FileIndicatorVisibility_Tests.cs
│ ├── Management
│ │ ├── CoverageClassificationTypeService_Tests.cs
│ │ ├── CoverageColoursManager_Tests.cs
│ │ ├── CoverageFontAndColorsCategoryItemNames_Tests.cs
│ │ ├── EditorFormatMapTextSpecificListener_Tests.cs
│ │ ├── FontAndColorsInfo_Equatable_Tests.cs
│ │ ├── FontAndColorsInfosProvider_Tests.cs
│ │ ├── FontsAndColorsHelper_Tests.cs
│ │ ├── Helpers
│ │ │ └── FontAndColorsInfoFactory.cs
│ │ ├── ItemCoverageColours_Equatable_Tests.cs
│ │ ├── TextFormattingRunPropertiesFactory_Tests.cs
│ │ └── VsHasCoverageMarkersLogic_Tests.cs
│ ├── Roslyn
│ │ ├── CSharpContainingCodeVisitor_Tests.cs
│ │ ├── ContainingCodeVisitor_Tests_Base.cs
│ │ ├── LanguageContainingCodeVisitorFactory_Tests.cs
│ │ ├── RoslynService_Tests.cs
│ │ └── VBContainingCodeVisitor_Tests.cs
│ └── Tagging
│ │ ├── Base
│ │ ├── CoverageTaggerProvider_Tests.cs
│ │ ├── CoverageTagger_Tests.cs
│ │ ├── CoverageTypeFilterBase_Exception_Tests.cs
│ │ ├── LineSpanLogic_Tests.cs
│ │ └── Types
│ │ │ ├── DummyCoverageTypeFilter.cs
│ │ │ ├── DummyTag.cs
│ │ │ └── OtherCoverageTypeFilter.cs
│ │ ├── Classification
│ │ ├── CoverageClassificationFilter_Tests.cs
│ │ └── CoverageLineClassificationTaggerProvider_Tests.cs
│ │ ├── CoverageTypeFilter_Tests_Base.cs
│ │ ├── GlyphMargin
│ │ ├── CoverageLineGlyphFactory_Tests.cs
│ │ ├── CoverageLineGlyphTaggerProvider_Tests.cs
│ │ ├── CoverageLineGlyphTagger_Tests.cs
│ │ └── GlyphFilter_Tests.cs
│ │ ├── OverviewMargin
│ │ ├── CoverageLineOverviewMarkTaggerProvider_Tests.cs
│ │ └── CoverageOverviewMargin_Tests.cs
│ │ ├── TaggerProviders_LanguageSupport_Tests.cs
│ │ └── Types
│ │ ├── LineSpan.cs
│ │ └── SnapshotSpanFactory.cs
├── FCCEngine_Tests.cs
├── FileLineCoverage_Tests.cs
├── FineCodeCoverageTests.csproj
├── FirstTimeToolWindowOpener_Tests.cs
├── Initializer_Tests.cs
├── MsCodeCoverage
│ ├── CustomRunSettingsTemplateProvider_Tests.cs
│ ├── Helpers
│ │ └── XmlHelper.cs
│ ├── Implementations
│ │ └── RunSettingsTemplateReplacements.cs
│ ├── MsCodeCoverageRunSettingsService_Collect_Tests.cs
│ ├── MsCodeCoverageRunSettingsService_IRunSettingsService_Tests.cs
│ ├── MsCodeCoverageRunSettingsService_Initialize_Tests.cs
│ ├── MsCodeCoverageRunSettingsService_IsCollecting_Tests.cs
│ ├── ProjectRunSettingsGenerator_Tests.cs
│ ├── RunSettingsHelper_Tests.cs
│ ├── RunSettingsTemplateReplacementsFactory_Tests.cs
│ ├── RunSettingsTemplate_Tests.cs
│ ├── ShimCopier_Tests.cs
│ ├── TemplatedRunSettingsService_Tests.cs
│ ├── UserRunSettingsService_AddFCCSettings_Tests.cs
│ └── UserRunSettingsService_Analysis_Tests.cs
├── OpenCoverExeArgumentsProvider_Tests.cs
├── OpenCoverUtil_Tests.cs
├── PackageLoader_Tests.cs
├── ProcessResponseProcessor_Tests.cs
├── Properties
│ └── AssemblyInfo.cs
├── ReferencedProject_Tests.cs
├── RunSettingsCoverletConfigurationFactory_Tests.cs
├── RunSettingsCoverletConfiguration_Tests.cs
├── ScriptManager_Tests.cs
├── ShownToolWindowHistory_Tests.cs
├── TestContainerDiscovery_Tests.cs
├── TestHelpers
│ ├── ExportsInitializable.cs
│ ├── MefOrderAssertions.cs
│ ├── MoqAssertionsHelper.cs
│ ├── MoqExtensions.cs
│ ├── MoqMatchers.cs
│ ├── TestThreadHelper.cs
│ └── XmlAssert.cs
├── ToolFolder_Tests.cs
├── ToolUnzipper_Tests.cs
├── ToolZipProvider_Tests.cs
└── app.config
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── ReportGeneratorPlugins
├── FccDarkReportBuilder.cs
├── FccLightReportBuilder.cs
└── ReportGeneratorPlugins.csproj
├── Shared Files
├── OutputToolWindowPackage.cs
├── OutputToolWindowPackage.vsct
├── Resources
│ ├── ClearUICommand.png
│ ├── OutputToolWindowCommand.png
│ ├── dummyReportToProcess.html
│ └── reportparts.xml
└── ZippedTools
│ ├── ReportGenerator.Core.dll
│ ├── coverlet.collector.6.0.4.zip
│ ├── coverlet.console.6.0.4.zip
│ ├── dotnet-coverage.17.14.2.zip
│ ├── microsoft.codecoverage.17.13.0.zip
│ ├── microsoft.testplatform.16.9.1.zip
│ ├── openCover.4.7.1221.zip
│ └── reportGenerator.4.7.4.zip
├── SharedProject
├── Core
│ ├── AppDataFolder.cs
│ ├── Cobertura
│ │ ├── CoberturaDerializer.cs
│ │ ├── CoberturaUtil.cs
│ │ ├── CoverageType.cs
│ │ ├── FileLineCoverage.cs
│ │ ├── FileLineCoverageFactory.cs
│ │ ├── ICoberturaDeserializer.cs
│ │ ├── ICoberturaUtil.cs
│ │ ├── IFileLineCoverage.cs
│ │ ├── IFileLineCoverageFactory.cs
│ │ ├── ILine.cs
│ │ └── Report
│ │ │ ├── Class.cs
│ │ │ ├── Condition.cs
│ │ │ ├── Conditions.cs
│ │ │ ├── CoverageReport.cs
│ │ │ ├── Line.cs
│ │ │ ├── Method.cs
│ │ │ ├── Package.cs
│ │ │ └── Sources.cs
│ ├── CoverageToolOutput
│ │ ├── AppOptionsCoverageToolOutputFolderSolutionProvider.cs
│ │ ├── CoverageToolOutputFolderFromSolutionProvider.cs
│ │ ├── CoverageToolOutputManager.cs
│ │ ├── FccOutputExistenceCoverageToolOutputFolderSolutionProvider.cs
│ │ ├── ICoverageToolOutputFolderProvider.cs
│ │ ├── ICoverageToolOutputFolderSolutionProvider.cs
│ │ ├── ICoverageToolOutputManager.cs
│ │ ├── ISolutionFolderProvider.cs
│ │ ├── OutdatedOutputMessage.cs
│ │ └── SolutionFolderProvider.cs
│ ├── CoverageUIEvents.cs
│ ├── CoverageUtilManager.cs
│ ├── Coverlet
│ │ ├── Console
│ │ │ ├── CoverletConsoleCustomPathExecutor.cs
│ │ │ ├── CoverletConsoleDotnetToolsGlobalExecutor.cs
│ │ │ ├── CoverletConsoleDotnetToolsLocalExecutor.cs
│ │ │ ├── CoverletConsoleUtil.cs
│ │ │ ├── DotNetToolListCoverlet.cs
│ │ │ ├── FCCCoverletConsoleExecutor.cs
│ │ │ ├── ICoverletConsoleExecutor.cs
│ │ │ ├── ICoverletConsoleUtil.cs
│ │ │ ├── IDotNetToolListCoverlet.cs
│ │ │ └── IFCCCoverletConsoleExecutor.cs
│ │ ├── CoverletUtil.cs
│ │ ├── DataCollector
│ │ │ ├── CoverletDataCollectorGeneratedCobertura.cs
│ │ │ ├── CoverletDataCollectorUtil.cs
│ │ │ ├── DataCollectorSettingsBuilder.cs
│ │ │ ├── DataCollectorSettingsBuilderFactory.cs
│ │ │ ├── RunSettingsCoverletConfiguration.cs
│ │ │ ├── RunSettingsCoverletConfigurationFactory.cs
│ │ │ └── interfaces
│ │ │ │ ├── ICoverletDataCollectorGeneratedCobertura.cs
│ │ │ │ ├── ICoverletDataCollectorUtil.cs
│ │ │ │ ├── IDataCollectorSettingsBuilder.cs
│ │ │ │ ├── IDataCollectorSettingsBuilderFactory.cs
│ │ │ │ ├── IRunSettingsCoverletConfiguration.cs
│ │ │ │ └── IRunSettingsCoverletConfigurationFactory.cs
│ │ └── ICoverletUtil.cs
│ ├── EnvironmentVariable.cs
│ ├── FCCEngine.cs
│ ├── FileSynchronization
│ │ └── FileSynchronization.cs
│ ├── IAppDataFolder.cs
│ ├── ICoverageUtilManager.cs
│ ├── IEnvironmentVariable.cs
│ ├── IFCCEngine.cs
│ ├── IMessageBox.cs
│ ├── ISourceFileOpener.cs
│ ├── Initialization
│ │ ├── FirstTimeToolWindowOpener.cs
│ │ ├── IFirstTimeToolWindowOpener.cs
│ │ ├── IInitializeStatusProvider.cs
│ │ ├── IInitializedFromTestContainerDiscoverer.cs
│ │ ├── IInitializer.cs
│ │ ├── IPackageLoader.cs
│ │ ├── InitializeStatus.cs
│ │ ├── Initializer.cs
│ │ └── PackageLoader.cs
│ ├── MessageBoxWrapper.cs
│ ├── Model
│ │ ├── CoverageProject.cs
│ │ ├── CoverageProjectFactory.cs
│ │ ├── CoverageProjectFileSynchronizationDetails.cs
│ │ ├── CoverageProjectSettingsManager.cs
│ │ ├── CoverageProjectSettingsProvider.cs
│ │ ├── FCCSettingsFilesProvider.cs
│ │ ├── ICoverageProject.cs
│ │ ├── ICoverageProjectFactory.cs
│ │ ├── ICoverageProjectSettingsManager.cs
│ │ ├── ICoverageProjectSettingsProvider.cs
│ │ ├── IFCCSettingsFilesProvider.cs
│ │ ├── ISettingsMerger.cs
│ │ ├── IVsBuildFCCSettingsProvider.cs
│ │ ├── ReferencedProjects
│ │ │ ├── CPPReferencedProjectsHelper.cs
│ │ │ ├── DotNetReferencedProjectsHelper.cs
│ │ │ ├── ICPPReferencedProjectsHelper.cs
│ │ │ ├── IDotNetReferencedProjectsHelper.cs
│ │ │ ├── IExcludableReferencedProject.cs
│ │ │ ├── IProjectFileReferencedProjectsHelper.cs
│ │ │ ├── IReferencedProject.cs
│ │ │ ├── IReferencedProjectsHelper.cs
│ │ │ ├── IVsApiReferencedProjectsHelper.cs
│ │ │ ├── ProjectFileReferencedProjectsHelper.cs
│ │ │ ├── ReferencedProject.cs
│ │ │ ├── ReferencedProjectsHelper.cs
│ │ │ └── VsApiReferencedProjectsHelper.cs
│ │ ├── SettingsMerger.cs
│ │ └── VsBuildFCCSettingsProvider.cs
│ ├── MsTestPlatform
│ │ ├── CodeCoverage
│ │ │ ├── CustomRunSettingsTemplateProvider.cs
│ │ │ ├── ICoverageProjectRunSettings.cs
│ │ │ ├── ICustomRunSettingsTemplateProvider.cs
│ │ │ ├── IMsCodeCoverageRunSettingsService.cs
│ │ │ ├── IProjectRunSettingsGenerator.cs
│ │ │ ├── IRunSettingsTemplate.cs
│ │ │ ├── IRunSettingsTemplateReplacements.cs
│ │ │ ├── IRunSettingsTemplateReplacementsFactory.cs
│ │ │ ├── IShimCopier.cs
│ │ │ ├── ITemplatedRunSettingsService.cs
│ │ │ ├── IUserRunSettingsProjectDetails.cs
│ │ │ ├── IUserRunSettingsService.cs
│ │ │ ├── IVsRunSettingsWriter.cs
│ │ │ ├── MsCodeCoverageCollectionStatus.cs
│ │ │ ├── MsCodeCoverageIOperationExtensions.cs
│ │ │ ├── MsCodeCoverageRegex.cs
│ │ │ ├── MsCodeCoverageRunSettingsService.cs
│ │ │ ├── MsTemplateReplacementException.cs
│ │ │ ├── ProjectRunSettingsGenerator.cs
│ │ │ ├── ProjectSaver.cs
│ │ │ ├── RunSettingsHelper.cs
│ │ │ ├── RunSettingsTemplate.cs
│ │ │ ├── RunSettingsTemplateReplacementsFactory.cs
│ │ │ ├── ShimCopier.cs
│ │ │ ├── TemplatedRunSettingsService.cs
│ │ │ ├── UserRunSettingsService.cs
│ │ │ ├── VsRunSettingsWriter.cs
│ │ │ └── XPathNavigatorExtensions.cs
│ │ ├── IMsTestPlatformUtil.cs
│ │ ├── MsTestPlatformUtil.cs
│ │ └── TestingPlatform
│ │ │ ├── DisableTestingPlatformServerCapabilityGlobalPropertiesProvider.cs
│ │ │ └── TUnit
│ │ │ ├── BuildHelper.cs
│ │ │ ├── CPSTestProjectService.cs
│ │ │ ├── CommandLineParseOption.cs
│ │ │ ├── CommandLineParseResult.cs
│ │ │ ├── CommandLineParser.cs
│ │ │ ├── IBuildHelper.cs
│ │ │ ├── ICPSTestProjectService.cs
│ │ │ ├── INugetProjectServiceProvider.cs
│ │ │ ├── IRunSettingsToConfiguration.cs
│ │ │ ├── ISolutionProjectsProvider.cs
│ │ │ ├── ITUnitChangeNotifier.cs
│ │ │ ├── ITUnitCoverage.cs
│ │ │ ├── ITUnitCoverageProjectFactory.cs
│ │ │ ├── ITUnitCoverageRunner.cs
│ │ │ ├── ITUnitInstalledPackagesService.cs
│ │ │ ├── ITUnitProjectCache.cs
│ │ │ ├── ITUnitProjectFactory.cs
│ │ │ ├── ITUnitProjectsProvider.cs
│ │ │ ├── ITUnitSettingsProvider.cs
│ │ │ ├── IVsHierarchyExtensions.cs
│ │ │ ├── NugetProjectServiceProvider.cs
│ │ │ ├── ResponseFileHelper.cs
│ │ │ ├── RunSettingsToConfiguration.cs
│ │ │ ├── SolutionProjectsProvider.cs
│ │ │ ├── TUnitChangeNotifier.cs
│ │ │ ├── TUnitConstants.cs
│ │ │ ├── TUnitCoverage.cs
│ │ │ ├── TUnitCoverageProjectFactory.cs
│ │ │ ├── TUnitCoverageRunner.cs
│ │ │ ├── TUnitInstalledPackagesService.cs
│ │ │ ├── TUnitProjectCache.cs
│ │ │ ├── TUnitProjectFactory.cs
│ │ │ ├── TUnitProjectsProvider.cs
│ │ │ └── TUnitSettingsProvider.cs
│ ├── OpenCover
│ │ ├── IOpenCoverExeArgumentsProvider.cs
│ │ ├── IOpenCoverUtil.cs
│ │ ├── OpenCoverExeArgumentsProvider.cs
│ │ └── OpenCoverUtil.cs
│ ├── ReportGenerator
│ │ ├── Base64ReportImage.cs
│ │ ├── ColourUtilities
│ │ │ ├── LighnessApplier.cs
│ │ │ └── LuminanceContrastColourExtensions.cs
│ │ ├── HotspotReader.cs
│ │ ├── IReportColours.cs
│ │ ├── IReportColoursProvider.cs
│ │ ├── IThemeResourceKeyProvider.cs
│ │ ├── JsThemeStyling.cs
│ │ ├── ReportColours.cs
│ │ ├── ReportColoursExtensions.cs
│ │ ├── ReportColoursProvider.cs
│ │ ├── ReportGeneratorUtil.cs
│ │ └── ThemeResourceKeyProvider.cs
│ ├── SourceFileOpener.cs
│ └── Utilities
│ │ ├── AssemblyUtil.cs
│ │ ├── ComparableFile.cs
│ │ ├── DisposeAwareTaskRunner.cs
│ │ ├── DotNet
│ │ ├── DotNetConfigFinder.cs
│ │ ├── DotNetToolListExecutor.cs
│ │ ├── DotNetToolListParser.cs
│ │ ├── IDotNetConfigFinder.cs
│ │ ├── IDotNetToolListExecutor.cs
│ │ └── IDotNetToolListParser.cs
│ │ ├── EventAggregator.cs
│ │ ├── FileComparer.cs
│ │ ├── FileRenameListener.cs
│ │ ├── FileSystemInfoDeleteExtensions.cs
│ │ ├── FileUtil.cs
│ │ ├── IAssemblyUtil.cs
│ │ ├── IEnvironment.cs
│ │ ├── IFileRenameListener.cs
│ │ ├── IFileUtil.cs
│ │ ├── IJsonConvertService.cs
│ │ ├── IProcessResponseProcessor.cs
│ │ ├── IProcessUtil.cs
│ │ ├── IProjectFilePropertyWriter.cs
│ │ ├── IResourceProvider.cs
│ │ ├── IShownToolWindowHistory.cs
│ │ ├── ISolutionEvents.cs
│ │ ├── IToolWindowOpener.cs
│ │ ├── IXmlUtils.cs
│ │ ├── IZipFile.cs
│ │ ├── JsonConvertService.cs
│ │ ├── LinqExtensions.cs
│ │ ├── LinqToXmlUtil.cs
│ │ ├── ListExtensions.cs
│ │ ├── MEF.cs
│ │ ├── ProcessResponseProcessor.cs
│ │ ├── ProcessUtil.cs
│ │ ├── ProjectFilePropertyWriter.cs
│ │ ├── ReflectionExtensions.cs
│ │ ├── ResourceProvider.cs
│ │ ├── SVsColorThemeService.cs
│ │ ├── ServiceProviderExtensions.cs
│ │ ├── ShownToolWindowHistory.cs
│ │ ├── SolutionEvents.cs
│ │ ├── SystemEnvironment.cs
│ │ ├── ThrowIf.cs
│ │ ├── ToolWindowOpener.cs
│ │ ├── ToolZip
│ │ ├── IToolFolder.cs
│ │ ├── IToolUnzipper.cs
│ │ ├── IToolZipProvider.cs
│ │ ├── ToolFolder.cs
│ │ ├── ToolUnzipper.cs
│ │ └── ToolZipProvider.cs
│ │ ├── Tryer.cs
│ │ ├── VsThreading
│ │ └── IThreadHelper.cs
│ │ ├── XmlFileEscaper.cs
│ │ ├── XmlUtils.cs
│ │ └── ZipFileWrapper.cs
├── Editor
│ ├── .editorconfig
│ ├── DynamicCoverage
│ │ ├── Common
│ │ │ ├── DynamicCoverageTypeConverter.cs
│ │ │ ├── DynamicLine.cs
│ │ │ └── TrackingLine.cs
│ │ ├── ContentTypes
│ │ │ ├── Blazor
│ │ │ │ ├── BlazorCoverageContentType.cs
│ │ │ │ ├── BlazorFileCodeSpanRangeService.cs
│ │ │ │ ├── BlazorGeneratedDocumentRootFinder.cs
│ │ │ │ ├── BlazorGeneratedFilePathMatcher.cs
│ │ │ │ ├── IBlazorFileCodeSpanRangeService.cs
│ │ │ │ ├── IBlazorGeneratedDocumentRootFinder.cs
│ │ │ │ └── IBlazorGeneratedFilePathMatcher.cs
│ │ │ ├── CPPCoverageContentType.cs
│ │ │ └── Roslyn
│ │ │ │ ├── CSharpCoverageContentType.cs
│ │ │ │ ├── IRoslynFileCodeSpanRangeService.cs
│ │ │ │ ├── RoslynFileCodeSpanRangeService.cs
│ │ │ │ └── VBCoverageContentType.cs
│ │ ├── Coverage
│ │ │ ├── CoverageLine.cs
│ │ │ ├── CoverageLineFactory.cs
│ │ │ ├── ICoverageLine.cs
│ │ │ ├── ICoverageLineFactory.cs
│ │ │ ├── ITrackedCoverageLinesFactory.cs
│ │ │ ├── TrackedCoverageLines.cs
│ │ │ ├── TrackedCoverageLinesFactory.cs
│ │ │ └── TrackedLineLine.cs
│ │ ├── Dirty
│ │ │ ├── DirtyLineFactory.cs
│ │ │ └── IDirtyLineFactory.cs
│ │ ├── Management
│ │ │ ├── BufferLineCoverage.cs
│ │ │ ├── BufferLineCoverageFactory.cs
│ │ │ ├── CoverageChangedMessage.cs
│ │ │ ├── DynamicCoverageManager.cs
│ │ │ ├── DynamicCoverageType.cs
│ │ │ ├── IBufferLineCoverage.cs
│ │ │ ├── IBufferLineCoverageFactory.cs
│ │ │ ├── IDynamicCoverageManager.cs
│ │ │ ├── IDynamicLine.cs
│ │ │ ├── ILastCoverage.cs
│ │ │ ├── ITrackedLines.cs
│ │ │ ├── ITrackedLinesFactory.cs
│ │ │ └── LastCoverage.cs
│ │ ├── NewCode
│ │ │ ├── INewCodeTrackerFactory.cs
│ │ │ ├── ITrackedNewCodeLine.cs
│ │ │ ├── ITrackedNewCodeLineFactory.cs
│ │ │ ├── NewCodeTracker.cs
│ │ │ ├── NewCodeTrackerFactory.cs
│ │ │ ├── TrackedNewCodeLine.cs
│ │ │ ├── TrackedNewCodeLineUpdate.cs
│ │ │ └── TrackedNewLineFactory.cs
│ │ ├── NotIncluded
│ │ │ ├── INotIncludedLineFactory.cs
│ │ │ └── NotIncludedLineFactory.cs
│ │ ├── Store
│ │ │ ├── DynamicCoverageStore.cs
│ │ │ └── IDynamicCoverageStore.cs
│ │ ├── TrackedLines
│ │ │ ├── ContainingCodeTrackedLinesFactory.cs
│ │ │ ├── ContainingCodeTrackerState.cs
│ │ │ ├── ContainingCodeTrackerType.cs
│ │ │ ├── IContainingCodeTracker.cs
│ │ │ ├── IContainingCodeTrackerProcessResult.cs
│ │ │ ├── IContainingCodeTrackerTrackedLines.cs
│ │ │ ├── IFileCodeSpanRangeService.cs
│ │ │ ├── INewCodeTracker.cs
│ │ │ ├── SpanAndLineRange.cs
│ │ │ └── TrackedLines.cs
│ │ ├── TrackedLinesImpl
│ │ │ ├── Construction
│ │ │ │ ├── CodeSpanRange.cs
│ │ │ │ ├── CodeSpanRangeContainingCodeTrackerFactory.cs
│ │ │ │ ├── ContainingCodeTrackedLinesBuilder.cs
│ │ │ │ ├── ContainingCodeTrackerTrackedLinesWithState.cs
│ │ │ │ ├── ICodeSpanRangeContainingCodeTrackerFactory.cs
│ │ │ │ ├── IContainingCodeTrackedLinesFactory.cs
│ │ │ │ ├── ICoverageContentType.cs
│ │ │ │ ├── ITrackingSpanRangeContainingCodeTrackerFactory.cs
│ │ │ │ ├── ITrackingSpanRangeFactory.cs
│ │ │ │ ├── SerializedContainingCodeTracker.cs
│ │ │ │ ├── SerializedEditorDynamicCoverage.cs
│ │ │ │ ├── TrackingSpanRange.cs
│ │ │ │ ├── TrackingSpanRangeFactory.cs
│ │ │ │ └── TrackingSpanRangeProcessResult.cs
│ │ │ ├── ContainingCodeTracker
│ │ │ │ ├── ContainingCodeTrackerProcessResult.cs
│ │ │ │ ├── CoverageCodeTracker.cs
│ │ │ │ ├── ITrackedCoverageLines.cs
│ │ │ │ ├── ITrackingLine.cs
│ │ │ │ ├── ITrackingSpanRange.cs
│ │ │ │ ├── IUpdatableDynamicLines.cs
│ │ │ │ ├── OtherLinesTracker.cs
│ │ │ │ ├── TrackingLineTracker.cs
│ │ │ │ ├── TrackingSpanRangeContainingCodeTrackerFactory.cs
│ │ │ │ └── TrackingSpanRangeUpdatingTracker.cs
│ │ │ └── LineExclusion
│ │ │ │ ├── ILineExcluder.cs
│ │ │ │ └── LineExcluder.cs
│ │ └── Utilities
│ │ │ ├── DateTimeService.cs
│ │ │ ├── IDateTimeService.cs
│ │ │ ├── ILineTracker.cs
│ │ │ ├── ISyntaxNodeLocationMapper.cs
│ │ │ ├── ITextInfo.cs
│ │ │ ├── ITextInfoFactory.cs
│ │ │ ├── ITextSnapshotText.cs
│ │ │ ├── ITrackingLineFactory.cs
│ │ │ ├── LineTracker.cs
│ │ │ ├── SyntaxNodeLocationMapper.cs
│ │ │ ├── TextInfo.cs
│ │ │ ├── TextInfoFactory.cs
│ │ │ ├── TextSnapshotText.cs
│ │ │ └── TrackedLineInfo.cs
│ ├── IndicatorVisibility
│ │ ├── FileIndicatorVisibility.cs
│ │ └── IFileIndicatorVisibility.cs
│ ├── Management
│ │ ├── ColoursClassificationFormatDefinition.cs
│ │ ├── CoverageClassificationTypeService.cs
│ │ ├── CoverageColours.cs
│ │ ├── CoverageColoursChangedMessage.cs
│ │ ├── CoverageColoursManager.cs
│ │ ├── CoverageFontAndColorsCategoryItemNamesManager.cs
│ │ ├── CoverageTypeColour.cs
│ │ ├── DelayedMainThreadInvocation.cs
│ │ ├── EditorFormatMapTextSpecificListener.cs
│ │ ├── FCCEditorFormatDefinitionNames.cs
│ │ ├── FontAndColorsCategoryItemName.cs
│ │ ├── FontAndColorsInfo.cs
│ │ ├── FontAndColorsInfosProvider.cs
│ │ ├── FontsAndColorsHelper.cs
│ │ ├── ICoverageClassificationColourService.cs
│ │ ├── ICoverageColours.cs
│ │ ├── ICoverageColoursEditorFormatMapNames.cs
│ │ ├── ICoverageColoursProvider.cs
│ │ ├── ICoverageFontAndColorsCategoryItemNames.cs
│ │ ├── ICoverageFontAndColorsCategoryItemNamesManager.cs
│ │ ├── ICoverageTypeColour.cs
│ │ ├── ICoverageTypeService.cs
│ │ ├── IDelayedMainThreadInvocation.cs
│ │ ├── IEditorFormatMapTextSpecificListener.cs
│ │ ├── IFontAndColorsInfo.cs
│ │ ├── IFontAndColorsInfosProvider.cs
│ │ ├── IFontsAndColorsHelper.cs
│ │ ├── IItemCoverageColours.cs
│ │ ├── ITextFormattingRunPropertiesFactory.cs
│ │ ├── IVsHasCoverageMarkersLogic.cs
│ │ ├── ItemCoverageColours.cs
│ │ ├── MarkerTypeNames.cs
│ │ ├── TextFormattingRunPropertiesFactory.cs
│ │ └── VsHasCoverageMarkersLogic.cs
│ ├── Roslyn
│ │ ├── CSharpContainingCodeVisitor.cs
│ │ ├── ICSharpCodeCoverageNodeVisitor.cs
│ │ ├── ILanguageContainingCodeVisitor.cs
│ │ ├── ILanguageContainingCodeVisitorFactory.cs
│ │ ├── IRoslynService.cs
│ │ ├── ITextSnapshotToSyntaxService.cs
│ │ ├── LanguageContainingCodeVisitorFactory.cs
│ │ ├── RootNodeAndLanguage.cs
│ │ ├── RoslynService.cs
│ │ ├── TextSnapshotToSyntaxService.cs
│ │ └── VBContainingCodeVisitor.cs
│ └── Tagging
│ │ ├── Base
│ │ ├── CoverageTagger.cs
│ │ ├── CoverageTaggerProvider.cs
│ │ ├── CoverageTaggerProviderFactory.cs
│ │ ├── CoverageTypeFilter
│ │ │ ├── CoverageTypeFilterBase.cs
│ │ │ ├── CoverageTypeFilterChangedMessage.cs
│ │ │ └── ICoverageTypeFilter.cs
│ │ ├── ICoverageTagger.cs
│ │ ├── ICoverageTaggerProvider.cs
│ │ ├── ICoverageTaggerProviderFactory.cs
│ │ ├── IFileExcluder.cs
│ │ ├── ILineSpan.cs
│ │ ├── ILineSpanLogic.cs
│ │ ├── ILineSpanTagger.cs
│ │ ├── LineSpan.cs
│ │ └── LineSpanLogic.cs
│ │ ├── Classification
│ │ ├── CoverageClassificationFilter.cs
│ │ └── CoverageLineClassificationTaggerProvider.cs
│ │ ├── GlyphMargin
│ │ ├── CoverageLineGlyphFactory.cs
│ │ ├── CoverageLineGlyphFactoryProvider.cs
│ │ ├── CoverageLineGlyphTag.cs
│ │ ├── CoverageLineGlyphTagger.cs
│ │ ├── CoverageLineGlyphTaggerProvider.cs
│ │ └── GlyphFilter.cs
│ │ └── OverviewMargin
│ │ ├── CoverageLineOverviewMarkTaggerProvider.cs
│ │ └── CoverageOverviewMarginFilter.cs
├── Impl
│ ├── ILogger.cs
│ ├── Logger.cs
│ ├── NowForLog.cs
│ ├── RunSettingsRetriever.cs
│ ├── StatusMarkerProvider.cs
│ ├── TestContainerDiscovery
│ │ ├── Container.cs
│ │ ├── ContainerData.cs
│ │ ├── ICoverageCollectableFromTestExplorer.cs
│ │ ├── ITestOperation.cs
│ │ ├── ITestOperationFactory.cs
│ │ ├── ITestOperationStateInvocationManager.cs
│ │ ├── TestConfiguration.cs
│ │ ├── TestContainerDiscoverer.cs
│ │ ├── TestExecutionStartingMessage.cs
│ │ ├── TestOperation.cs
│ │ ├── TestOperationFactory.cs
│ │ ├── TestOperationStateInvocationManager.cs
│ │ ├── TestRunRequest.cs
│ │ └── TestRunResponse.cs
│ └── Vsix.cs
├── Options
│ ├── AppOptionsPage.cs
│ ├── AppOptionsProvider.cs
│ ├── IAppOptions.cs
│ ├── IAppOptionsProvider.cs
│ ├── IAppOptionsStorageProvider.cs
│ ├── IReadOnlyConfigSettingsStoreProvider.cs
│ ├── IReadOnlyUserSettingsStoreProvider.cs
│ ├── IWritableUserSettingsStoreProvider.cs
│ ├── ReadOnlyConfigSettingsStoreProvider.cs
│ ├── ReadOnlyUserSettingsStoreProvider.cs
│ └── WritableUserSettingsStoreProvider.cs
├── Output
│ ├── CancelCollectTUnitCommand.cs
│ ├── ClearUICommand.cs
│ ├── CollectTUnitCommand.cs
│ ├── DpiChangedMessage.cs
│ ├── EnvironmentFont.cs
│ ├── EnvironmentFontDetailsChangedMessage.cs
│ ├── IProcess.cs
│ ├── InvokeScriptMessage.cs
│ ├── NewReportMessage.cs
│ ├── ObjectForScriptingMessage.cs
│ ├── OpenCoberturaCommand.cs
│ ├── OpenHotspotsCommand.cs
│ ├── OutputToolWindow.cs
│ ├── OutputToolWindowCommand.cs
│ ├── OutputToolWindowContext.cs
│ ├── OutputToolWindowControl.xaml
│ ├── OutputToolWindowControl.xaml.cs
│ ├── OutputToolWindowPackage.cs
│ ├── ProcessWrapper.cs
│ ├── ReadyForReportMessage.cs
│ ├── ScriptManager.cs
│ ├── ToggleCoverageIndicatorsCommand.cs
│ ├── ToggleCoverageIndicatorsMessage.cs
│ └── VSPackage.resx
├── Resources
│ └── OutputToolWindowPackage.ico
├── SharedProject.projitems
└── SharedProject.shproj
├── appveyor.yml
├── dev-readmes
└── coverage-tool-zips.md
├── vs-market-place-manifest-2022.json
├── vs-market-place-manifest.json
└── vs-market-place-overview.md
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{cs,vb}]
2 |
3 | # IDE0017: Simplify object initialization
4 | dotnet_style_object_initializer = false:suggestion
5 |
6 | # IDE0037: Use inferred member name
7 | dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
8 |
9 | # IDE0028: Simplify collection initialization
10 | dotnet_style_collection_initializer = false:suggestion
11 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: FortuneN
2 | liberapay: FortuneN
3 | ko_fi: FortuneN
4 | custom: ['https://paypal.me/FortuneNgwenya', 'https://www.buymeacoffee.com/FortuneN']
5 |
--------------------------------------------------------------------------------
/.github/workflows/addVsixLinkToIssues.yaml:
--------------------------------------------------------------------------------
1 | name: Add vsix link comment to issues
2 | on:
3 | workflow_run:
4 | workflows: [Push vsix artifact pull release and comment]
5 | types: [completed]
6 |
7 |
8 | jobs:
9 | vsix-comments:
10 | if: github.event.workflow_run.conclusion=='success' && github.event.workflow_run.event=='pull_request'
11 | name: Add vsix link comment to issues
12 | runs-on: windows-2019
13 | steps:
14 | - name: Add vsix link comment to issues
15 | uses: tonyhallett/artifacts-url-comments@v1.1.0
16 | env:
17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 | with:
19 | prefix: Please try
20 | suffix: Does this resolve your issue ?
21 | format: name
22 | addTo: pullandissues
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | packages
2 |
3 | # User files
4 | *.suo
5 | *.user
6 | *.sln.docstates
7 | .vs/
8 |
9 | # Build results
10 | [Dd]ebug/
11 | [Rr]elease/
12 | x64/
13 | [Bb]in/
14 | [Oo]bj/
15 |
16 | # MSTest test Results
17 | [Tt]est[Rr]esult*/
18 | [Bb]uild[Ll]og.*
19 |
20 | # NCrunch
21 | *.ncrunchsolution
22 | *.ncrunchproject
23 | _NCrunch_WebCompiler
24 | /MSBuild_Logs
25 | /MigrationBackup/f1627d49/FineCodeCoverageTests
26 |
--------------------------------------------------------------------------------
/Art/Options-Global.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/Options-Global.png
--------------------------------------------------------------------------------
/Art/Options-Project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/Options-Project.png
--------------------------------------------------------------------------------
/Art/Output-Coverage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/Output-Coverage.png
--------------------------------------------------------------------------------
/Art/Output-RiskHotspots.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/Output-RiskHotspots.png
--------------------------------------------------------------------------------
/Art/Output-Summary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/Output-Summary.png
--------------------------------------------------------------------------------
/Art/librepay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/librepay.png
--------------------------------------------------------------------------------
/Art/logo-transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/logo-transparent.png
--------------------------------------------------------------------------------
/Art/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/logo.png
--------------------------------------------------------------------------------
/Art/preview-coverage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Art/preview-coverage.png
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Road map
2 |
3 | - [ ] Let me know :)
4 |
5 | Features that have a checkmark are complete and available for download in the [CI build](http://vsixgallery.com/extension/fcc-339fe606-9d51-4fca-895c-d50375137b62/).
6 |
7 | # Change log
8 |
9 | These are the changes to each version that has been released
10 | on the official Visual Studio extension gallery.
11 |
12 | ## 1.0.0
13 |
14 | - [x] Initial release
15 | - [x] Highlight code coverage in the margin on a source file
16 |
--------------------------------------------------------------------------------
/FineCodeCoverage/Key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/FineCodeCoverage/Key.snk
--------------------------------------------------------------------------------
/FineCodeCoverage/dlls/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/FineCodeCoverage/dlls/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
--------------------------------------------------------------------------------
/FineCodeCoverage/dlls/Microsoft.VisualStudio.TestWindow.Interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/FineCodeCoverage/dlls/Microsoft.VisualStudio.TestWindow.Interfaces.dll
--------------------------------------------------------------------------------
/FineCodeCoverage/source.extension.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace FineCodeCoverage
7 | {
8 | internal sealed partial class Vsix
9 | {
10 | public const string Id = "fcc-f339fe606-9d51-4fca-895c-d50375137b62";
11 | public const string Name = "Fine Code Coverage";
12 | public const string Description = @"Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)";
13 | public const string Language = "en-US";
14 | public const string Version = "1.1.0";
15 | public const string Author = "Fortune Ngwenya";
16 | public const string Tags = "visual studio; code coverage; c#; vb; .net core; coverlet; unit test; free; community edition";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FineCodeCoverage2022/dlls/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/FineCodeCoverage2022/dlls/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
--------------------------------------------------------------------------------
/FineCodeCoverage2022/dlls/Microsoft.VisualStudio.TestWindow.Interfaces.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/FineCodeCoverage2022/dlls/Microsoft.VisualStudio.TestWindow.Interfaces.dll
--------------------------------------------------------------------------------
/FineCodeCoverage2022/source.extension.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This file was generated by VSIX Synchronizer
4 | //
5 | // ------------------------------------------------------------------------------
6 | namespace FineCodeCoverage
7 | {
8 | internal sealed partial class Vsix
9 | {
10 | public const string Id = "FineCodeCoverage2022.ad53fb28-7a11-4465-a27a-3550499ea4a1";
11 | public const string Name = "Fine Code Coverage";
12 | public const string Description = @"Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)";
13 | public const string Language = "en-US";
14 | public const string Version = "1.1.0";
15 | public const string Author = "Fortune Ngwenya";
16 | public const string Tags = "visual studio; code coverage; c#; vb; .net core; coverlet; unit test; free; community edition";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/CoverageToolOutput_Tests/CoverageToolOutput_Exports_Tests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using FineCodeCoverage.Engine;
7 | using FineCodeCoverageTests.TestHelpers;
8 | using NUnit.Framework;
9 |
10 | namespace FineCodeCoverageTests
11 | {
12 | class CoverageToolOutput_Exports_Tests
13 | {
14 | [Test]
15 | [Ignore("FileLoadException Microsoft.VisualStudio.Threading")]
16 | public void ICoverageToolOutputFolderProvider_Should_Have_Consistent_Ordered_Exports()
17 | {
18 | MefOrderAssertions.InterfaceExportsHaveConsistentOrder(typeof(ICoverageToolOutputFolderProvider));
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/DynamicCoverage/BlazorGeneratedFilePathMatcher_Tests.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage.ContentTypes.Blazor;
2 | using NUnit.Framework;
3 |
4 | namespace FineCodeCoverageTests.Editor.DynamicCoverage
5 | {
6 | internal class BlazorGeneratedFilePathMatcher_Tests
7 | {
8 | [TestCase("razorpath","razorpath.",true)]
9 | [TestCase("razorpath", "razorpathx.", false)]
10 | public void Should_Be_Generated_If_File_Path_Starts_With_Razor_Path_And_Dot(
11 | string razorFilePath,
12 | string generatedFilePath,
13 | bool expectedIsGenerated
14 | )
15 | {
16 | var isGenerated = new BlazorGeneratedFilePathMatcher().IsBlazorGeneratedFilePath(razorFilePath, generatedFilePath);
17 |
18 | Assert.That(expectedIsGenerated, Is.EqualTo(isGenerated));
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/DynamicCoverage/CPPCoverageContentType_Tests.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage.ContentTypes;
2 | using NUnit.Framework;
3 |
4 | namespace FineCodeCoverageTests.Editor.DynamicCoverage
5 | {
6 | internal class CPPCoverageContentType_Tests
7 | {
8 | [Test]
9 | public void Should_Have_Null_LineExcluder()
10 | {
11 | Assert.That(new CPPCoverageContentType().LineExcluder, Is.Null);
12 | }
13 |
14 | [Test]
15 | public void Should_Have_Null_FileCodeSpanRangeService()
16 | {
17 | Assert.That(new CPPCoverageContentType().FileCodeSpanRangeService, Is.Null);
18 | }
19 |
20 | [Test]
21 | public void Should_Have_CPP_ContentType()
22 | {
23 | Assert.That(new CPPCoverageContentType().ContentTypeName, Is.EqualTo("C/C++"));
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/DynamicCoverage/LineExcluder_Tests.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using NUnit.Framework;
3 |
4 | namespace FineCodeCoverageTests.Editor.DynamicCoverage
5 | {
6 | internal class LineExcluder_Tests
7 | {
8 | [TestCase(new string[0]," ", true)]
9 | [TestCase(new string[0], " x", false)]
10 | [TestCase(new string[] { "y", "x"}, " x", true)]
11 | public void Should_Exclude_If_Not_Code(string[] exclusions, string text, bool expectedExclude)
12 | {
13 | var codeLineExcluder = new LineExcluder(exclusions);
14 | var exclude = codeLineExcluder.ExcludeIfNotCode(text);
15 | Assert.That(exclude, Is.EqualTo(expectedExclude));
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/DynamicCoverage/OtherLinesTracker_Tests.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using NUnit.Framework;
3 |
4 | namespace FineCodeCoverageTests.Editor.DynamicCoverage
5 | {
6 | internal class OtherLinesTracker_Tests
7 | {
8 | [Test]
9 | public void Should_Not_Have_Lines()
10 | {
11 | var otherLinesTracker = new OtherLinesTracker();
12 |
13 | Assert.That(otherLinesTracker.Lines, Is.Empty);
14 | }
15 |
16 | [Test]
17 | public void Should_Never_Have_Updated_Line_Numbers()
18 | {
19 | var otherLinesTracker = new OtherLinesTracker();
20 |
21 | Assert.That(otherLinesTracker.GetUpdatedLineNumbers(null, null, null), Is.Empty);
22 | }
23 |
24 | [Test]
25 | public void Should_Have_Correct_ContainingCodeTrackerType()
26 | {
27 | var otherLinesTracker = new OtherLinesTracker();
28 |
29 | Assert.That(otherLinesTracker.Type, Is.EqualTo(ContainingCodeTrackerType.OtherLines));
30 | }
31 | }
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/Tagging/Base/Types/DummyTag.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text.Tagging;
2 |
3 | namespace FineCodeCoverageTests.Editor.Tagging.Base.Types
4 | {
5 | internal class DummyTag : ITag { }
6 | }
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/Tagging/Base/Types/OtherCoverageTypeFilter.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using FineCodeCoverage.Editor.Tagging.Base;
3 | using FineCodeCoverage.Options;
4 | using System;
5 |
6 | namespace FineCodeCoverageTests.Editor.Tagging.Base.Types
7 | {
8 | internal class OtherCoverageTypeFilter : ICoverageTypeFilter
9 | {
10 | public bool Disabled => throw new NotImplementedException();
11 |
12 | public string TypeIdentifier => "Other";
13 |
14 | public bool Changed(ICoverageTypeFilter other)
15 | {
16 | throw new NotImplementedException();
17 | }
18 |
19 | public void Initialize(IAppOptions appOptions)
20 | {
21 | throw new NotImplementedException();
22 | }
23 |
24 | public bool Show(DynamicCoverageType coverageType)
25 | {
26 | throw new NotImplementedException();
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/Tagging/Types/LineSpan.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using FineCodeCoverage.Editor.Tagging.Base;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverageTests.Editor.Tagging.Types
6 | {
7 | internal class LineSpan : ILineSpan
8 | {
9 | public IDynamicLine Line { get; set; }
10 |
11 | public SnapshotSpan Span { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/FineCodeCoverageTests/Editor/Tagging/Types/SnapshotSpanFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 | using Moq;
3 |
4 | namespace FineCodeCoverageTests.Editor.Tagging.Types
5 | {
6 | public static class SnapshotSpanFactory
7 | {
8 | public static SnapshotSpan Create(int end)
9 | {
10 | var mockTextSnapshot = new Mock();
11 | mockTextSnapshot.SetupGet(textSnapshot => textSnapshot.Length).Returns(end + 1);
12 | return new SnapshotSpan(mockTextSnapshot.Object, new Span(0, end));
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/FineCodeCoverageTests/RunSettingsCoverletConfigurationFactory_Tests.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Core.Coverlet;
2 | using FineCodeCoverage.Engine.Coverlet;
3 | using NUnit.Framework;
4 |
5 | namespace Test
6 | {
7 | public class RunSettingsCoverletConfigurationFactory_Tests
8 | {
9 | [Test]
10 | public void Should_Create_An_Instance_Of_RunSettingsCoverletConfiguration()
11 | {
12 | var runSettingsCoverletConfigurationFactory = new RunSettingsCoverletConfigurationFactory();
13 | Assert.IsInstanceOf(runSettingsCoverletConfigurationFactory.Create());
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/FineCodeCoverageTests/TestHelpers/ExportsInitializable.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Core.Initialization;
2 | using NUnit.Framework;
3 | using System;
4 | using System.ComponentModel.Composition;
5 | using System.Linq;
6 |
7 | namespace FineCodeCoverageTests.Test_helpers
8 | {
9 | internal static class ExportsInitializable
10 | {
11 | public static void Should_Export_IInitializable(Type type)
12 | {
13 | var exportsIInitializable = type.GetCustomAttributes(typeof(ExportAttribute), false).Any(ea => (ea as ExportAttribute).ContractType == typeof(IInitializable));
14 | Assert.That(exportsIInitializable, Is.True);
15 | Assert.That(type.GetInterfaces().Any(i => i == typeof(IInitializable)), Is.True);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/TestHelpers/MoqAssertionsHelper.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 |
3 | namespace FineCodeCoverageTests.TestHelpers
4 | {
5 | internal static class MoqAssertionsHelper
6 | {
7 | public static Times ExpectedTimes(bool expected) => expected ? Times.Once() : Times.Never();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/TestHelpers/MoqExtensions.cs:
--------------------------------------------------------------------------------
1 | using Moq;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace FineCodeCoverageTests.TestHelpers
6 | {
7 | internal static class MoqExtensions
8 | {
9 | public static IEnumerable GetMethodInvocations(this IInvocationList invocationList, string methodName)
10 | {
11 | return invocationList.Where(invocation => invocation.Method.Name == methodName);
12 | }
13 |
14 | public static IEnumerable> GetMethodInvocationArguments(this IInvocationList invocationList, string methodName)
15 | {
16 | return invocationList.GetMethodInvocations(methodName).Select(invocation => invocation.Arguments);
17 | }
18 |
19 | public static IEnumerable GetMethodInvocationSingleArgument(this IInvocationList invocationList, string methodName)
20 | {
21 | return invocationList.GetMethodInvocationArguments(methodName).Select(args => (T)args.Single());
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/TestHelpers/MoqMatchers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Moq;
5 |
6 | namespace FineCodeCoverageTests.TestHelpers
7 | {
8 | internal static class MoqMatchers
9 | {
10 | internal static IEnumerable EnumerableExpected(IEnumerable expected, Func comparer)
11 | {
12 | return Match.Create>(enumerableArg =>
13 | {
14 | var list = enumerableArg.ToList();
15 | var expectedList = expected.ToList();
16 | if (list.Count != expectedList.Count)
17 | {
18 | return false;
19 | }
20 | for (var i = 0; i < list.Count; i++)
21 | {
22 | if (!comparer(list[i], expectedList[i]))
23 | {
24 | return false;
25 | }
26 | }
27 | return true;
28 | });
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/TestHelpers/XmlAssert.cs:
--------------------------------------------------------------------------------
1 | using NUnit.Framework;
2 | using Org.XmlUnit.Builder;
3 |
4 | namespace FineCodeCoverageTests.TestHelpers
5 | {
6 | internal static class XmlAssert
7 | {
8 | public static void NoXmlDifferences(string actual, string expected)
9 | {
10 | var diff = DiffBuilder.Compare(Input.FromString(expected)).WithTest(Input.FromString(actual)).Build();
11 | Assert.IsFalse(diff.HasDifferences());
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FineCodeCoverageTests/ToolUnzipper_Tests.cs:
--------------------------------------------------------------------------------
1 | using AutoMoq;
2 | using FineCodeCoverage.Core.Utilities;
3 | using NUnit.Framework;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 | namespace FineCodeCoverageTests
12 | {
13 | internal class ToolUnzipper_Tests
14 | {
15 | [Test]
16 | public void Should_Delegate_To_ToolFolder_With_the_Provided_ZipDetails()
17 | {
18 | var mocker = new AutoMoqer();
19 | var toolUnzipper = mocker.Create();
20 | var zipDetails = new ZipDetails { Path = "path", Version = "version" };
21 | mocker.Setup(toolZipProvider => toolZipProvider.ProvideZip("zipPrefix")).Returns(zipDetails);
22 |
23 | var ct = CancellationToken.None;
24 | toolUnzipper.EnsureUnzipped("appDataFolder", "ownFolderName", "zipPrefix", ct);
25 |
26 | mocker.Verify(toolFolder => toolFolder.EnsureUnzipped("appDataFolder", "ownFolderName", zipDetails, ct));
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Installed product versions
2 | - Visual Studio: [example 2015 Professional]
3 | - This extension: [example 1.1.21]
4 |
5 | ### Description
6 | Replace this text with a short description
7 |
8 | ### Steps to recreate
9 | 1. Replace this
10 | 2. text with
11 | 3. the steps
12 | 4. to recreate
13 |
14 | ### Current behavior
15 | Explain what it's doing and why it's wrong
16 |
17 | ### Expected behavior
18 | Explain what it should be doing after it's fixed.
19 |
20 | ### Side Notes
21 | - It helps to attach a repro solution so i can test the fix
22 | - It helps to attach the log (send it to my mailbox if you need todo so privately : fortunengwenya@gmail.com)
23 | - It helps to attach a screen recoding video of steps to recreate (sometimes a video is worth a thousand words)
24 | - Please consider giving this project a star and become one of the stagazers
25 | https://github.com/FortuneN/FineCodeCoverage/stargazers
26 | - Please consider buying me a coffee
27 | https://paypal.me/FortuneNgwenya (Once) OR https://liberapay.com/FortuneN/donate (Recurring)
28 | - Please consider rating and/or reviewing
29 | https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage&ssr=false#review-details
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2020 Fortune Ngwenya
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/ReportGeneratorPlugins/FccDarkReportBuilder.cs:
--------------------------------------------------------------------------------
1 | using Palmmedia.ReportGenerator.Core.Parser.Analysis;
2 | using Palmmedia.ReportGenerator.Core.Reporting.Builders;
3 | using System.Collections.Generic;
4 |
5 | namespace ReportGeneratorPlugins
6 | {
7 | public class FccDarkReportBuilder : HtmlInlineAzurePipelinesDarkReportBuilder
8 | {
9 | public static string REPORT_TYPE = "FccDark";
10 |
11 | public override string ReportType => REPORT_TYPE;
12 |
13 | public override void CreateClassReport(Class @class, IEnumerable fileAnalyses)
14 | {
15 | // ignore
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ReportGeneratorPlugins/FccLightReportBuilder.cs:
--------------------------------------------------------------------------------
1 | using Palmmedia.ReportGenerator.Core.Parser.Analysis;
2 | using Palmmedia.ReportGenerator.Core.Reporting.Builders;
3 | using System.Collections.Generic;
4 |
5 | namespace ReportGeneratorPlugins
6 | {
7 | public class FccLightReportBuilder : HtmlInlineAzurePipelinesReportBuilder
8 | {
9 | public static string REPORT_TYPE = "FccLight";
10 |
11 | public override string ReportType => REPORT_TYPE;
12 |
13 | public override void CreateClassReport(Class @class, IEnumerable fileAnalyses)
14 | {
15 | // ignore
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ReportGeneratorPlugins/ReportGeneratorPlugins.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 | ..\Shared Files\ZippedTools\ReportGenerator.Core.dll
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Shared Files/Resources/ClearUICommand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/Resources/ClearUICommand.png
--------------------------------------------------------------------------------
/Shared Files/Resources/OutputToolWindowCommand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/Resources/OutputToolWindowCommand.png
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/ReportGenerator.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/ReportGenerator.Core.dll
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/coverlet.collector.6.0.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/coverlet.collector.6.0.4.zip
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/coverlet.console.6.0.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/coverlet.console.6.0.4.zip
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/dotnet-coverage.17.14.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/dotnet-coverage.17.14.2.zip
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/microsoft.codecoverage.17.13.0.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/microsoft.codecoverage.17.13.0.zip
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/microsoft.testplatform.16.9.1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/microsoft.testplatform.16.9.1.zip
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/openCover.4.7.1221.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/openCover.4.7.1221.zip
--------------------------------------------------------------------------------
/Shared Files/ZippedTools/reportGenerator.4.7.4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/6051fbd7f9178712e64ccaaba1da1db5a2ee909d/Shared Files/ZippedTools/reportGenerator.4.7.4.zip
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/CoberturaDerializer.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Serialization;
2 | using System.Xml;
3 | using System.ComponentModel.Composition;
4 | using System.Diagnostics.CodeAnalysis;
5 |
6 | namespace FineCodeCoverage.Engine.Cobertura
7 | {
8 | [ExcludeFromCodeCoverage]
9 | [Export(typeof(ICoberturaDeserializer))]
10 | internal class CoberturaDerializer : ICoberturaDeserializer
11 | {
12 | private readonly XmlSerializer xmlSerializer = new XmlSerializer(typeof(CoverageReport));
13 | private readonly XmlReaderSettings xmlReaderSettings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore };
14 | public CoverageReport Deserialize(string xmlFile)
15 | {
16 | using (var reader = XmlReader.Create(xmlFile, xmlReaderSettings))
17 | {
18 | var report = (CoverageReport)xmlSerializer.Deserialize(reader);
19 | return report;
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/CoverageType.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Model
2 | {
3 | public enum CoverageType { Covered, Partial, NotCovered }
4 | }
5 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/FileLineCoverageFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Engine.Cobertura
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(IFileLineCoverageFactory))]
9 | internal class FileLineCoverageFactory : IFileLineCoverageFactory
10 | {
11 | public IFileLineCoverage Create() => new FileLineCoverage();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/ICoberturaDeserializer.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Cobertura
2 | {
3 | internal interface ICoberturaDeserializer
4 | {
5 | CoverageReport Deserialize(string xmlFile);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/ICoberturaUtil.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 |
3 | namespace FineCodeCoverage.Engine.Cobertura
4 | {
5 | interface ICoberturaUtil
6 | {
7 | IFileLineCoverage ProcessCoberturaXml(string xmlFile);
8 | string[] GetSourceFiles(string assemblyName, string qualifiedClassName, int file);
9 | }
10 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/IFileLineCoverage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Engine.Model
4 | {
5 | internal interface IFileLineCoverage
6 | {
7 | void Add(string filename, IEnumerable line);
8 | IEnumerable GetLines(string filePath);
9 | void Sort();
10 | void UpdateRenamed(string oldFile, string newFile);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/IFileLineCoverageFactory.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 |
3 | namespace FineCodeCoverage.Engine.Cobertura
4 | {
5 | internal interface IFileLineCoverageFactory
6 | {
7 | IFileLineCoverage Create();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/ILine.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Model
2 | {
3 | internal interface ILine
4 | {
5 | int Number { get; }
6 | CoverageType CoverageType { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Class.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Xml.Serialization;
4 |
5 | namespace FineCodeCoverage.Engine.Cobertura
6 | {
7 | [XmlRoot(ElementName = "class")]
8 | [ExcludeFromCodeCoverage]
9 | public class Class
10 | {
11 | [XmlArray(ElementName = "methods")]
12 | [XmlArrayItem(ElementName = "method")]
13 | public List Methods { get; set; }
14 |
15 | [XmlArray(ElementName = "lines")]
16 | [XmlArrayItem(ElementName = "line")]
17 | public List Lines { get; set; }
18 |
19 | [XmlAttribute(AttributeName = "name")]
20 | public string Name { get; set; }
21 |
22 | [XmlAttribute(AttributeName = "filename")]
23 | public string Filename { get; set; }
24 |
25 | [XmlAttribute(AttributeName = "line-rate")]
26 | public float LineRate { get; set; }
27 |
28 | [XmlAttribute(AttributeName = "branch-rate")]
29 | public float BranchRate { get; set; }
30 |
31 | [XmlAttribute(AttributeName = "complexity")]
32 | public float Complexity { get; set; }
33 | }
34 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Condition.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Xml.Serialization;
3 |
4 | // Generated from cobertura XML schema
5 |
6 | namespace FineCodeCoverage.Engine.Cobertura
7 | {
8 | [XmlRoot(ElementName = "condition")]
9 | [ExcludeFromCodeCoverage]
10 | public class Condition
11 | {
12 | [XmlAttribute(AttributeName = "number")]
13 | public string Number { get; set; }
14 |
15 | [XmlAttribute(AttributeName = "type")]
16 | public string Type { get; set; }
17 |
18 | [XmlAttribute(AttributeName = "coverage")]
19 | public string Coverage { get; set; }
20 | }
21 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Conditions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Xml.Serialization;
4 |
5 | // Generated from cobertura XML schema
6 |
7 | namespace FineCodeCoverage.Engine.Cobertura
8 | {
9 | [XmlRoot(ElementName = "conditions")]
10 | [ExcludeFromCodeCoverage]
11 | public class Conditions
12 | {
13 | [XmlElement(ElementName = "condition")]
14 | public List Condition { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Line.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Xml.Serialization;
3 |
4 | // Generated from cobertura XML schema
5 |
6 | namespace FineCodeCoverage.Engine.Cobertura
7 | {
8 | [XmlRoot(ElementName = "line")]
9 | [ExcludeFromCodeCoverage]
10 | public class Line
11 | {
12 | [XmlAttribute(AttributeName = "number")]
13 | public int Number { get; set; }
14 |
15 | [XmlAttribute(AttributeName = "hits")]
16 | public int Hits { get; set; }
17 |
18 | [XmlAttribute(AttributeName = "branch")]
19 | public string Branch { get; set; }
20 |
21 | [XmlElement(ElementName = "conditions")]
22 | public Conditions Conditions { get; set; }
23 |
24 | [XmlAttribute(AttributeName = "condition-coverage")]
25 | public string ConditionCoverage { get; set; }
26 |
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Method.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Xml.Serialization;
4 |
5 | // Generated from cobertura XML schema
6 |
7 | namespace FineCodeCoverage.Engine.Cobertura
8 | {
9 | [XmlRoot(ElementName = "method")]
10 | [ExcludeFromCodeCoverage]
11 | public class Method
12 | {
13 | [XmlArray(ElementName = "lines")]
14 | [XmlArrayItem(ElementName = "line")]
15 | public List Lines { get; set; }
16 |
17 | [XmlAttribute(AttributeName = "name")]
18 | public string Name { get; set; }
19 |
20 | [XmlAttribute(AttributeName = "signature")]
21 | public string Signature { get; set; }
22 |
23 | [XmlAttribute(AttributeName = "line-rate")]
24 | public float LineRate { get; set; }
25 |
26 | [XmlAttribute(AttributeName = "branch-rate")]
27 | public float BranchRate { get; set; }
28 | }
29 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Package.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Xml.Serialization;
4 |
5 | namespace FineCodeCoverage.Engine.Cobertura
6 | {
7 | [XmlRoot(ElementName = "package")]
8 | [ExcludeFromCodeCoverage]
9 | public class Package
10 | {
11 | [XmlArray(ElementName = "classes")]
12 | [XmlArrayItem(ElementName = "class")]
13 | public List Classes { get; set; }
14 |
15 | [XmlAttribute(AttributeName = "name")]
16 | public string Name { get; set; }
17 |
18 | [XmlAttribute(AttributeName = "line-rate")]
19 | public float LineRate { get; set; }
20 |
21 | [XmlAttribute(AttributeName = "branch-rate")]
22 | public float BranchRate { get; set; }
23 |
24 | [XmlAttribute(AttributeName = "complexity")]
25 | public float Complexity { get; set; }
26 | }
27 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Cobertura/Report/Sources.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 | using System.Xml.Serialization;
3 |
4 | // Generated from cobertura XML schema
5 |
6 | namespace FineCodeCoverage.Engine.Cobertura
7 | {
8 | [XmlRoot(ElementName = "sources")]
9 | [ExcludeFromCodeCoverage]
10 | public class Sources
11 | {
12 | [XmlElement(ElementName = "source")]
13 | public string Source { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageToolOutput/ICoverageToolOutputFolderProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FineCodeCoverage.Engine.Model;
3 |
4 | namespace FineCodeCoverage.Engine
5 | {
6 | internal interface ICoverageToolOutputFolderProvider
7 | {
8 | string Provide(List coverageProjects);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageToolOutput/ICoverageToolOutputFolderSolutionProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Engine
4 | {
5 | interface ICoverageToolOutputFolderSolutionProvider
6 | {
7 | string Provide(Func solutionFolderProvider);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageToolOutput/ICoverageToolOutputManager.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FineCodeCoverage.Engine.Model;
3 |
4 | namespace FineCodeCoverage.Engine
5 | {
6 | internal interface ICoverageToolOutputManager
7 | {
8 | void SetProjectCoverageOutputFolder(List coverageProjects);
9 | string GetReportOutputFolder();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageToolOutput/ISolutionFolderProvider.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine
2 | {
3 | interface ISolutionFolderProvider
4 | {
5 | string Provide(string projectFile);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageToolOutput/OutdatedOutputMessage.cs:
--------------------------------------------------------------------------------
1 | namespace SharedProject.Core.CoverageToolOutput
2 | {
3 | internal class OutdatedOutputMessage
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageToolOutput/SolutionFolderProvider.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.IO;
3 | using System.Linq;
4 |
5 | namespace FineCodeCoverage.Engine
6 | {
7 | [Export(typeof(ISolutionFolderProvider))]
8 | class SolutionFolderProvider : ISolutionFolderProvider
9 | {
10 | public string Provide(string projectFile)
11 | {
12 | string provided = null;
13 | var directory = new FileInfo(projectFile).Directory;
14 | while (directory != null)
15 | {
16 | var isSolutionDirectory = directory.EnumerateFiles().Any(IsSolutionFile);
17 | if (isSolutionDirectory)
18 | {
19 | provided = directory.FullName;
20 | break;
21 | }
22 | directory = directory.Parent;
23 | }
24 | return provided;
25 | }
26 |
27 | private bool IsSolutionFile(FileInfo fileInfo)
28 | {
29 | return fileInfo.Name.EndsWith(".sln") || fileInfo.Name.EndsWith(".slnx");
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/SharedProject/Core/CoverageUIEvents.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Engine
4 | {
5 | internal class UpdateMarginTagsEventArgs : EventArgs {
6 | }
7 |
8 | internal delegate void UpdateMarginTagsDelegate(UpdateMarginTagsEventArgs e);
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/Console/ICoverletConsoleExecutor.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Core.Utilities;
2 | using FineCodeCoverage.Engine.Model;
3 | using FineCodeCoverage.Options;
4 |
5 | namespace FineCodeCoverage.Engine.Coverlet
6 | {
7 | internal interface ICoverletConsoleExecutor
8 | {
9 | ExecuteRequest GetRequest(ICoverageProject coverageProject,string coverletSettings);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/Console/ICoverletConsoleUtil.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Engine.Coverlet
6 | {
7 | internal interface ICoverletConsoleUtil
8 | {
9 | void Initialize(string appDataFolder, CancellationToken cancellationToken);
10 | Task RunAsync(ICoverageProject project, CancellationToken cancellationToken);
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/Console/IDotNetToolListCoverlet.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Coverlet
2 | {
3 | internal class CoverletToolDetails
4 | {
5 | public string Version { get; set; }
6 | public string Command { get; set; }
7 | }
8 |
9 | internal interface IDotNetToolListCoverlet
10 | {
11 | CoverletToolDetails Local(string directory);
12 | CoverletToolDetails Global();
13 | CoverletToolDetails GlobalToolsPath(string directory);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/Console/IFCCCoverletConsoleExecutor.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 |
3 | namespace FineCodeCoverage.Engine.Coverlet
4 | {
5 | internal interface IFCCCoverletConsoleExecutor : ICoverletConsoleExecutor
6 | {
7 | void Initialize(string appDataFolder, CancellationToken cancellationToken);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/DataCollectorSettingsBuilderFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using FineCodeCoverage.Options;
3 | namespace FineCodeCoverage.Engine.Coverlet
4 | {
5 | [Export(typeof(IDataCollectorSettingsBuilderFactory))]
6 | internal class DataCollectorSettingsBuilderFactory : IDataCollectorSettingsBuilderFactory
7 | {
8 | public IDataCollectorSettingsBuilder Create()
9 | {
10 | return new DataCollectorSettingsBuilder();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/RunSettingsCoverletConfigurationFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using FineCodeCoverage.Core.Coverlet;
3 |
4 | namespace FineCodeCoverage.Engine.Coverlet
5 | {
6 | [Export(typeof(IRunSettingsCoverletConfigurationFactory))]
7 | internal class RunSettingsCoverletConfigurationFactory : IRunSettingsCoverletConfigurationFactory
8 | {
9 | public IRunSettingsCoverletConfiguration Create()
10 | {
11 | return new RunSettingsCoverletConfiguration();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/interfaces/ICoverletDataCollectorGeneratedCobertura.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Coverlet
2 | {
3 | internal interface ICoverletDataCollectorGeneratedCobertura
4 | {
5 | void CorrectPath(string coverageOutputFolder, string coverageOutputFile);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/interfaces/ICoverletDataCollectorUtil.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Engine.Coverlet
6 | {
7 | internal interface ICoverletDataCollectorUtil
8 | {
9 | bool CanUseDataCollector(ICoverageProject coverageProject);
10 | Task RunAsync(CancellationToken cancellationToken);
11 |
12 | void Initialize(string appDataFolder, CancellationToken cancellationToken);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/interfaces/IDataCollectorSettingsBuilderFactory.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Coverlet
2 | {
3 | internal interface IDataCollectorSettingsBuilderFactory
4 | {
5 | IDataCollectorSettingsBuilder Create();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/interfaces/IRunSettingsCoverletConfiguration.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Coverlet
2 | {
3 | internal enum CoverletDataCollectorState { NotPresent, Enabled, Disabled }
4 | internal interface IRunSettingsCoverletConfiguration
5 | {
6 | CoverletDataCollectorState CoverletDataCollectorState { get; }
7 | string Format { get; }
8 |
9 | string Exclude { get; }
10 | string Include { get; }
11 | string ExcludeByAttribute { get; }
12 | string ExcludeByFile { get; }
13 | string IncludeDirectory { get; }
14 | string SingleHit { get; }
15 | string UseSourceLink { get; }
16 | string IncludeTestAssembly { get; }
17 | string SkipAutoProps { get; }
18 | bool Read(string runSettingsXml);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/DataCollector/interfaces/IRunSettingsCoverletConfigurationFactory.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Core.Coverlet;
2 |
3 | namespace FineCodeCoverage.Engine.Coverlet
4 | {
5 | internal interface IRunSettingsCoverletConfigurationFactory
6 | {
7 | IRunSettingsCoverletConfiguration Create();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Coverlet/ICoverletUtil.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Engine.Coverlet
6 | {
7 | internal interface ICoverletUtil {
8 | void Initialize(string appDataFolder, CancellationToken cancellationToken);
9 | Task RunCoverletAsync(ICoverageProject project, CancellationToken cancellationToken);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/EnvironmentVariable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 |
4 | namespace FineCodeCoverage.Engine
5 | {
6 | [Export(typeof(IEnvironmentVariable))]
7 | internal class EnvironmentVariable : IEnvironmentVariable
8 | {
9 | public string Get(string variable)
10 | {
11 | var result = Environment.GetEnvironmentVariable(variable);
12 | return result;
13 | }
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/SharedProject/Core/IAppDataFolder.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine
2 | {
3 | internal interface IAppDataFolder
4 | {
5 | string DirectoryPath { get; }
6 | void Initialize(System.Threading.CancellationToken cancellationToken);
7 |
8 | }
9 |
10 | }
--------------------------------------------------------------------------------
/SharedProject/Core/ICoverageUtilManager.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Engine
6 | {
7 | internal interface ICoverageUtilManager
8 | {
9 | void Initialize(string appDataFolder, CancellationToken cancellationToken);
10 | Task RunCoverageAsync(ICoverageProject project, CancellationToken cancellationToken);
11 | string CoverageToolName(ICoverageProject project);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Core/IEnvironmentVariable.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine
2 | {
3 | internal interface IEnvironmentVariable
4 | {
5 | string Get(string variable);
6 | }
7 |
8 | }
--------------------------------------------------------------------------------
/SharedProject/Core/IFCCEngine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Engine
6 | {
7 | internal interface IFCCEngine
8 | {
9 | string AppDataFolderPath { get; }
10 | void Initialize(System.Threading.CancellationToken cancellationToken);
11 | void StopCoverage();
12 | void ReloadCoverage(Func>> coverageRequestCallback);
13 | void RunAndProcessReport(string[] coberturaFiles,Action cleanUp = null);
14 | void ClearUI(bool clearOutputWindowHistory = true);
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/SharedProject/Core/IMessageBox.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine
2 | {
3 | internal interface IMessageBox
4 | {
5 | void Show(string message);
6 | }
7 |
8 | }
--------------------------------------------------------------------------------
/SharedProject/Core/ISourceFileOpener.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace FineCodeCoverage.Engine
4 | {
5 | internal interface ISourceFileOpener
6 | {
7 | Task OpenFileAsync(string assemblyName, string qualifiedClassName, int file, int line);
8 | }
9 |
10 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Initialization/IFirstTimeToolWindowOpener.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Core.Initialization
5 | {
6 | internal interface IFirstTimeToolWindowOpener
7 | {
8 | Task OpenIfFirstTimeAsync(CancellationToken cancellationToken);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Initialization/IInitializeStatusProvider.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Initialization
2 | {
3 | internal interface IInitializeStatusProvider
4 | {
5 | InitializeStatus InitializeStatus { get; set; }
6 | string InitializeExceptionMessage { get; set; }
7 | }
8 |
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Initialization/IInitializedFromTestContainerDiscoverer.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Initialization
2 | {
3 | internal interface IInitializedFromTestContainerDiscoverer
4 | {
5 | bool InitializedFromTestContainerDiscoverer { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Initialization/IInitializer.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Core.Initialization
5 | {
6 | internal interface IInitializer : IInitializeStatusProvider
7 | {
8 | Task InitializeAsync(CancellationToken cancellationToken);
9 | }
10 |
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Initialization/IPackageLoader.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace FineCodeCoverage.Core.Initialization
4 | {
5 | internal interface IPackageLoader
6 | {
7 | Task LoadPackageAsync(System.Threading.CancellationToken cancellationToken);
8 | }
9 |
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Initialization/InitializeStatus.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Initialization
2 | {
3 | internal enum InitializeStatus { Initializing, Initialized, Error };
4 |
5 | }
--------------------------------------------------------------------------------
/SharedProject/Core/MessageBoxWrapper.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Windows;
4 |
5 | namespace FineCodeCoverage.Engine
6 | {
7 | [Export(typeof(IMessageBox))]
8 | [ExcludeFromCodeCoverage]
9 | internal class MessageBoxWrapper : IMessageBox
10 | {
11 | public void Show(string message)
12 | {
13 | MessageBox.Show(message);
14 | }
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Model/CoverageProjectFileSynchronizationDetails.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace FineCodeCoverage.Engine.Model
6 | {
7 | internal class CoverageProjectFileSynchronizationDetails
8 | {
9 | public List Logs { get; set; } = new List();
10 | public TimeSpan Duration { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ICoverageProjectFactory.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Model
2 | {
3 | internal interface ICoverageProjectFactory
4 | {
5 | ICoverageProject Create();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ICoverageProjectSettingsManager.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Options;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Engine.Model
5 | {
6 | internal interface ICoverageProjectSettingsManager
7 | {
8 | Task GetSettingsAsync(ICoverageProject coverageProject);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ICoverageProjectSettingsProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using System.Xml.Linq;
3 |
4 | namespace FineCodeCoverage.Engine.Model
5 | {
6 | internal interface ICoverageProjectSettingsProvider
7 | {
8 | Task ProvideAsync(ICoverageProject coverageProject);
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/IFCCSettingsFilesProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Xml.Linq;
3 |
4 | namespace FineCodeCoverage.Engine.Model
5 | {
6 | internal interface IFCCSettingsFilesProvider
7 | {
8 | List Provide(string projectPath);
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ISettingsMerger.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Options;
2 | using System.Collections.Generic;
3 | using System.Xml.Linq;
4 |
5 | namespace FineCodeCoverage.Engine.Model
6 | {
7 | internal interface ISettingsMerger
8 | {
9 | IAppOptions Merge(
10 | IAppOptions globalOptions,
11 | List settingsFileElements,
12 | XElement projectSettingsElement
13 | );
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/IVsBuildFCCSettingsProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using System.Xml.Linq;
4 |
5 | namespace FineCodeCoverage.Engine.Model
6 | {
7 | internal interface IVsBuildFCCSettingsProvider
8 | {
9 | Task GetSettingsAsync(Guid projectId);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/ICPPReferencedProjectsHelper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.VCProjectEngine;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 |
5 | namespace FineCodeCoverage.Engine.Model
6 | {
7 | internal interface ICPPReferencedProjectsHelper
8 | {
9 | Task> GetInstrumentableReferencedProjectsAsync(VCProject cppProject);
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/IDotNetReferencedProjectsHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using VSLangProj;
4 |
5 | namespace FineCodeCoverage.Engine.Model
6 | {
7 | internal interface IDotNetReferencedProjectsHelper
8 | {
9 | Task> GetReferencedProjectsAsync(VSProject vsProject);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/IExcludableReferencedProject.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Model
2 | {
3 | interface IExcludableReferencedProject : IReferencedProject
4 | {
5 | bool ExcludeFromCodeCoverage { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/IProjectFileReferencedProjectsHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Xml.Linq;
3 |
4 | namespace FineCodeCoverage.Engine.Model
5 | {
6 | interface IProjectFileReferencedProjectsHelper
7 | {
8 | List GetReferencedProjects(string projectFile, XElement projectFileXElement);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/IReferencedProject.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.Model
2 | {
3 | internal interface IReferencedProject
4 | {
5 | string AssemblyName { get; }
6 | bool IsDll { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/IReferencedProjectsHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 | using System.Xml.Linq;
5 |
6 | namespace FineCodeCoverage.Engine.Model
7 | {
8 | internal interface IReferencedProjectsHelper
9 | {
10 |
11 | // todo - should not need ms build workspaces or parsing the project file
12 | Task> GetReferencedProjectsAsync(
13 | string projectFile, Func projectFileXElementProvider);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/Model/ReferencedProjects/IVsApiReferencedProjectsHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Engine.Model
5 | {
6 | internal interface IVsApiReferencedProjectsHelper
7 | {
8 | Task> GetReferencedProjectsAsync(string projectFile);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/ICoverageProjectRunSettings.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 |
3 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
4 | {
5 | internal interface ICoverageProjectRunSettings
6 | {
7 | ICoverageProject CoverageProject { get; set; }
8 | string RunSettings { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/ICustomRunSettingsTemplateProvider.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
2 | {
3 | public class CustomRunSettingsTemplateDetails
4 | {
5 | public string Template { get; set; }
6 | public string Path { get; set; }
7 | }
8 | internal interface ICustomRunSettingsTemplateProvider
9 | {
10 | CustomRunSettingsTemplateDetails Provide(string projectDirectory, string solutionDirectory);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IMsCodeCoverageRunSettingsService.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Impl;
2 | using Microsoft.VisualStudio.TestWindow.Extensibility;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
7 | {
8 | interface IMsCodeCoverageRunSettingsService
9 | {
10 | void Initialize(string appDataFolder,IFCCEngine fccEngine, CancellationToken cancellationToken);
11 | Task IsCollectingAsync(ITestOperation testOperation);
12 | Task CollectAsync(IOperation operation, ITestOperation testOperation);
13 | void StopCoverage();
14 | Task TestExecutionNotFinishedAsync(ITestOperation testOperation);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IProjectRunSettingsGenerator.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 |
5 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
6 | {
7 |
8 | internal interface IProjectRunSettingsGenerator
9 | {
10 | Task RemoveGeneratedProjectSettingsAsync(IEnumerable coverageProjects);
11 | Task WriteProjectsRunSettingsAsync(IEnumerable coverageProjectsRunSettings);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IRunSettingsTemplateReplacements.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
2 | {
3 | // string values for string.Replace of templated values - e.g %fcc_modulepaths_exclude%
4 | internal interface IRunSettingsTemplateReplacements
5 | {
6 | string Enabled { get; }
7 | string ResultsDirectory { get; }
8 | string TestAdapter { get; }
9 |
10 | // the following are xml fragments as strings
11 | // e.g path1path2
12 | string ModulePathsExclude { get; }
13 | string ModulePathsInclude { get; }
14 | string FunctionsExclude { get; }
15 | string FunctionsInclude { get; }
16 | string AttributesExclude { get; }
17 | string AttributesInclude { get; }
18 | string SourcesExclude { get; }
19 | string SourcesInclude { get; }
20 | string CompanyNamesExclude { get; }
21 | string CompanyNamesInclude { get; }
22 | string PublicKeyTokensExclude { get; }
23 | string PublicKeyTokensInclude { get; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IRunSettingsTemplateReplacementsFactory.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using Microsoft.VisualStudio.TestWindow.Extensibility;
3 | using System.Collections.Generic;
4 |
5 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
6 | {
7 | internal interface IRunSettingsTemplateReplacementsFactory
8 | {
9 | IRunSettingsTemplateReplacements Create(
10 | IEnumerable testContainers,
11 | Dictionary userRunSettingsProjectDetailsLookup,
12 | string testAdapter
13 | );
14 |
15 | IRunSettingsTemplateReplacements Create(ICoverageProject coverageProject, string testAdapter);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IShimCopier.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using System.Collections.Generic;
3 |
4 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
5 | {
6 | internal interface IShimCopier
7 | {
8 | void Copy(string shimPath, IEnumerable coverageProjects);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IUserRunSettingsProjectDetails.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using FineCodeCoverage.Options;
3 | using System.Collections.Generic;
4 |
5 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
6 | {
7 | internal interface IUserRunSettingsProjectDetails
8 | {
9 | List ExcludedReferencedProjects { get; set; }
10 | List IncludedReferencedProjects { get; set; }
11 | string CoverageOutputFolder { get; set; }
12 | IMsCodeCoverageOptions Settings { get; set; }
13 | string TestDllFile { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IUserRunSettingsService.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using Microsoft.VisualStudio.TestWindow.Extensibility;
3 | using System.Collections.Generic;
4 | using System.Xml.XPath;
5 |
6 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
7 | {
8 | internal interface IUserRunSettingsAnalysisResult {
9 | bool Suitable { get; }
10 | bool SpecifiedMsCodeCoverage { get; }
11 | List ProjectsWithFCCMsTestAdapter { get; }
12 | }
13 |
14 | internal interface IUserRunSettingsService
15 | {
16 | IUserRunSettingsAnalysisResult Analyse(IEnumerable coverageProjectsWithRunSettings, bool useMsCodeCoverage, string fccMsTestAdapterPath);
17 | IXPathNavigable AddFCCRunSettings(IXPathNavigable inputRunSettingDocument, IRunSettingsConfigurationInfo configurationInfo, Dictionary userRunSettingsProjectDetailsLookup, string fccMsTestAdapterPath);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/IVsRunSettingsWriter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
5 | {
6 | internal interface IVsRunSettingsWriter
7 | {
8 | Task RemoveRunSettingsFilePathAsync(Guid projectGuid);
9 | Task WriteRunSettingsFilePathAsync(Guid projectGuid, string projectRunSettingsFilePath);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/MsCodeCoverageCollectionStatus.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
2 | {
3 | internal enum MsCodeCoverageCollectionStatus { NotCollecting, Collecting, Error }
4 | }
5 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/MsCodeCoverageIOperationExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Microsoft.VisualStudio.TestWindow.Extensibility;
4 |
5 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
6 | {
7 | public static class MsCodeCoverageIOperationExtensions
8 | {
9 | public static IEnumerable GetRunSettingsMsDataCollectorResultUri(this IOperation operation)
10 | {
11 | return operation.GetRunSettingsDataCollectorResultUri(new Uri(RunSettingsHelper.MsDataCollectorUri));
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/MsCodeCoverageRegex.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
2 | {
3 | internal static class MsCodeCoverageRegex
4 | {
5 | public static string RegexEscapePath(string path)
6 | {
7 | return path.Replace(@"\", @"\\");
8 | }
9 |
10 | public static string RegexModuleName(string moduleName, bool isDll)
11 | {
12 | var extensionMatch = isDll ? "dll" : "(dll|exe)";
13 | return $".*\\\\{EscapeDots(moduleName)}\\.{extensionMatch}$";
14 | }
15 |
16 | private static string EscapeDots(string moduleName)
17 | {
18 | return moduleName.Replace(".", @"\.");
19 | }
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/MsTemplateReplacementException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Xml;
3 |
4 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
5 | {
6 | public class MsTemplateReplacementException : Exception
7 | {
8 | private readonly XmlException innerException;
9 | private readonly string replacedRunSettingsTemplate;
10 | public MsTemplateReplacementException(XmlException innerException, string replacedRunSettingsTemplate)
11 | {
12 | this.innerException = innerException;
13 | this.replacedRunSettingsTemplate = replacedRunSettingsTemplate;
14 | }
15 |
16 | public override string ToString()
17 | {
18 | return $@"${innerException}
19 | Replaced template :
20 | ${replacedRunSettingsTemplate}
21 | ";
22 | }
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/CodeCoverage/XPathNavigatorExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.XPath;
2 |
3 | namespace FineCodeCoverage.Engine.MsTestPlatform.CodeCoverage
4 | {
5 | internal static class XPathNavigatorExtensions
6 | {
7 | public static bool HasChild(this XPathNavigator navigator, string elementName, string nsUri = "")
8 | {
9 | return navigator.Clone().MoveToChild(elementName, nsUri);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/IMsTestPlatformUtil.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Engine.MsTestPlatform
2 | {
3 | interface IMsTestPlatformUtil
4 | {
5 | string MsTestPlatformExePath { get; }
6 | void Initialize(string appDataFolder, System.Threading.CancellationToken cancellationToken);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/MsTestPlatformUtil.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Linq;
3 | using System.ComponentModel.Composition;
4 | using FineCodeCoverage.Core.Utilities;
5 | using System.Threading;
6 |
7 | namespace FineCodeCoverage.Engine.MsTestPlatform
8 | {
9 | [Export(typeof(IMsTestPlatformUtil))]
10 | internal class MsTestPlatformUtil:IMsTestPlatformUtil
11 | {
12 | public string MsTestPlatformExePath { get; private set; }
13 | private readonly IToolUnzipper toolUnzipper;
14 | private const string zipPrefix = "microsoft.testplatform";
15 | private const string zipDirectoryName = "msTestPlatform";
16 |
17 | [ImportingConstructor]
18 | public MsTestPlatformUtil(IToolUnzipper toolUnzipper)
19 | {
20 | this.toolUnzipper = toolUnzipper;
21 | }
22 | public void Initialize(string appDataFolder, CancellationToken cancellationToken)
23 | {
24 | var zipDestination = toolUnzipper.EnsureUnzipped(appDataFolder, zipDirectoryName, zipPrefix, cancellationToken);
25 | MsTestPlatformExePath = Directory
26 | .GetFiles(zipDestination, "vstest.console.exe", SearchOption.AllDirectories)
27 | .FirstOrDefault();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/CPSTestProjectService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell;
2 | using Microsoft.VisualStudio.Shell.Interop;
3 | using System.ComponentModel.Composition;
4 | using System.Threading.Tasks;
5 | using Microsoft.VisualStudio.ProjectSystem;
6 |
7 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
8 | {
9 | [Export(typeof(ICPSTestProjectService))]
10 | internal class CPSTestProjectService : ICPSTestProjectService
11 | {
12 | public async Task GetProjectAsync(IVsHierarchy hierarchy)
13 | {
14 | if (!hierarchy.IsCapabilityMatch("TestContainer"))
15 | {
16 | return null;
17 | }
18 | var unconfiguredProject = await hierarchy.AsUnconfiguredProjectAsync();
19 | if (unconfiguredProject == null) return null;
20 | return await unconfiguredProject.GetSuggestedConfiguredProjectAsync();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/CommandLineParseOption.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
2 | {
3 | /*
4 | adjusted from
5 | https://github.com/microsoft/testfx/blob/main/src/Platform/Microsoft.Testing.Platform/CommandLine/OptionRecord.cs
6 | */
7 | internal sealed class CommandLineParseOption
8 | {
9 | public CommandLineParseOption(string name, string[] arguments)
10 | {
11 | Name = name;
12 | Arguments = arguments;
13 | }
14 | ///
15 | /// Gets the name of the option.
16 | ///
17 | public string Name { get; }
18 |
19 | ///
20 | /// Gets the arguments of the option.
21 | ///
22 | public string[] Arguments { get; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/IBuildHelper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell.Interop;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Threading.Tasks;
5 |
6 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
7 | {
8 | internal class BuildStartEndArgs
9 | {
10 | public BuildStartEndArgs(bool isStart)
11 | {
12 | IsStart = isStart;
13 | }
14 |
15 | public bool IsStart { get; }
16 | }
17 | internal interface IBuildHelper
18 | {
19 | event EventHandler ExternalBuildEvent;
20 | Task BuildAsync(List projects, System.Threading.CancellationToken cancellationToken);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ICPSTestProjectService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.ProjectSystem;
2 | using Microsoft.VisualStudio.Shell.Interop;
3 | using System.Threading.Tasks;
4 |
5 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
6 | {
7 | internal interface ICPSTestProjectService
8 | {
9 | Task GetProjectAsync(IVsHierarchy hierarchy);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/INugetProjectServiceProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Threading;
2 | using NuGet.VisualStudio.Contracts;
3 |
4 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
5 | {
6 | internal interface INugetProjectServiceProvider
7 | {
8 | AsyncLazy LazyNugetProjectService { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/IRunSettingsToConfiguration.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Linq;
2 |
3 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
4 | {
5 | internal interface IRunSettingsToConfiguration
6 | {
7 | XElement ConvertToConfiguration(XElement runSettingsElement);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ISolutionProjectsProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell.Interop;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
7 | {
8 | internal interface ISolutionProjectsProvider
9 | {
10 | Task IsSolutionOpenAsync();
11 | Task> GetLoadedProjectsAsync(CancellationToken cancellationToken );
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitChangeNotifier.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell.Interop;
2 | using System;
3 |
4 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
5 | {
6 | internal class ProjectAddedRemoved
7 | {
8 | public ProjectAddedRemoved(bool added, IVsHierarchy project)
9 | {
10 | Added = added;
11 | Project = project;
12 | }
13 | public bool Added { get; }
14 | public IVsHierarchy Project { get; }
15 | }
16 |
17 | internal interface ITUnitChangeNotifier
18 | {
19 | event EventHandler ProjectAddedRemovedEvent;
20 | event EventHandler SolutionClosedEvent;
21 | event EventHandler SolutionOpenedEvent;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitCoverage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
4 | {
5 | interface ITUnitCoverage
6 | {
7 | bool Ready { get; }
8 |
9 | event EventHandler CollectingChangedEvent;
10 | event EventHandler ReadyEvent;
11 | void CollectCoverage();
12 | void Cancel();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitCoverageProjectFactory.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using Microsoft.VisualStudio.Shell.Interop;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
7 | {
8 | internal interface ITUnitCoverageProject
9 | {
10 | string ExePath { get; }
11 | Task GetConfigurationAsync(CancellationToken cancellationToken);
12 | ICoverageProject CoverageProject { get; }
13 | IVsHierarchy VsHierarchy { get; }
14 | bool HasCoverageExtension { get; }
15 | CommandLineParseResult CommandLineParseResult { get; }
16 | }
17 | internal interface ITUnitCoverageProjectFactory
18 | {
19 | Task CreateTUnitCoverageProjectAsync(
20 | ITUnitProject tUnitProject,CancellationToken cancellationToken);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitInstalledPackagesService.cs:
--------------------------------------------------------------------------------
1 | using NuGet.VisualStudio.Contracts;
2 | using System.Threading.Tasks;
3 | using System.Threading;
4 | using System;
5 | using System.Collections.Immutable;
6 |
7 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
8 | {
9 | internal class TUnitInstalledPackageResult
10 | {
11 | public TUnitInstalledPackageResult(InstalledPackageResultStatus status, bool hasCoverageExtension, bool hasTunit)
12 | {
13 | Status = status;
14 | HasCoverageExtension = hasCoverageExtension;
15 | HasTUnit = hasTunit;
16 | }
17 |
18 | public bool HasTUnit { get; }
19 | public bool HasCoverageExtension { get; }
20 | public InstalledPackageResultStatus Status { get; }
21 | }
22 |
23 | interface ITUnitInstalledPackagesService
24 | {
25 | TUnitInstalledPackageResult GetTUnitInstalledPackages(IImmutableDictionary> packageReferenceItems);
26 | Task GetTUnitInstalledPackagesAsync(Guid projectGuid, CancellationToken cancellationToken);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitProjectCache.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell.Interop;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
7 | {
8 | internal interface ITUnitProjectCache
9 | {
10 | void Initialize(List tUnitProjects);
11 | Task> GetTUnitProjectsAsync(CancellationToken cancellationToken);
12 | void Remove(IVsHierarchy project);
13 | void Add(ITUnitProject iTUnitProject);
14 | void Clear();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitProjectFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.ProjectSystem;
2 | using Microsoft.VisualStudio.Shell.Interop;
3 | using System;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 |
7 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
8 | {
9 | internal interface ITUnitProject : IDisposable
10 | {
11 | bool IsTUnit { get;} // probably will not change
12 | bool HasCoverageExtension { get;} // could change
13 | IVsHierarchy Hierarchy { get; }
14 | Task UpdateStateAsync(CancellationToken cancellationToken);
15 | CommandLineParseResult CommandLineParseResult { get; }
16 | }
17 |
18 | internal interface ITUnitProjectFactory
19 | {
20 | ITUnitProject Create(IVsHierarchy project, ConfiguredProject configuredProject);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitProjectsProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
7 | {
8 | internal interface ITUnitProjectsProvider
9 | {
10 | bool Ready { get; }
11 |
12 | event EventHandler ReadyEvent;
13 | Task> GetTUnitProjectsAsync(CancellationToken cancellationToken);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/ITUnitSettingsProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using System.Threading;
3 |
4 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
5 | {
6 | internal interface ITUnitSettingsProvider
7 | {
8 | Task ProvideAsync(ITUnitCoverageProject tUnitCoverageProject, CancellationToken cancellationToken);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/RunSettingsToConfiguration.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 | using System.Linq;
4 | using System.Xml.Linq;
5 |
6 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
7 | {
8 | [Export(typeof(IRunSettingsToConfiguration))]
9 | internal class RunSettingsToConfiguration : IRunSettingsToConfiguration
10 | {
11 | public XElement ConvertToConfiguration(XElement runSettingsElement)
12 | {
13 | var dataCollectorsElement = runSettingsElement.Element("DataCollectionRunSettings").Element("DataCollectors");
14 | var codeCoverageDataCollectorElement = dataCollectorsElement.Elements().FirstOrDefault(dataCollectorElement =>
15 | {
16 | var friendlyName = dataCollectorElement.Attribute((XName)"friendlyName")?.Value ?? string.Empty;
17 | return friendlyName.Equals("Code Coverage", StringComparison.OrdinalIgnoreCase);
18 | });
19 | return codeCoverageDataCollectorElement?.Element("Configuration");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Core/MsTestPlatform/TestingPlatform/TUnit/TUnitConstants.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.MsTestPlatform.TestingPlatform
2 | {
3 | internal abstract class TUnitConstants
4 | {
5 | public const string TUnitPackageId = "TUnit";
6 | public const string CodeCoveragePackageId = "Microsoft.Testing.Extensions.CodeCoverage";
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Core/OpenCover/IOpenCoverExeArgumentsProvider.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using System.Collections.Generic;
3 |
4 | namespace FineCodeCoverage.Engine.OpenCover
5 | {
6 | internal interface IOpenCoverExeArgumentsProvider
7 | {
8 | List Provide(ICoverageProject coverageProject,string msTestPlatformExePath);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/OpenCover/IOpenCoverUtil.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace FineCodeCoverage.Engine.OpenCover
6 | {
7 | internal interface IOpenCoverUtil
8 | {
9 | Task RunOpenCoverAsync(ICoverageProject project, CancellationToken cancellationToken);
10 | void Initialize(string appDataFolder, CancellationToken cancellationToken);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/ReportGenerator/ColourUtilities/LuminanceContrastColourExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Engine.ReportGenerator
4 | {
5 | internal static class LuminanceContrastColourExtensions
6 | {
7 | public static double Contrast(this System.Drawing.Color color, System.Drawing.Color color2)
8 | {
9 | var l1 = color.Luminance();
10 | var l2 = color2.Luminance();
11 | return l1 > l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);
12 |
13 | }
14 |
15 | public static double Luminance(this System.Drawing.Color color)
16 | {
17 | return Luminance(color.R, color.G, color.B);
18 | }
19 |
20 | private static double Luminance(int r, int g, int b)
21 | {
22 | var lr = LuminanceX(r);
23 | var lg = LuminanceX(g);
24 | var lb = LuminanceX(b);
25 | return 0.2126 * lr + 0.7152 * lg + 0.0722 * lb;
26 |
27 | }
28 |
29 | private static double LuminanceX(int x)
30 | {
31 | x /= 255;
32 | return x <= 0.03928 ? x / 12.92 : Math.Pow((x + 0.055) / 1.055, 2.4);
33 |
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SharedProject/Core/ReportGenerator/IReportColoursProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FineCodeCoverage.Engine.ReportGenerator
6 | {
7 | internal interface IReportColoursProvider
8 | {
9 | event EventHandler ColoursChanged;
10 | IReportColours GetColours();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/ReportGenerator/IThemeResourceKeyProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Microsoft.VisualStudio.Shell;
5 |
6 | namespace FineCodeCoverage.Engine.ReportGenerator
7 | {
8 | internal interface IThemeResourceKeyProvider
9 | {
10 | ThemeResourceKey Provide(string reportPart);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ComparableFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | internal class ComparableFile : IEquatable
7 | {
8 | private readonly int hashCode;
9 |
10 | public FileInfo FileInfo { get; }
11 |
12 | public string RelativePath { get; }
13 |
14 | public override int GetHashCode() => hashCode;
15 |
16 | public bool Equals(ComparableFile other) => hashCode.Equals(other.hashCode);
17 |
18 | public ComparableFile(FileInfo fileInfo, string relativePath)
19 | {
20 | FileInfo = fileInfo;
21 | RelativePath = relativePath;
22 | hashCode = string.Format("{0}|{1}|{2}", RelativePath, FileInfo.Length, FileInfo.LastWriteTimeUtc.Ticks).GetHashCode();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/DotNet/DotNetToolListParser.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Linq;
5 |
6 | namespace FineCodeCoverage.Core.Utilities
7 | {
8 | [Export(typeof(IDotNetToolListParser))]
9 | internal class DotNetToolListParser : IDotNetToolListParser
10 | {
11 | public List Parse(string output)
12 | {
13 | // note that if included Manifest this code will need to change
14 | var outputLines = output.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
15 | var toolLines = outputLines.Skip(2);
16 | return toolLines.Select(l =>
17 | {
18 | var tokens = l.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
19 | return new DotNetTool
20 | {
21 | PackageId = tokens[0].Trim(),
22 | Version = tokens[1].Trim(),
23 | Commands = tokens[2].Trim(),
24 | };
25 | }).ToList();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/DotNet/IDotNetConfigFinder.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IDotNetConfigFinder
6 | {
7 | IEnumerable GetConfigDirectories(string upFromDirectory);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/DotNet/IDotNetToolListExecutor.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | internal class DotNetToolListExecutionResult
4 | {
5 | public int ExitCode { get; set; }
6 | public string Output { get; set; }
7 | }
8 |
9 | internal interface IDotNetToolListExecutor
10 | {
11 | DotNetToolListExecutionResult Global();
12 | DotNetToolListExecutionResult GlobalToolsPath(string directory);
13 | DotNetToolListExecutionResult Local(string directory);
14 | }
15 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/DotNet/IDotNetToolListParser.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | // ignoring Manifest as not needed
6 | internal class DotNetTool
7 | {
8 | public string PackageId { get; set; }
9 | public string Version { get; set; }
10 | public string Commands { get; set; }
11 | }
12 |
13 | internal interface IDotNetToolListParser
14 | {
15 | List Parse(string output);
16 | }
17 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/FileComparer.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal class FileComparer : IEqualityComparer
6 | {
7 | public static FileComparer Singleton { get; } = new FileComparer();
8 |
9 | public int GetHashCode(ComparableFile file) => file.GetHashCode();
10 |
11 | public bool Equals(ComparableFile file, ComparableFile otherFile) => file.Equals(otherFile);
12 | }
13 | }
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IAssemblyUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IAssemblyUtil
6 | {
7 | T RunInAssemblyResolvingContext(Func func);
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IEnvironment.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | interface IEnvironment
4 | {
5 | string GetEnvironmentVariable(string variable);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IFileRenameListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | interface IFileRenameListener
6 | {
7 | void ListenForFileRename(Action callback);
8 | }
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IFileUtil.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IFileUtil
6 | {
7 | string ReadAllText(string path);
8 | void WriteAllText(string path, string contents);
9 | string CreateTempDirectory();
10 | bool DirectoryExists(string directory);
11 | void TryEmptyDirectory(string directory);
12 | string EnsureAbsolute(string directory, string possiblyRelativeTo);
13 | string FileDirectoryPath(string filePath);
14 | void TryDeleteDirectory(string directory);
15 | bool Exists(string filePath);
16 | void Copy(string source, string destination);
17 | string DirectoryParentPath(string directoryPath);
18 | string[] GetFiles(string path, string searchPattern, SearchOption searchOption);
19 | void DeleteFile(string filePath);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IJsonConvertService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IJsonConvertService
6 | {
7 | object DeserializeObject(string serialized, Type propertyType);
8 | T DeserializeObject(string serialized);
9 | string SerializeObject(object objValue);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IProcessResponseProcessor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IProcessResponseProcessor
6 | {
7 | bool Process(ExecuteResponse executeResponse, Func exitCodeSuccessPredicate, bool throwError, string title, Action successCallback = null);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IProcessUtil.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | interface IProcessUtil
7 | {
8 | Task ExecuteAsync(ExecuteRequest request, CancellationToken cancellationToken);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IProjectFilePropertyWriter.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Shell.Interop;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | public interface IProjectFilePropertyWriter
7 | {
8 | Task RemovePropertyAsync(IVsHierarchy pHierProj, string propertyName);
9 | Task WritePropertyAsync(IVsHierarchy projectHierarchy, string propertyName, string value);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IResourceProvider.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | interface IResourceProvider
4 | {
5 | string ReadResource(string resourceName);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IShownToolWindowHistory.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | interface IShownToolWindowHistory
4 | {
5 | bool HasShownToolWindow { get; }
6 | void ShowedToolWindow();
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ISolutionEvents.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | interface ISolutionEvents
6 | {
7 | event EventHandler AfterClosing;
8 | event EventHandler AfterOpen;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IToolWindowOpener.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IToolWindowOpener
6 | {
7 | Task OpenToolWindowAsync();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IXmlUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Linq;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | interface IXmlUtils
6 | {
7 | XElement Load(string path);
8 | string Serialize(XElement xmlElement);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/IZipFile.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | internal interface IZipFile
4 | {
5 | void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/JsonConvertService.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Linq;
3 | using System;
4 | using System.ComponentModel.Composition;
5 | using System.Diagnostics.CodeAnalysis;
6 |
7 | namespace FineCodeCoverage.Core.Utilities
8 | {
9 | [ExcludeFromCodeCoverage]
10 | [Export(typeof(IJsonConvertService))]
11 | public class JsonConvertService : IJsonConvertService
12 | {
13 | public object DeserializeObject(string serialized, Type propertyType)
14 | {
15 | return JsonConvert.DeserializeObject(serialized, propertyType);
16 | }
17 |
18 | public T DeserializeObject(string serialized)
19 | {
20 | return JsonConvert.DeserializeObject(serialized);
21 | }
22 |
23 | public string SerializeObject(object value)
24 | {
25 | return JsonConvert.SerializeObject(value);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/MEF.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 | using System.ComponentModel.Composition;
4 |
5 | namespace FineCodeCoverage.Core.Utilities
6 | {
7 | internal interface IOrderMetadata
8 | {
9 | int Order { get; }
10 | }
11 |
12 | [MetadataAttribute]
13 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
14 | public class OrderAttribute : ExportAttribute, IOrderMetadata
15 | {
16 | public OrderAttribute(int order, Type contractType)
17 | : base(contractType)
18 | {
19 | Order = order;
20 | }
21 |
22 | public OrderAttribute(int order, string contractName)
23 | : base(contractName)
24 | {
25 | Order = order;
26 | }
27 |
28 | public OrderAttribute(int order, string contractName, Type contractType)
29 | : base(contractName, contractType)
30 | {
31 | Order = order;
32 | }
33 |
34 | public int Order { get;private set;}
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ProcessResponseProcessor.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Output;
2 | using System;
3 | using System.ComponentModel.Composition;
4 |
5 | namespace FineCodeCoverage.Core.Utilities
6 | {
7 | [Export(typeof(IProcessResponseProcessor))]
8 | internal class ProcessResponseProcessor : IProcessResponseProcessor
9 | {
10 | private readonly ILogger logger;
11 |
12 | [ImportingConstructor]
13 | public ProcessResponseProcessor(ILogger logger)
14 | {
15 | this.logger = logger;
16 | }
17 | public bool Process(ExecuteResponse result, Func exitCodeSuccessPredicate, bool throwError, string title,Action successCallback = null)
18 | {
19 | if (!exitCodeSuccessPredicate(result.ExitCode))
20 | {
21 | if (throwError)
22 | {
23 | throw new Exception(result.Output);
24 | }
25 |
26 | logger.Log($"{title} Error", result.Output);
27 | return false;
28 | }
29 |
30 | logger.Log(title, result.Output);
31 | successCallback?.Invoke();
32 | return true;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ReflectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Reflection;
4 |
5 | namespace FineCodeCoverage.Core.Utilities
6 | {
7 | public static class ReflectionExtensions
8 | {
9 | public static TCustomAttribute[] GetTypedCustomAttributes(this ICustomAttributeProvider customAttributeProvider, bool inherit) where TCustomAttribute:Attribute
10 | {
11 | var attributes = customAttributeProvider.GetCustomAttributes(typeof(TCustomAttribute), inherit);
12 | return attributes as TCustomAttribute[];
13 | }
14 |
15 | public static PropertyInfo[] GetPublicProperties(this Type type)
16 | {
17 | if (!type.IsInterface)
18 | return type.GetProperties();
19 |
20 | return (new Type[] { type })
21 | .Concat(type.GetInterfaces())
22 | .SelectMany(i => i.GetProperties()).ToArray();
23 | }
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ResourceProvider.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.IO;
3 | using System.Reflection;
4 |
5 | namespace FineCodeCoverage.Core.Utilities
6 | {
7 | [Export(typeof(IResourceProvider))]
8 | internal class ResourceProvider : IResourceProvider
9 | {
10 | private readonly string resourcesDirectory;
11 | public ResourceProvider()
12 | {
13 | var assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
14 | resourcesDirectory = Path.Combine(assemblyDirectory, "Resources");
15 |
16 | }
17 | public string ReadResource(string resourceName)
18 | {
19 | return File.ReadAllText(Path.Combine(resourcesDirectory, resourceName));
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ServiceProviderExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal static class ServiceProviderExtensions
6 | {
7 | public static T GetService(this IServiceProvider serviceProvider)
8 | {
9 | return (T)serviceProvider.GetService(typeof(T));
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/SystemEnvironment.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | [Export(typeof(IEnvironment))]
7 | internal class SystemEnvironment : IEnvironment
8 | {
9 | public string GetEnvironmentVariable(string variable)
10 | {
11 | return Environment.GetEnvironmentVariable(variable);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ThrowIf.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal static class ThrowIf
6 | {
7 | public static void Null(T value, string name) where T : class
8 | {
9 | if (value == null)
10 | {
11 | throw new ArgumentNullException(name);
12 | }
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ToolWindowOpener.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Output;
2 | using System.ComponentModel.Composition;
3 | using System.Threading.Tasks;
4 |
5 | namespace FineCodeCoverage.Core.Utilities
6 | {
7 | [Export(typeof(IToolWindowOpener))]
8 | internal class ToolWindowOpener : IToolWindowOpener
9 | {
10 | public async Task OpenToolWindowAsync()
11 | {
12 | await OutputToolWindowCommand.Instance.ShowToolWindowAsync();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ToolZip/IToolFolder.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IToolFolder
6 | {
7 | string EnsureUnzipped(string appDataFolder,string ownFolderName, ZipDetails zipDetails, CancellationToken cancellationToken);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ToolZip/IToolUnzipper.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 |
3 | namespace FineCodeCoverage.Core.Utilities
4 | {
5 | internal interface IToolUnzipper
6 | {
7 | string EnsureUnzipped(string appDataFolder, string toolFolderName, string zipPrefix, CancellationToken cancellationToken);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ToolZip/IToolZipProvider.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | internal class ZipDetails
4 | {
5 | public string Path { get; set; }
6 | public string Version { get; set; }
7 | }
8 | internal interface IToolZipProvider
9 | {
10 | ZipDetails ProvideZip(string zipPrefix);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ToolZip/ToolUnzipper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Text;
5 | using System.Threading;
6 |
7 | namespace FineCodeCoverage.Core.Utilities
8 | {
9 | [Export(typeof(IToolUnzipper))]
10 | internal class ToolUnzipper : IToolUnzipper
11 | {
12 | private readonly IToolZipProvider toolZipProvider;
13 | private readonly IToolFolder toolFolder;
14 |
15 | [ImportingConstructor]
16 | public ToolUnzipper(
17 | IToolZipProvider toolZipProvider,
18 | IToolFolder toolFolder
19 | )
20 | {
21 | this.toolZipProvider = toolZipProvider;
22 | this.toolFolder = toolFolder;
23 | }
24 | public string EnsureUnzipped(string appDataFolder, string ownFolderName, string zipPrefix, CancellationToken cancellationToken)
25 | {
26 | return toolFolder.EnsureUnzipped(appDataFolder, ownFolderName, toolZipProvider.ProvideZip(zipPrefix), cancellationToken);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ToolZip/ToolZipProvider.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Reflection;
5 |
6 | namespace FineCodeCoverage.Core.Utilities
7 | {
8 | [Export(typeof(IToolZipProvider))]
9 | internal class ToolZipProvider : IToolZipProvider
10 | {
11 | internal const string ZippedToolsDirectoryName = "ZippedTools";
12 | internal string ExtensionDirectory { get; set; }
13 | public ToolZipProvider()
14 | {
15 | ExtensionDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
16 | }
17 |
18 | public ZipDetails ProvideZip(string zipPrefix)
19 | {
20 | var zipFolder = Path.Combine(ExtensionDirectory, ZippedToolsDirectoryName);
21 | var matchingZipFiles = Directory.GetFiles(zipFolder, $"{zipPrefix}.*.zip");
22 | var zipPath = matchingZipFiles.First();
23 |
24 | var zipFileName = Path.GetFileName(zipPath);
25 | var version = zipFileName.Replace($"{zipPrefix}.", "").Replace(".zip", "");
26 |
27 | return new ZipDetails { Path = zipPath, Version = version };
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/Tryer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | internal static class Tryer
7 | {
8 | public static async Task TryAsync(Func func)
9 | {
10 | try
11 | {
12 | await func();
13 | }
14 | catch { }
15 | }
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/XmlFileEscaper.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Core.Utilities
2 | {
3 | internal static class XmlFileEscaper
4 | {
5 | public static string Escape(string filePath)
6 | {
7 | return filePath.Replace("&", "&").Replace("'", "'");
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/XmlUtils.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Xml.Linq;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | [Export(typeof(IXmlUtils))]
7 | internal class XmlUtils : IXmlUtils
8 | {
9 | public XElement Load(string path)
10 | {
11 | return XElement.Load(path);
12 | }
13 |
14 | public string Serialize(XElement xmlElement)
15 | {
16 | return new XDocument(new XDeclaration("1.0", "utf-8", "yes"), xmlElement).ToString();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/SharedProject/Core/Utilities/ZipFileWrapper.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.IO.Compression;
3 |
4 | namespace FineCodeCoverage.Core.Utilities
5 | {
6 | [Export(typeof(IZipFile))]
7 | internal class ZipFileWrapper : IZipFile
8 | {
9 | public void ExtractToDirectory(string sourceArchiveFileName, string destinationDirectoryName)
10 | {
11 | ZipFile.ExtractToDirectory(sourceArchiveFileName, destinationDirectoryName);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Common/DynamicLine.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal class DynamicLine : IDynamicLine
4 | {
5 | public DynamicLine(int lineNumber, DynamicCoverageType dynamicCoverageType)
6 | {
7 | this.Number = lineNumber;
8 | this.CoverageType = dynamicCoverageType;
9 | }
10 |
11 | public int Number { get; set; }
12 |
13 | public DynamicCoverageType CoverageType { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/ContentTypes/Blazor/BlazorGeneratedFilePathMatcher.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage.ContentTypes.Blazor
4 | {
5 | [Export(typeof(IBlazorGeneratedFilePathMatcher))]
6 | internal class BlazorGeneratedFilePathMatcher : IBlazorGeneratedFilePathMatcher
7 | {
8 | public bool IsBlazorGeneratedFilePath(string razorFilePath, string generatedFilePath)
9 | => generatedFilePath.StartsWith($"{razorFilePath}.");
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/ContentTypes/Blazor/IBlazorFileCodeSpanRangeService.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage.ContentTypes.Blazor
2 | {
3 | internal interface IBlazorFileCodeSpanRangeService : IFileCodeSpanRangeService { }
4 | }
5 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/ContentTypes/Blazor/IBlazorGeneratedDocumentRootFinder.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Microsoft.CodeAnalysis;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage.ContentTypes.Blazor
6 | {
7 | internal interface IBlazorGeneratedDocumentRootFinder
8 | {
9 | Task FindSyntaxRootAsync(ITextBuffer textBuffer, string filePath, IBlazorGeneratedFilePathMatcher razorGeneratedFilePathMatcher);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/ContentTypes/Blazor/IBlazorGeneratedFilePathMatcher.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage.ContentTypes.Blazor
2 | {
3 | interface IBlazorGeneratedFilePathMatcher
4 | {
5 | bool IsBlazorGeneratedFilePath(string razorFilePath, string generatedfilePath);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/ContentTypes/CPPCoverageContentType.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using FineCodeCoverage.Editor.DynamicCoverage.TrackedLinesImpl.Construction;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage.ContentTypes
6 | {
7 | [Export(typeof(ICoverageContentType))]
8 | internal class CPPCoverageContentType : ICoverageContentType
9 | {
10 | public const string ContentType = "C/C++";
11 | public string ContentTypeName => ContentType;
12 |
13 | /*
14 | todo - https://learn.microsoft.com/en-us/previous-versions/t41260xs(v=vs.140)
15 | non C++ https://learn.microsoft.com/en-us/dotnet/api/envdte80.filecodemodel2?view=visualstudiosdk-2022
16 | */
17 | public IFileCodeSpanRangeService FileCodeSpanRangeService => null;
18 |
19 | // not relevant
20 | [ExcludeFromCodeCoverage]
21 | public bool CoverageOnlyFromFileCodeSpanRangeService => false;
22 | [ExcludeFromCodeCoverage]
23 | public bool UseFileCodeSpanRangeServiceForChanges => false;
24 |
25 | public ILineExcluder LineExcluder => null;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/ContentTypes/Roslyn/IRoslynFileCodeSpanRangeService.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage.ContentTypes.Roslyn
2 | {
3 | internal interface IRoslynFileCodeSpanRangeService
4 | {
5 | IFileCodeSpanRangeService FileCodeSpanRangeService { get; }
6 | bool UseFileCodeSpanRangeServiceForChanges { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/CoverageLineFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using FineCodeCoverage.Engine.Model;
4 | using Microsoft.VisualStudio.Text;
5 |
6 | namespace FineCodeCoverage.Editor.DynamicCoverage
7 | {
8 | [ExcludeFromCodeCoverage]
9 | [Export(typeof(ICoverageLineFactory))]
10 | internal class CoverageLineFactory : ICoverageLineFactory
11 | {
12 | private readonly ILineTracker lineTracker;
13 |
14 | [ImportingConstructor]
15 | public CoverageLineFactory(ILineTracker lineTracker) => this.lineTracker = lineTracker;
16 | public ICoverageLine Create(ITrackingSpan trackingSpan, ILine line) => new CoverageLine(trackingSpan, line, this.lineTracker);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/ICoverageLine.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ICoverageLine
7 | {
8 | List Update(ITextSnapshot currentSnapshot);
9 | IDynamicLine Line { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/ICoverageLineFactory.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ICoverageLineFactory
7 | {
8 | ICoverageLine Create(ITrackingSpan trackingSpan, ILine line);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/ITrackedCoverageLinesFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITrackedCoverageLinesFactory
6 | {
7 | ITrackedCoverageLines Create(List coverageLines);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/TrackedCoverageLines.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | internal class TrackedCoverageLines : ITrackedCoverageLines
8 | {
9 | private readonly List coverageLines;
10 |
11 | public IEnumerable Lines => this.coverageLines.Select(coverageLine => coverageLine.Line);
12 | public TrackedCoverageLines(List coverageLines) => this.coverageLines = coverageLines;
13 |
14 | public IEnumerable GetUpdatedLineNumbers(ITextSnapshot currentSnapshot)
15 | => this.coverageLines.SelectMany(coverageLine => coverageLine.Update(currentSnapshot));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/TrackedCoverageLinesFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.Composition;
3 | using System.Diagnostics.CodeAnalysis;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(ITrackedCoverageLinesFactory))]
9 | internal class TrackedCoverageLinesFactory : ITrackedCoverageLinesFactory
10 | {
11 | public ITrackedCoverageLines Create(List coverageLines) => new TrackedCoverageLines(coverageLines);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Coverage/TrackedLineLine.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Engine.Model;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal class TrackedLineLine : IDynamicLine
6 | {
7 | public TrackedLineLine(ILine line)
8 | {
9 | this.Number = line.Number - 1;
10 | this.CoverageType = DynamicCoverageTypeConverter.Convert(line.CoverageType);
11 | }
12 |
13 | public int Number { get; set; }
14 | public DynamicCoverageType CoverageType { get; private set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Dirty/DirtyLineFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(IDirtyLineFactory))]
9 | internal class DirtyLineFactory : IDirtyLineFactory
10 | {
11 | private readonly ILineTracker lineTracker;
12 |
13 | [ImportingConstructor]
14 | public DirtyLineFactory(ILineTracker lineTracker) => this.lineTracker = lineTracker;
15 | public ITrackingLine Create(ITrackingSpan trackingSpan, ITextSnapshot snapshot)
16 | => new TrackingLine(trackingSpan, snapshot, this.lineTracker, DynamicCoverageType.Dirty);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Dirty/IDirtyLineFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface IDirtyLineFactory
6 | {
7 | ITrackingLine Create(ITrackingSpan trackingSpan, ITextSnapshot snapshot);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/DynamicCoverageType.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal enum DynamicCoverageType
4 | {
5 | Covered, Partial, NotCovered,
6 | Dirty,
7 | NewLine,
8 | NotIncluded
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/IBufferLineCoverage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface IBufferLineCoverage
6 | {
7 | IEnumerable GetLines(int startLineNumber, int endLineNumber);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/IBufferLineCoverageFactory.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Core.Utilities;
2 | using FineCodeCoverage.Engine.Model;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface IBufferLineCoverageFactory
7 | {
8 | IBufferLineCoverage Create(
9 | LastCoverage lastCoverage, ITextInfo textInfo, IEventAggregator eventAggregator, ITrackedLinesFactory trackedLinesFactory
10 | );
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/IDynamicCoverageManager.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal interface IDynamicCoverageManager
4 | {
5 | IBufferLineCoverage Manage(ITextInfo textInfo);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/IDynamicLine.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal interface IDynamicLine
4 | {
5 | int Number { get; }
6 | DynamicCoverageType CoverageType { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/ILastCoverage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FineCodeCoverage.Engine.Model;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ILastCoverage
7 | {
8 | IFileLineCoverage FileLineCoverage { get; }
9 | DateTime TestExecutionStartingDate { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/ITrackedLines.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ITrackedLines
7 | {
8 | IEnumerable GetLines(int startLineNumber, int endLineNumber);
9 | IEnumerable GetChangedLineNumbers(ITextSnapshot currentSnapshot, List newSpanChanges);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/ITrackedLinesFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FineCodeCoverage.Editor.Tagging.Base;
3 | using FineCodeCoverage.Engine.Model;
4 | using Microsoft.VisualStudio.Text;
5 |
6 | namespace FineCodeCoverage.Editor.DynamicCoverage
7 | {
8 | internal interface ITrackedLinesFactory
9 | {
10 | ITrackedLines Create(List lines, ITextSnapshot textSnapshot, string filePath);
11 | ITrackedLines Create(string serializedCoverage, ITextSnapshot currentSnapshot, string filePath);
12 | string Serialize(ITrackedLines trackedLines, string text);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Management/LastCoverage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using FineCodeCoverage.Engine.Model;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | #pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
8 | internal class LastCoverage : ILastCoverage
9 |
10 | #pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
11 | {
12 | public LastCoverage(IFileLineCoverage fileLineCoverage, DateTime testExecutionStartingDate)
13 | {
14 | this.FileLineCoverage = fileLineCoverage;
15 | this.TestExecutionStartingDate = testExecutionStartingDate;
16 | }
17 | public IFileLineCoverage FileLineCoverage { get; }
18 | public DateTime TestExecutionStartingDate { get; }
19 |
20 | [ExcludeFromCodeCoverage]
21 | public override bool Equals(object obj) => obj is LastCoverage coverage && this.FileLineCoverage == coverage.FileLineCoverage && this.TestExecutionStartingDate == coverage.TestExecutionStartingDate;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NewCode/INewCodeTrackerFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface INewCodeTrackerFactory
7 | {
8 | INewCodeTracker Create(ILineExcluder lineExcluder);
9 | INewCodeTracker Create(ILineExcluder lineExcluder, IEnumerable lineNumbers, ITextSnapshot textSnapshot);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NewCode/ITrackedNewCodeLine.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITrackedNewCodeLine
6 | {
7 | TrackedNewCodeLineUpdate Update(ITextSnapshot currentSnapshot);
8 | string GetText(ITextSnapshot currentSnapshot);
9 | IDynamicLine Line { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NewCode/ITrackedNewCodeLineFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITrackedNewCodeLineFactory
6 | {
7 | ITrackedNewCodeLine Create(ITextSnapshot textSnapshot, SpanTrackingMode spanTrackingMode, int lineNumber);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NewCode/NewCodeTrackerFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.Composition;
3 | using System.Diagnostics.CodeAnalysis;
4 | using Microsoft.VisualStudio.Text;
5 |
6 | namespace FineCodeCoverage.Editor.DynamicCoverage
7 | {
8 | [ExcludeFromCodeCoverage]
9 | [Export(typeof(INewCodeTrackerFactory))]
10 | internal class NewCodeTrackerFactory : INewCodeTrackerFactory
11 | {
12 | private readonly ITrackedNewCodeLineFactory trackedNewCodeLineFactory;
13 |
14 | [ImportingConstructor]
15 | public NewCodeTrackerFactory(
16 | ITrackedNewCodeLineFactory trackedNewCodeLineFactory
17 | ) => this.trackedNewCodeLineFactory = trackedNewCodeLineFactory;
18 |
19 | public INewCodeTracker Create(ILineExcluder lineExcluder) => new NewCodeTracker(this.trackedNewCodeLineFactory, lineExcluder);
20 |
21 | public INewCodeTracker Create(ILineExcluder lineExcluder, IEnumerable lineNumbers, ITextSnapshot textSnapshot)
22 | => new NewCodeTracker(this.trackedNewCodeLineFactory, lineExcluder, lineNumbers, textSnapshot);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NewCode/TrackedNewCodeLineUpdate.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal readonly struct TrackedNewCodeLineUpdate
4 | {
5 | public TrackedNewCodeLineUpdate(string text, int newLineNumber, int oldLineNumber)
6 | {
7 | this.Text = text;
8 | this.NewLineNumber = newLineNumber;
9 | this.OldLineNumber = oldLineNumber;
10 | }
11 | public string Text { get; }
12 | public int NewLineNumber { get; }
13 | public int OldLineNumber { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NotIncluded/INotIncludedLineFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface INotIncludedLineFactory
6 | {
7 | ITrackingLine Create(ITrackingSpan startTrackingSpan, ITextSnapshot currentSnapshot);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/NotIncluded/NotIncludedLineFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(INotIncludedLineFactory))]
9 | internal class NotIncludedLineFactory : INotIncludedLineFactory
10 | {
11 | private readonly ILineTracker lineTracker;
12 |
13 | [ImportingConstructor]
14 | public NotIncludedLineFactory(
15 | ILineTracker lineTracker
16 | ) => this.lineTracker = lineTracker;
17 |
18 | public ITrackingLine Create(ITrackingSpan startTrackingSpan, ITextSnapshot currentSnapshot)
19 | => new TrackingLine(startTrackingSpan, currentSnapshot, this.lineTracker, DynamicCoverageType.NotIncluded);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Store/IDynamicCoverageStore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | #pragma warning disable CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
6 | internal class SerializedCoverageWhen
7 | #pragma warning restore CS0659 // Type overrides Object.Equals(object o) but does not override Object.GetHashCode()
8 | {
9 | public string Serialized { get; set; }
10 | public DateTime When { get; set; }
11 |
12 | public override bool Equals(object obj)
13 | => obj is SerializedCoverageWhen when &&
14 | this.Serialized == when.Serialized &&
15 | this.When == when.When;
16 | }
17 | internal interface IDynamicCoverageStore
18 | {
19 | SerializedCoverageWhen GetSerializedCoverage(string filePath);
20 | void RemoveSerializedCoverage(string filePath);
21 | void SaveSerializedCoverage(string filePath, string serializedCoverage);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/ContainingCodeTrackedLinesFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.Composition;
3 | using System.Diagnostics.CodeAnalysis;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(IContainingCodeTrackedLinesFactory))]
9 | internal class ContainingCodeTrackedLinesFactory : IContainingCodeTrackedLinesFactory
10 | {
11 | public IContainingCodeTrackerTrackedLines Create(
12 | List containingCodeTrackers,
13 | INewCodeTracker newCodeTracker,
14 | IFileCodeSpanRangeService fileCodeSpanRangeService
15 | ) => new TrackedLines(containingCodeTrackers, newCodeTracker, fileCodeSpanRangeService);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/ContainingCodeTrackerState.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal class ContainingCodeTrackerState
6 | {
7 | public ContainingCodeTrackerState(
8 | ContainingCodeTrackerType type,
9 | CodeSpanRange codeSpanRange,
10 | IEnumerable lines
11 | )
12 | {
13 | this.Type = type;
14 | this.CodeSpanRange = codeSpanRange;
15 | this.Lines = lines;
16 | }
17 |
18 | public ContainingCodeTrackerType Type { get; }
19 | public CodeSpanRange CodeSpanRange { get; }
20 | public IEnumerable Lines { get; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/ContainingCodeTrackerType.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal enum ContainingCodeTrackerType { CoverageLines, NotIncluded, OtherLines }
4 | }
5 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/IContainingCodeTracker.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface IContainingCodeTracker
7 | {
8 | IContainingCodeTrackerProcessResult ProcessChanges(ITextSnapshot currentSnapshot, List newSpanAndLineRanges);
9 | ContainingCodeTrackerState GetState();
10 |
11 | IEnumerable Lines { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/IContainingCodeTrackerProcessResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface IContainingCodeTrackerProcessResult
6 | {
7 | bool IsEmpty { get; }
8 | IEnumerable ChangedLines { get; }
9 | List UnprocessedSpans { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/IContainingCodeTrackerTrackedLines.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace FineCodeCoverage.Editor.DynamicCoverage
3 | {
4 | internal interface IContainingCodeTrackerTrackedLines : ITrackedLines
5 | {
6 | IReadOnlyList ContainingCodeTrackers { get; }
7 | INewCodeTracker NewCodeTracker { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/IFileCodeSpanRangeService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface IFileCodeSpanRangeService
7 | {
8 | List GetFileCodeSpanRanges(ITextSnapshot snapshot);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLines/INewCodeTracker.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface INewCodeTracker
7 | {
8 | IEnumerable Lines { get; }
9 |
10 | IEnumerable GetChangedLineNumbers(
11 | ITextSnapshot currentSnapshot,
12 | List newSpanChanges,
13 | IEnumerable newCodeCodeRanges);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/CodeSpanRange.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics.CodeAnalysis;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal class CodeSpanRange
6 | {
7 | public CodeSpanRange(int startLine, int endLine)
8 | {
9 | this.StartLine = startLine;
10 | this.EndLine = endLine;
11 | }
12 | public static CodeSpanRange SingleLine(int lineNumber) => new CodeSpanRange(lineNumber, lineNumber);
13 | public int StartLine { get; set; }
14 | public int EndLine { get; set; }
15 |
16 | [ExcludeFromCodeCoverage]
17 | public override bool Equals(object obj)
18 | => obj is CodeSpanRange codeSpanRange && codeSpanRange.StartLine == this.StartLine && codeSpanRange.EndLine == this.EndLine;
19 |
20 | [ExcludeFromCodeCoverage]
21 | public override int GetHashCode()
22 | {
23 | int hashCode = -1763436595;
24 | hashCode = (hashCode * -1521134295) + this.StartLine.GetHashCode();
25 | hashCode = (hashCode * -1521134295) + this.EndLine.GetHashCode();
26 | return hashCode;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/ICodeSpanRangeContainingCodeTrackerFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FineCodeCoverage.Engine.Model;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | internal interface ICodeSpanRangeContainingCodeTrackerFactory
8 | {
9 | IContainingCodeTracker CreateNotIncluded(ITextSnapshot textSnapshot, CodeSpanRange containingRange, SpanTrackingMode spanTrackingMode);
10 | IContainingCodeTracker CreateCoverageLines(ITextSnapshot textSnapshot, List lines, CodeSpanRange containingRange, SpanTrackingMode spanTrackingMode);
11 | IContainingCodeTracker CreateOtherLines(ITextSnapshot textSnapshot, CodeSpanRange containingRange, SpanTrackingMode spanTrackingMode);
12 | IContainingCodeTracker CreateDirty(ITextSnapshot currentSnapshot, CodeSpanRange codeSpanRange, SpanTrackingMode spanTrackingMode);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/IContainingCodeTrackedLinesFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface IContainingCodeTrackedLinesFactory
6 | {
7 | IContainingCodeTrackerTrackedLines Create(
8 | List containingCodeTrackers,
9 | INewCodeTracker newCodeTracker,
10 | IFileCodeSpanRangeService fileCodeSpanRangeService
11 | );
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/ICoverageContentType.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage.TrackedLinesImpl.Construction
2 | {
3 | internal interface ICoverageContentType
4 | {
5 | string ContentTypeName { get; }
6 | IFileCodeSpanRangeService FileCodeSpanRangeService { get; }
7 | bool CoverageOnlyFromFileCodeSpanRangeService { get; }
8 | bool UseFileCodeSpanRangeServiceForChanges { get; }
9 | ILineExcluder LineExcluder { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/ITrackingSpanRangeContainingCodeTrackerFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITrackingSpanRangeContainingCodeTrackerFactory
6 | {
7 | IContainingCodeTracker CreateCoverageLines(ITrackingSpanRange trackingSpanRange, ITrackedCoverageLines trackedCoverageLines);
8 | IContainingCodeTracker CreateDirty(ITrackingSpanRange trackingSpanRange, ITextSnapshot textSnapshot);
9 | IContainingCodeTracker CreateNotIncluded(ITrackingLine trackingLine, ITrackingSpanRange trackingSpanRange);
10 | IContainingCodeTracker CreateOtherLines(ITrackingSpanRange trackingSpanRange);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/ITrackingSpanRangeFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITrackingSpanRangeFactory
6 | {
7 | ITrackingSpanRange Create(ITrackingSpan startTrackingSpan, ITrackingSpan endTrackingSpan, ITextSnapshot currentSnapshot);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/SerializedContainingCodeTracker.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal class SerializedContainingCodeTracker
7 | {
8 | public SerializedContainingCodeTracker(CodeSpanRange codeSpanRange, ContainingCodeTrackerType type, List dynamicLines)
9 | {
10 | this.CodeSpanRange = codeSpanRange;
11 | this.Type = type;
12 | this.Lines = dynamicLines;
13 | }
14 |
15 | public static SerializedContainingCodeTracker From(ContainingCodeTrackerState containingCodeTrackerState)
16 | => new SerializedContainingCodeTracker(
17 | containingCodeTrackerState.CodeSpanRange,
18 | containingCodeTrackerState.Type,
19 | containingCodeTrackerState.Lines.Select(line => new DynamicLine(line.Number, line.CoverageType)).ToList()
20 | );
21 |
22 | public CodeSpanRange CodeSpanRange { get; set; }
23 | public ContainingCodeTrackerType Type { get; set; }
24 | public List Lines { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/SerializedEditorDynamicCoverage.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage.TrackedLinesImpl.Construction
4 | {
5 | internal class SerializedEditorDynamicCoverage
6 | {
7 | public List SerializedContainingCodeTrackers { get; set; }
8 | public string Text { get; set; }
9 | public List NewCodeLineNumbers { get; set; }
10 | public bool UsedFileCodeSpanRangeService { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/TrackingSpanRangeFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(ITrackingSpanRangeFactory))]
9 | internal class TrackingSpanRangeFactory : ITrackingSpanRangeFactory
10 | {
11 | private readonly ILineTracker lineTracker;
12 |
13 | [ImportingConstructor]
14 | public TrackingSpanRangeFactory(ILineTracker lineTracker) => this.lineTracker = lineTracker;
15 |
16 | public ITrackingSpanRange Create(ITrackingSpan startTrackingSpan, ITrackingSpan endTrackingSpan, ITextSnapshot currentSnapshot)
17 | => new TrackingSpanRange(startTrackingSpan, endTrackingSpan, currentSnapshot, this.lineTracker);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/Construction/TrackingSpanRangeProcessResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal class TrackingSpanRangeProcessResult
6 | {
7 | public TrackingSpanRangeProcessResult(ITrackingSpanRange trackingSpanRange, List nonIntersectingSpans, bool isEmpty, bool textChanged)
8 | {
9 | this.TrackingSpanRange = trackingSpanRange;
10 | this.NonIntersectingSpans = nonIntersectingSpans;
11 | this.IsEmpty = isEmpty;
12 | this.TextChanged = textChanged;
13 | }
14 | public ITrackingSpanRange TrackingSpanRange { get; }
15 | public List NonIntersectingSpans { get; }
16 | public bool IsEmpty { get; }
17 | public bool TextChanged { get; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/ContainingCodeTrackerProcessResult.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal class ContainingCodeTrackerProcessResult : IContainingCodeTrackerProcessResult
6 | {
7 | public ContainingCodeTrackerProcessResult(IEnumerable changedLines, List unprocessedSpans, bool isEmpty)
8 | {
9 | this.ChangedLines = changedLines;
10 | this.UnprocessedSpans = unprocessedSpans;
11 | this.IsEmpty = isEmpty;
12 | }
13 | public bool IsEmpty { get; }
14 | public IEnumerable ChangedLines { get; set; }
15 |
16 | public List UnprocessedSpans { get; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/ITrackedCoverageLines.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ITrackedCoverageLines
7 | {
8 | IEnumerable Lines { get; }
9 | IEnumerable GetUpdatedLineNumbers(ITextSnapshot currentSnapshot);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/ITrackingLine.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ITrackingLine
7 | {
8 | IDynamicLine Line { get; }
9 |
10 | List Update(ITextSnapshot currentSnapshot);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/ITrackingSpanRange.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ITrackingSpanRange
7 | {
8 | TrackingSpanRangeProcessResult Process(ITextSnapshot currentSnapshot, List newSpanAndLineRanges);
9 | ITrackingSpan GetFirstTrackingSpan();
10 | CodeSpanRange ToCodeSpanRange();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/IUpdatableDynamicLines.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface IUpdatableDynamicLines
7 | {
8 | IEnumerable Lines { get; }
9 | ContainingCodeTrackerType Type { get; }
10 |
11 | IEnumerable GetUpdatedLineNumbers(
12 | TrackingSpanRangeProcessResult trackingSpanRangeProcessResult,
13 | ITextSnapshot currentSnapshot,
14 | List newSpanAndLineRanges);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/OtherLinesTracker.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | internal class OtherLinesTracker : IUpdatableDynamicLines
8 | {
9 | public IEnumerable Lines { get; } = Enumerable.Empty();
10 |
11 | public ContainingCodeTrackerType Type => ContainingCodeTrackerType.OtherLines;
12 |
13 | public IEnumerable GetUpdatedLineNumbers(
14 | TrackingSpanRangeProcessResult trackingSpanRangeProcessResult,
15 | ITextSnapshot currentSnapshot,
16 | List newSpanAndLineRanges) => Enumerable.Empty();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/ContainingCodeTracker/TrackingLineTracker.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal class TrackingLineTracker : IUpdatableDynamicLines
7 | {
8 | private readonly ITrackingLine trackingLine;
9 |
10 | public TrackingLineTracker(
11 | ITrackingLine trackingLine, ContainingCodeTrackerType containingCodeTrackerType
12 | )
13 | {
14 | this.trackingLine = trackingLine;
15 | this.Type = containingCodeTrackerType;
16 | }
17 |
18 | public IEnumerable Lines => new List { this.trackingLine.Line };
19 |
20 | public ContainingCodeTrackerType Type { get; }
21 |
22 | public IEnumerable GetUpdatedLineNumbers(
23 | TrackingSpanRangeProcessResult trackingSpanRangeProcessResult,
24 | ITextSnapshot currentSnapshot,
25 | List newSpanAndLineRanges) => this.trackingLine.Update(currentSnapshot);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/LineExclusion/ILineExcluder.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal interface ILineExcluder
4 | {
5 | bool ExcludeIfNotCode(string text);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/TrackedLinesImpl/LineExclusion/LineExcluder.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Linq;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | [Export(typeof(ILineExcluder))]
7 | internal class LineExcluder : ILineExcluder
8 | {
9 | private readonly string[] startsWithExclusions;
10 |
11 | public LineExcluder(string[] startsWithExclusions) => this.startsWithExclusions = startsWithExclusions;
12 |
13 | public bool ExcludeIfNotCode(string text)
14 | {
15 | string trimmedLineText = text.Trim();
16 | return trimmedLineText.Length == 0 || this.StartsWithExclusion(trimmedLineText);
17 | }
18 |
19 | private bool StartsWithExclusion(string text)
20 | => this.startsWithExclusions.Any(languageExclusion => text.StartsWith(languageExclusion));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/DateTimeService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage.Utilities
5 | {
6 | [Export(typeof(IDateTimeService))]
7 | internal class DateTimeService : IDateTimeService
8 | {
9 | public DateTime Now => DateTime.Now;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/IDateTimeService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage.Utilities
4 | {
5 | internal interface IDateTimeService
6 | {
7 | DateTime Now { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/ILineTracker.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ILineTracker
6 | {
7 | int GetLineNumber(ITrackingSpan trackingSpan, ITextSnapshot currentSnapshot, bool lineFromEnd);
8 |
9 | TrackedLineInfo GetTrackedLineInfo(ITrackingSpan trackingSpan, ITextSnapshot currentSnapshot, bool lineFromEnd);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/ISyntaxNodeLocationMapper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage.Utilities
4 | {
5 | internal interface ISyntaxNodeLocationMapper
6 | {
7 | FileLinePositionSpan Map(SyntaxNode node);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/ITextInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.VisualStudio.Text;
3 | using Microsoft.VisualStudio.Text.Editor;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | internal interface ITextInfo
8 | {
9 | string FilePath { get; }
10 | ITextBuffer2 TextBuffer { get; }
11 | ITextView TextView { get; }
12 | string GetFileText();
13 | DateTime GetLastWriteTime();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/ITextInfoFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 | using Microsoft.VisualStudio.Text.Editor;
3 |
4 | namespace FineCodeCoverage.Editor.DynamicCoverage
5 | {
6 | internal interface ITextInfoFactory
7 | {
8 | ITextInfo Create(ITextView textView, ITextBuffer textBuffer);
9 | string GetFilePath(ITextBuffer textBuffer);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/ITextSnapshotText.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITextSnapshotText
6 | {
7 | string GetLineText(ITextSnapshot textSnapshot, int lineNumber);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/ITrackingLineFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 |
3 | namespace FineCodeCoverage.Editor.DynamicCoverage
4 | {
5 | internal interface ITrackingLineFactory
6 | {
7 | ITrackingSpan CreateTrackingSpan(ITextSnapshot textSnapshot, int lineNumber, SpanTrackingMode spanTrackingMode);
8 | }
9 | }
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/SyntaxNodeLocationMapper.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Microsoft.CodeAnalysis;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage.Utilities
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(ISyntaxNodeLocationMapper))]
9 | internal class SyntaxNodeLocationMapper : ISyntaxNodeLocationMapper
10 | {
11 | public FileLinePositionSpan Map(SyntaxNode node) => node.GetLocation().GetMappedLineSpan();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/TextInfoFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Microsoft.VisualStudio.Text;
4 | using Microsoft.VisualStudio.Text.Editor;
5 |
6 | namespace FineCodeCoverage.Editor.DynamicCoverage
7 | {
8 | [ExcludeFromCodeCoverage]
9 | [Export(typeof(ITextInfoFactory))]
10 | internal class TextInfoFactory : ITextInfoFactory
11 | {
12 | public ITextInfo Create(ITextView textView, ITextBuffer textBuffer) => new TextInfo(textView, textBuffer);
13 | public string GetFilePath(ITextBuffer textBuffer) => new TextInfo(null, textBuffer).FilePath;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/TextSnapshotText.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.DynamicCoverage
6 | {
7 | [Export(typeof(ITextSnapshotText))]
8 | [ExcludeFromCodeCoverage]
9 | internal class TextSnapshotText : ITextSnapshotText
10 | {
11 | public string GetLineText(ITextSnapshot textSnapshot, int lineNumber)
12 | => textSnapshot.GetLineFromLineNumber(lineNumber).Extent.GetText();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Editor/DynamicCoverage/Utilities/TrackedLineInfo.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.DynamicCoverage
2 | {
3 | internal readonly struct TrackedLineInfo
4 | {
5 | public TrackedLineInfo(int lineNumber, string lineText)
6 | {
7 | this.LineNumber = lineNumber;
8 | this.LineText = lineText;
9 | }
10 | public int LineNumber { get; }
11 | public string LineText { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharedProject/Editor/IndicatorVisibility/FileIndicatorVisibility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 | using FineCodeCoverage.Core.Initialization;
4 | using FineCodeCoverage.Core.Utilities;
5 | using FineCodeCoverage.Output;
6 |
7 | namespace FineCodeCoverage.Editor.IndicatorVisibility
8 | {
9 | [Export(typeof(IInitializable))]
10 | [Export(typeof(IFileIndicatorVisibility))]
11 | internal class FileIndicatorVisibility : IFileIndicatorVisibility, IListener, IInitializable
12 | {
13 | private bool showIndicators = true;
14 | public event EventHandler VisibilityChanged;
15 |
16 | [ImportingConstructor]
17 | public FileIndicatorVisibility(IEventAggregator eventAggregator)
18 | => _ = eventAggregator.AddListener(this);
19 |
20 | public bool IsVisible(string filePath) => this.showIndicators;
21 | public void Handle(ToggleCoverageIndicatorsMessage message)
22 | {
23 | this.showIndicators = !this.showIndicators;
24 | VisibilityChanged?.Invoke(this, EventArgs.Empty);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SharedProject/Editor/IndicatorVisibility/IFileIndicatorVisibility.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FineCodeCoverage.Editor.IndicatorVisibility
6 | {
7 | internal interface IFileIndicatorVisibility
8 | {
9 | event EventHandler VisibilityChanged;
10 | bool IsVisible(string filePath);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ColoursClassificationFormatDefinition.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 | using Microsoft.VisualStudio.Text.Classification;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal class ColoursClassificationFormatDefinition : ClassificationFormatDefinition
7 | {
8 | public ColoursClassificationFormatDefinition(Color foregroundColor, Color backgroundColor)
9 | {
10 | this.ForegroundColor = foregroundColor;
11 | this.BackgroundColor = backgroundColor;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/CoverageColoursChangedMessage.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | internal class CoverageColoursChangedMessage
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/CoverageTypeColour.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using Microsoft.VisualStudio.Text.Formatting;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal class CoverageTypeColour : ICoverageTypeColour
7 | {
8 | public CoverageTypeColour(DynamicCoverageType coverageType, TextFormattingRunProperties textFormattingRunProperties)
9 | {
10 | this.CoverageType = coverageType;
11 | this.TextFormattingRunProperties = textFormattingRunProperties;
12 | }
13 |
14 | public DynamicCoverageType CoverageType { get; }
15 | public TextFormattingRunProperties TextFormattingRunProperties { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/DelayedMainThreadInvocation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.Composition;
3 | using System.Diagnostics.CodeAnalysis;
4 | using System.Threading.Tasks;
5 | using Microsoft.VisualStudio.Shell;
6 |
7 | namespace FineCodeCoverage.Editor.Management
8 | {
9 | [ExcludeFromCodeCoverage]
10 | [Export(typeof(IDelayedMainThreadInvocation))]
11 | internal class DelayedMainThreadInvocation : IDelayedMainThreadInvocation
12 | {
13 | public void DelayedInvoke(Action action)
14 | => _ = System.Threading.Tasks.Task.Delay(0).ContinueWith(_ =>
15 | ThreadHelper.JoinableTaskFactory.RunAsync(async () =>
16 | {
17 | await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
18 | action();
19 | }), TaskScheduler.Default);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/FCCEditorFormatDefinitionNames.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | internal readonly struct FCCEditorFormatDefinitionNames
4 | {
5 | public FCCEditorFormatDefinitionNames(
6 | string covered, string notCovered, string partiallyCovered, string newLines, string dirty, string notIncluded
7 | )
8 | {
9 | this.Covered = covered;
10 | this.NotCovered = notCovered;
11 | this.PartiallyCovered = partiallyCovered;
12 | this.NewLines = newLines;
13 | this.Dirty = dirty;
14 | this.NotIncluded = notIncluded;
15 | }
16 |
17 | public string Covered { get; }
18 | public string NotCovered { get; }
19 | public string PartiallyCovered { get; }
20 | public string NewLines { get; }
21 | public string Dirty { get; }
22 | public string NotIncluded { get; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/FontAndColorsCategoryItemName.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal readonly struct FontAndColorsCategoryItemName
6 | {
7 | public FontAndColorsCategoryItemName(string itemName, Guid category)
8 | {
9 | this.Category = category;
10 | this.ItemName = itemName;
11 | }
12 | public Guid Category { get; }
13 | public string ItemName { get; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/FontAndColorsInfo.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | internal class FontAndColorsInfo : IFontAndColorsInfo
4 | {
5 | public FontAndColorsInfo(IItemCoverageColours itemCoverageColours, bool isBold)
6 | {
7 | this.ItemCoverageColours = itemCoverageColours;
8 | this.IsBold = isBold;
9 | }
10 |
11 | public IItemCoverageColours ItemCoverageColours { get; }
12 | public bool IsBold { get; }
13 |
14 | public bool Equals(IFontAndColorsInfo other) => this.IsBold == other.IsBold && this.ItemCoverageColours.Equals(other.ItemCoverageColours);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageClassificationColourService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface ICoverageClassificationColourService : ICoverageTypeService
6 | {
7 | void SetCoverageColours(IEnumerable coverageTypeColours);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageColours.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface ICoverageColours
6 | {
7 | IItemCoverageColours GetColour(DynamicCoverageType coverageType);
8 | }
9 | }
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageColoursEditorFormatMapNames.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface ICoverageColoursEditorFormatMapNames
6 | {
7 | string GetEditorFormatDefinitionName(DynamicCoverageType coverageType);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageColoursProvider.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | internal interface ICoverageColoursProvider
4 | {
5 | ICoverageColours GetCoverageColours();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageFontAndColorsCategoryItemNames.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | internal interface ICoverageFontAndColorsCategoryItemNames
4 | {
5 | FontAndColorsCategoryItemName Covered { get; }
6 | FontAndColorsCategoryItemName Dirty { get; }
7 | FontAndColorsCategoryItemName NewLines { get; }
8 | FontAndColorsCategoryItemName NotCovered { get; }
9 | FontAndColorsCategoryItemName PartiallyCovered { get; }
10 | FontAndColorsCategoryItemName NotIncluded { get; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageFontAndColorsCategoryItemNamesManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface ICoverageFontAndColorsCategoryItemNamesManager
6 | {
7 | event EventHandler Changed;
8 | void Initialize(FCCEditorFormatDefinitionNames fCCEditorFormatDefinitionNames);
9 | ICoverageFontAndColorsCategoryItemNames CategoryItemNames { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageTypeColour.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using Microsoft.VisualStudio.Text.Formatting;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal interface ICoverageTypeColour
7 | {
8 | DynamicCoverageType CoverageType { get; }
9 | TextFormattingRunProperties TextFormattingRunProperties { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ICoverageTypeService.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using Microsoft.VisualStudio.Text.Classification;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal interface ICoverageTypeService
7 | {
8 | IClassificationType GetClassificationType(DynamicCoverageType coverageType);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IDelayedMainThreadInvocation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface IDelayedMainThreadInvocation
6 | {
7 | void DelayedInvoke(Action action);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IEditorFormatMapTextSpecificListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal interface IEditorFormatMapTextSpecificListener
7 | {
8 | void ListenFor(List keys, Action callback);
9 | void PauseListeningWhenExecuting(Action value);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IFontAndColorsInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface IFontAndColorsInfo : IEquatable
6 | {
7 | IItemCoverageColours ItemCoverageColours { get; }
8 | bool IsBold { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IFontAndColorsInfosProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FineCodeCoverage.Editor.DynamicCoverage;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal interface IFontAndColorsInfosProvider
7 | {
8 | Dictionary GetChangedFontAndColorsInfos();
9 | Dictionary GetFontAndColorsInfos();
10 | ICoverageFontAndColorsCategoryItemNames CoverageFontAndColorsCategoryItemNames { set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IFontsAndColorsHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal interface IFontsAndColorsHelper
7 | {
8 | System.Threading.Tasks.Task> GetInfosAsync(Guid category, IEnumerable names);
9 | }
10 | }
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IItemCoverageColours.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media;
3 |
4 | namespace FineCodeCoverage.Editor.Management
5 | {
6 | internal interface IItemCoverageColours : IEquatable
7 | {
8 | Color Foreground { get; }
9 | Color Background { get; }
10 | }
11 | }
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ITextFormattingRunPropertiesFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text.Formatting;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal interface ITextFormattingRunPropertiesFactory
6 | {
7 | TextFormattingRunProperties Create(IFontAndColorsInfo fontAndColorsInfo);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/IVsHasCoverageMarkersLogic.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | internal interface IVsHasCoverageMarkersLogic
4 | {
5 | bool HasCoverageMarkers();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/ItemCoverageColours.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 |
3 | namespace FineCodeCoverage.Editor.Management
4 | {
5 | internal class ItemCoverageColours : IItemCoverageColours
6 | {
7 | public ItemCoverageColours(Color foreground, Color background)
8 | {
9 | this.Foreground = foreground;
10 | this.Background = background;
11 | }
12 |
13 | public Color Foreground { get; }
14 | public Color Background { get; }
15 |
16 | public bool Equals(IItemCoverageColours other) => this.Foreground == other.Foreground && this.Background == other.Background;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/MarkerTypeNames.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Management
2 | {
3 | public class MarkerTypeNames
4 | {
5 | public const string Covered = "Coverage Touched Area";
6 | public const string NotCovered = "Coverage Not Touched Area";
7 | public const string PartiallyCovered = "Coverage Partially Touched Area";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Management/VsHasCoverageMarkersLogic.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using FineCodeCoverage.Options;
4 |
5 | namespace FineCodeCoverage.Editor.Management
6 | {
7 | [ExcludeFromCodeCoverage]
8 | [Export(typeof(IVsHasCoverageMarkersLogic))]
9 | internal class VsHasCoverageMarkersLogic : IVsHasCoverageMarkersLogic
10 | {
11 | private readonly IReadOnlyConfigSettingsStoreProvider readOnlyConfigSettingsStoreProvider;
12 |
13 | [ImportingConstructor]
14 | public VsHasCoverageMarkersLogic(
15 | IReadOnlyConfigSettingsStoreProvider readOnlyConfigSettingsStoreProvider
16 | ) => this.readOnlyConfigSettingsStoreProvider = readOnlyConfigSettingsStoreProvider;
17 |
18 | public bool HasCoverageMarkers()
19 | {
20 | Microsoft.VisualStudio.Settings.SettingsStore readOnlySettingsStore = this.readOnlyConfigSettingsStoreProvider.Provide();
21 | return readOnlySettingsStore.CollectionExists(@"Text Editor\External Markers\{b4ee9ead-e105-11d7-8a44-00065bbd20a4}");
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/ICSharpCodeCoverageNodeVisitor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis;
3 |
4 | namespace FineCodeCoverage.Editor.Roslyn
5 | {
6 | internal interface ICSharpCodeCoverageNodeVisitor
7 | {
8 | List GetNodes(SyntaxNode rootNode);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/ILanguageContainingCodeVisitor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Microsoft.CodeAnalysis;
3 | using Microsoft.CodeAnalysis.Text;
4 |
5 | namespace FineCodeCoverage.Editor.Roslyn
6 | {
7 | internal interface ILanguageContainingCodeVisitor
8 | {
9 | List GetSpans(SyntaxNode rootNode);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/ILanguageContainingCodeVisitorFactory.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Roslyn
2 | {
3 | internal interface ILanguageContainingCodeVisitorFactory
4 | {
5 | ILanguageContainingCodeVisitor Create(bool isCSharp);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/IRoslynService.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using Microsoft.CodeAnalysis.Text;
4 | using Microsoft.VisualStudio.Text;
5 |
6 | namespace FineCodeCoverage.Editor.Roslyn
7 | {
8 | internal interface IRoslynService
9 | {
10 | Task> GetContainingCodeSpansAsync(ITextSnapshot textSnapshot);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/ITextSnapshotToSyntaxService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.Roslyn
5 | {
6 | internal interface ITextSnapshotToSyntaxService
7 | {
8 | Task GetRootAndLanguageAsync(ITextSnapshot textSnapshot);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/LanguageContainingCodeVisitorFactory.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 |
3 | namespace FineCodeCoverage.Editor.Roslyn
4 | {
5 | [Export(typeof(ILanguageContainingCodeVisitorFactory))]
6 | internal class LanguageContainingCodeVisitorFactory : ILanguageContainingCodeVisitorFactory
7 | {
8 | public ILanguageContainingCodeVisitor Create(bool isCSharp)
9 | => isCSharp ? new CSharpContainingCodeVisitor() as ILanguageContainingCodeVisitor : new VBContainingCodeVisitor();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/RootNodeAndLanguage.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.CodeAnalysis;
2 |
3 | namespace FineCodeCoverage.Editor.Roslyn
4 | {
5 | internal class RootNodeAndLanguage
6 | {
7 | public SyntaxNode Root { get; }
8 | public string Language { get; }
9 |
10 | public RootNodeAndLanguage(SyntaxNode root, string language)
11 | {
12 | this.Root = root;
13 | this.Language = language;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Roslyn/TextSnapshotToSyntaxService.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Threading.Tasks;
4 | using Microsoft.CodeAnalysis.Text;
5 | using Microsoft.VisualStudio.Text;
6 |
7 | namespace FineCodeCoverage.Editor.Roslyn
8 | {
9 | [ExcludeFromCodeCoverage]
10 | [Export(typeof(ITextSnapshotToSyntaxService))]
11 | internal class TextSnapshotToSyntaxService : ITextSnapshotToSyntaxService
12 | {
13 | public async Task GetRootAndLanguageAsync(ITextSnapshot textSnapshot)
14 | {
15 | Microsoft.CodeAnalysis.Document document = textSnapshot.GetOpenDocumentInCurrentContextWithChanges();
16 | if (document != null)
17 | {
18 | string language = document.Project.Language;
19 | Microsoft.CodeAnalysis.SyntaxNode root = await document.GetSyntaxRootAsync();
20 | return new RootNodeAndLanguage(root, language);
21 | }
22 |
23 | return null;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/CoverageTypeFilter/CoverageTypeFilterChangedMessage.cs:
--------------------------------------------------------------------------------
1 | namespace FineCodeCoverage.Editor.Tagging.Base
2 | {
3 | internal class CoverageTypeFilterChangedMessage
4 | {
5 | public CoverageTypeFilterChangedMessage(ICoverageTypeFilter filter) => this.Filter = filter;
6 |
7 | public ICoverageTypeFilter Filter { get; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/CoverageTypeFilter/ICoverageTypeFilter.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using FineCodeCoverage.Options;
3 |
4 | namespace FineCodeCoverage.Editor.Tagging.Base
5 | {
6 | internal interface ICoverageTypeFilter
7 | {
8 | void Initialize(IAppOptions appOptions);
9 | bool Disabled { get; }
10 | bool Show(DynamicCoverageType coverageType);
11 | string TypeIdentifier { get; }
12 | bool Changed(ICoverageTypeFilter other);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/ICoverageTagger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.VisualStudio.Text.Tagging;
3 |
4 | namespace FineCodeCoverage.Editor.Tagging.Base
5 | {
6 | internal interface ICoverageTagger : ITagger, IDisposable where T : ITag
7 | {
8 | void RaiseTagsChanged();
9 | bool HasCoverage { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/ICoverageTaggerProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text;
2 | using Microsoft.VisualStudio.Text.Editor;
3 | using Microsoft.VisualStudio.Text.Tagging;
4 |
5 | namespace FineCodeCoverage.Editor.Tagging.Base
6 | {
7 | internal interface ICoverageTaggerProvider where TTag : ITag
8 | {
9 | ICoverageTagger CreateTagger(ITextView textView, ITextBuffer textBuffer);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/ICoverageTaggerProviderFactory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text.Tagging;
2 |
3 | namespace FineCodeCoverage.Editor.Tagging.Base
4 | {
5 | internal interface ICoverageTaggerProviderFactory
6 | {
7 | ICoverageTaggerProvider Create(ILineSpanTagger tagger)
8 | where TTag : ITag where TCoverageTypeFilter : ICoverageTypeFilter, new();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/IFileExcluder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace FineCodeCoverage.Editor.Tagging.Base
6 | {
7 | internal interface IFileExcluder
8 | {
9 | string ContentTypeName { get; }
10 | bool Exclude(string filePath);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/ILineSpan.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.Tagging.Base
5 | {
6 | internal interface ILineSpan
7 | {
8 | IDynamicLine Line { get; }
9 | SnapshotSpan Span { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/ILineSpanLogic.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FineCodeCoverage.Editor.DynamicCoverage;
3 | using Microsoft.VisualStudio.Text;
4 |
5 | namespace FineCodeCoverage.Editor.Tagging.Base
6 | {
7 | internal interface ILineSpanLogic
8 | {
9 | IEnumerable GetLineSpans(IBufferLineCoverage bufferLineCoverage, NormalizedSnapshotSpanCollection spans);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/ILineSpanTagger.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Text.Tagging;
2 |
3 | namespace FineCodeCoverage.Editor.Tagging.Base
4 | {
5 | internal interface ILineSpanTagger where TTag : ITag
6 | {
7 | TagSpan GetTagSpan(ILineSpan lineSpan);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/Base/LineSpan.cs:
--------------------------------------------------------------------------------
1 | using FineCodeCoverage.Editor.DynamicCoverage;
2 | using Microsoft.VisualStudio.Text;
3 |
4 | namespace FineCodeCoverage.Editor.Tagging.Base
5 | {
6 | internal class LineSpan : ILineSpan
7 | {
8 | public LineSpan(IDynamicLine line, SnapshotSpan span)
9 | {
10 | this.Line = line;
11 | this.Span = span;
12 | }
13 | public IDynamicLine Line { get; }
14 |
15 | public SnapshotSpan Span { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/GlyphMargin/CoverageLineGlyphFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Media;
3 | using System.Windows.Shapes;
4 | using Microsoft.VisualStudio.Text.Editor;
5 | using Microsoft.VisualStudio.Text.Formatting;
6 |
7 | namespace FineCodeCoverage.Editor.Tagging.GlyphMargin
8 | {
9 | internal class CoverageLineGlyphFactory : IGlyphFactory
10 | {
11 | public UIElement GenerateGlyph(IWpfTextViewLine textViewLine, IGlyphTag glyphTag)
12 | => glyphTag is CoverageLineGlyphTag tag
13 | ? this.GetColouredRectange(tag.Colour)
14 | : (UIElement)null;
15 |
16 | private Rectangle GetColouredRectange(Color colour) => new Rectangle
17 | {
18 | Fill = new SolidColorBrush(colour),
19 | Width = 3,
20 | Height = 16
21 | };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SharedProject/Editor/Tagging/GlyphMargin/CoverageLineGlyphTag.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Media;
2 | using Microsoft.VisualStudio.Text.Editor;
3 |
4 | namespace FineCodeCoverage.Editor.Tagging.GlyphMargin
5 | {
6 | internal class CoverageLineGlyphTag : IGlyphTag
7 | {
8 | public Color Colour { get; }
9 |
10 | public CoverageLineGlyphTag(Color colour) => this.Colour = colour;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/SharedProject/Impl/ILogger.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace FineCodeCoverage.Output
4 | {
5 | public interface ILogger
6 | {
7 | void Log(IEnumerable