private IssuesSnapshot(Guid snapshotId, string projectName, Guid projectGuid, string filePath, IEnumerable <IAnalysisIssueVisualization> issues, IAnalysisSeverityToVsSeverityConverter toVsSeverityConverter, IRuleHelpLinkProvider ruleHelpLinkProvider) { var areAllIssuesAnalysisIssues = issues.All(x => x.Issue is IAnalysisIssue); if (!areAllIssuesAnalysisIssues) { throw new InvalidCastException($"Some {nameof(issues)} do not contain {nameof(IAnalysisIssue)}"); } this.AnalysisRunId = snapshotId; this.AnalyzedFilePath = filePath; this.projectName = projectName; this.projectGuid = projectGuid; this.versionNumber = GetNextVersionNumber(); this.toVsSeverityConverter = toVsSeverityConverter; this.ruleHelpLinkProvider = ruleHelpLinkProvider; this.issues = new List <IAnalysisIssueVisualization>(issues); this.readonlyIssues = new ReadOnlyCollection <IAnalysisIssueVisualization>(this.issues); // Optimistation: // Most rules only have a single location, and most multi-location rules only produce locations // for a single file. So most snapshots will only have issues relating to a single file. // However, we still need to notify every tagger when any snapshot has updated, in case there // any of the issues have secondary locations that the tagger needs to handle. // This optimisation gives the tagger a quick way to check that it does not need to do any work // i.e. if the file handled by the tagger is not in the list, do nothing. this.FilesInSnapshot = CalculateFilesInSnapshot(filePath, issues); }
internal ShowInBrowserService(ISonarQubeService sonarQubeService, IConfigurationProvider configurationProvider, IVsBrowserService vsBrowserService, IRuleHelpLinkProvider ruleHelpLinkProvider) { this.sonarQubeService = sonarQubeService; this.configurationProvider = configurationProvider; this.vsBrowserService = vsBrowserService; this.ruleHelpLinkProvider = ruleHelpLinkProvider; }
private ShowInBrowserService CreateTestSubject(ISonarQubeService sonarQubeService = null, IConfigurationProvider configurationProvider = null, IVsBrowserService browserService = null, IRuleHelpLinkProvider helpLinkProvider = null) { sonarQubeService ??= Mock.Of <ISonarQubeService>(); configurationProvider ??= Mock.Of <IConfigurationProvider>(); browserService ??= Mock.Of <IVsBrowserService>(); helpLinkProvider ??= Mock.Of <IRuleHelpLinkProvider>(); return(new ShowInBrowserService(sonarQubeService, configurationProvider, browserService, helpLinkProvider)); }
internal ErrorTagTooltipProvider(IVsBrowserService browserService, IVsThemeColorProvider vsThemeColorProvider, IRuleHelpLinkProvider ruleHelpLinkProvider) { this.browserService = browserService; this.vsThemeColorProvider = vsThemeColorProvider; this.ruleHelpLinkProvider = ruleHelpLinkProvider; }