// internal for testing purposes internal DiagnosticAnalyzerDriver( Project project, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, CancellationToken cancellationToken) { this.project = project; this.cancellationToken = cancellationToken; this.syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; this.generatedCodeService = project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); this.analyzerDriverService = project.LanguageServices.GetService <IAnalyzerDriverService>(); this.descendantExecutableNodesMap = null; this.analyzerOptions = this.project.AnalyzerOptions; }
public DiagnosticAnalyzerDriver( Project project, BaseDiagnosticIncrementalAnalyzer owner, CancellationToken cancellationToken) { _project = project; _owner = owner; _syntaxNodeAnalyzerService = project.LanguageServices.GetService <ISyntaxNodeAnalyzerService>(); _cancellationToken = cancellationToken; _generatedCodeService = project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); _analyzerDriverService = project.LanguageServices.GetService <IAnalyzerDriverService>(); _analyzerOptions = new WorkspaceAnalyzerOptions(project.AnalyzerOptions, project.Solution.Workspace); _onAnalyzerException = owner.GetOnAnalyzerException(project.Id); _onAnalyzerException_NoTelemetryLogging = owner.GetOnAnalyzerException_NoTelemetryLogging(project.Id); }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Project project, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, CancellationToken cancellationToken) { _project = project; _cancellationToken = cancellationToken; _syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; _generatedCodeService = project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); _analyzerDriverService = project.LanguageServices.GetService <IAnalyzerDriverService>(); _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource; _descendantExecutableNodesMap = null; _analyzerOptions = _project.AnalyzerOptions; }
public DiagnosticAnalyzerDriver( Project project, BaseDiagnosticIncrementalAnalyzer owner, CancellationToken cancellationToken) { _project = project; _owner = owner; _syntaxNodeAnalyzerService = project.LanguageServices.GetService<ISyntaxNodeAnalyzerService>(); _cancellationToken = cancellationToken; _generatedCodeService = project.Solution.Workspace.Services.GetService<IGeneratedCodeRecognitionService>(); _analyzerDriverService = project.LanguageServices.GetService<IAnalyzerDriverService>(); _analyzerOptions = new WorkspaceAnalyzerOptions(project.AnalyzerOptions, project.Solution.Workspace); _onAnalyzerException = owner.GetOnAnalyzerException(project.Id); _onAnalyzerException_NoTelemetryLogging = owner.GetOnAnalyzerException_NoTelemetryLogging(project.Id); }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Project project, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, Action <Exception, DiagnosticAnalyzer, Diagnostic> overriddenOnAnalyzerException = null, CancellationToken cancellationToken = default(CancellationToken)) { _project = project; _cancellationToken = cancellationToken; _syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; _generatedCodeService = project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); _analyzerDriverService = project.LanguageServices.GetService <IAnalyzerDriverService>(); _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource; _analyzerOptions = new WorkspaceAnalyzerOptions(_project.AnalyzerOptions, _project.Solution.Workspace); _onAnalyzerException = overriddenOnAnalyzerException ?? Default_OnAnalyzerException; _onAnalyzerException_NoTelemetryLogging = overriddenOnAnalyzerException ?? Default_OnAnalyzerException_NoTelemetryLogging; }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Document document, TextSpan?span, SyntaxNode root, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, CancellationToken cancellationToken, bool testOnly_DonotCatchAnalyzerExceptions = false) { this.document = document; this.span = span; this.root = root; this.project = document.Project; this.syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; this.cancellationToken = cancellationToken; this.descendantExecutableNodesMap = new Dictionary <SyntaxNode, ImmutableArray <SyntaxNode> >(); this.syntaxFacts = document.Project.LanguageServices.GetService <ISyntaxFactsService>(); this.generatedCodeService = document.Project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); this.analyzerDriverService = document.Project.LanguageServices.GetService <IAnalyzerDriverService>(); this.analyzerOptions = new WorkspaceAnalyzerOptions(this.project.AnalyzerOptions, this.project.Solution.Workspace); this.testOnly_DonotCatchAnalyzerExceptions = testOnly_DonotCatchAnalyzerExceptions; }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Document document, TextSpan? span, SyntaxNode root, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, CancellationToken cancellationToken, bool testOnly_DonotCatchAnalyzerExceptions = false) { _document = document; _span = span; _root = root; _project = document.Project; _syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; _cancellationToken = cancellationToken; _descendantExecutableNodesMap = new Dictionary<SyntaxNode, ImmutableArray<SyntaxNode>>(); _syntaxFacts = document.Project.LanguageServices.GetService<ISyntaxFactsService>(); _generatedCodeService = document.Project.Solution.Workspace.Services.GetService<IGeneratedCodeRecognitionService>(); _analyzerDriverService = document.Project.LanguageServices.GetService<IAnalyzerDriverService>(); _analyzerOptions = new WorkspaceAnalyzerOptions(_project.AnalyzerOptions, _project.Solution.Workspace); _testOnly_DonotCatchAnalyzerExceptions = testOnly_DonotCatchAnalyzerExceptions; }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Document document, TextSpan?span, SyntaxNode root, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, CancellationToken cancellationToken, bool testOnly_DonotCatchAnalyzerExceptions = false) { _document = document; _span = span; _root = root; _project = document.Project; _syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource; _cancellationToken = cancellationToken; _descendantExecutableNodesMap = new Dictionary <SyntaxNode, ImmutableArray <SyntaxNode> >(); _syntaxFacts = document.Project.LanguageServices.GetService <ISyntaxFactsService>(); _generatedCodeService = document.Project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); _analyzerDriverService = document.Project.LanguageServices.GetService <IAnalyzerDriverService>(); _analyzerOptions = new WorkspaceAnalyzerOptions(_project.AnalyzerOptions, _project.Solution.Workspace); _testOnly_DonotCatchAnalyzerExceptions = testOnly_DonotCatchAnalyzerExceptions; }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Document document, TextSpan?span, SyntaxNode root, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, AbstractHostDiagnosticUpdateSource hostDiagnosticUpdateSource, Action <Exception, DiagnosticAnalyzer, Diagnostic> overriddenOnAnalyzerException = null, CancellationToken cancellationToken = default(CancellationToken)) { _document = document; _span = span; _root = root; _project = document.Project; _syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; _hostDiagnosticUpdateSource = hostDiagnosticUpdateSource; _cancellationToken = cancellationToken; _descendantExecutableNodesMap = new Dictionary <SyntaxNode, ImmutableArray <SyntaxNode> >(); _syntaxFacts = document.Project.LanguageServices.GetService <ISyntaxFactsService>(); _generatedCodeService = document.Project.Solution.Workspace.Services.GetService <IGeneratedCodeRecognitionService>(); _analyzerDriverService = document.Project.LanguageServices.GetService <IAnalyzerDriverService>(); _analyzerOptions = new WorkspaceAnalyzerOptions(_project.AnalyzerOptions, _project.Solution.Workspace); _onAnalyzerException = overriddenOnAnalyzerException ?? Default_OnAnalyzerException; _onAnalyzerException_NoTelemetryLogging = overriddenOnAnalyzerException ?? Default_OnAnalyzerException_NoTelemetryLogging; }
// internal for testing purposes internal DiagnosticAnalyzerDriver( Project project, ISyntaxNodeAnalyzerService syntaxNodeAnalyzerService, CancellationToken cancellationToken) { _project = project; _cancellationToken = cancellationToken; _syntaxNodeAnalyzerService = syntaxNodeAnalyzerService; _generatedCodeService = project.Solution.Workspace.Services.GetService<IGeneratedCodeRecognitionService>(); _analyzerDriverService = project.LanguageServices.GetService<IAnalyzerDriverService>(); _descendantExecutableNodesMap = null; _analyzerOptions = _project.AnalyzerOptions; }