17 instantiations of InvocationReasons
Microsoft.CodeAnalysis.Workspaces (17)
ExternalAccess\UnitTesting\Api\UnitTestingInvocationReasonsWrapper.cs (1)
34: this(new InvocationReasons(reason)) { }
SolutionCrawler\InvocationReasons.cs (3)
15public static readonly InvocationReasons Empty = new(ImmutableHashSet<string>.Empty); 34=> new(_reasons.Union(invocationReasons._reasons)); 37=> new(_reasons.Add(reason));
SolutionCrawler\InvocationReasons_Constants.cs (13)
14new( 21new( 29new( 36new( 43new( 49new( 55new( 61new( 67new( 73new( 78new( 83new(PredefinedInvocationReasons.Reanalyze); 89new(PredefinedInvocationReasons.ActiveDocumentSwitched);
148 references to InvocationReasons
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (33)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (19)
511await incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged: true, InvocationReasons.Reanalyze, CancellationToken.None); 617await incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged: true, InvocationReasons.Reanalyze, CancellationToken.None); 674await incrementalAnalyzer.AnalyzeNonSourceDocumentAsync(firstAdditionalDocument, InvocationReasons.SyntaxChanged, CancellationToken.None); 678await incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged: true, InvocationReasons.Reanalyze, CancellationToken.None); 786await incrementalAnalyzer.AnalyzeDocumentAsync(document, bodyOpt: null, InvocationReasons.SemanticChanged, CancellationToken.None); 791await incrementalAnalyzer.AnalyzeDocumentAsync(document, bodyOpt: null, InvocationReasons.SemanticChanged, CancellationToken.None); 795await incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged: true, InvocationReasons.Reanalyze, CancellationToken.None); 921await incrementalAnalyzer.AnalyzeDocumentAsync(document, bodyOpt: null, InvocationReasons.SemanticChanged, CancellationToken.None); 930await incrementalAnalyzer.AnalyzeDocumentAsync(document, bodyOpt: null, InvocationReasons.SemanticChanged, CancellationToken.None); 934await incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged: true, InvocationReasons.Reanalyze, CancellationToken.None); 1019await incrementalAnalyzer.AnalyzeSyntaxAsync(document, InvocationReasons.SyntaxChanged, analyzer.CancellationToken); 1023await incrementalAnalyzer.AnalyzeDocumentAsync(document, bodyOpt: null, InvocationReasons.SemanticChanged, analyzer.CancellationToken); 1038await incrementalAnalyzer.AnalyzeSyntaxAsync(document, InvocationReasons.SyntaxChanged, CancellationToken.None); 1042await incrementalAnalyzer.AnalyzeDocumentAsync(document, bodyOpt: null, InvocationReasons.SemanticChanged, CancellationToken.None); 1182await incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged: true, InvocationReasons.Reanalyze, CancellationToken.None); 1232await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None).ConfigureAwait(false); 1233await analyzer.AnalyzeDocumentAsync(document, bodyOpt: null, reasons: InvocationReasons.Empty, cancellationToken: CancellationToken.None).ConfigureAwait(false); 1237await analyzer.AnalyzeNonSourceDocumentAsync(textDocument, InvocationReasons.Empty, CancellationToken.None).ConfigureAwait(false); 1240await analyzer.AnalyzeProjectAsync(textDocument.Project, semanticsChanged: true, reasons: InvocationReasons.Empty, cancellationToken: CancellationToken.None).ConfigureAwait(false);
SolutionCrawler\WorkCoordinatorTests.cs (14)
1324var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: null, EmptyAsyncToken.Instance); 1345var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: analyzer, EmptyAsyncToken.Instance); 1366var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: analyzer, EmptyAsyncToken.Instance); 1866public Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken) 1872public Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) 1882public Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) 1889public Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken) 1904await AnalyzeSyntaxAsync(sourceDocument, InvocationReasons.ActiveDocumentSwitched, cancellationToken).ConfigureAwait(false); 1905await AnalyzeDocumentAsync(sourceDocument, bodyOpt: null, InvocationReasons.ActiveDocumentSwitched, cancellationToken).ConfigureAwait(false); 1909await AnalyzeNonSourceDocumentAsync(document, InvocationReasons.ActiveDocumentSwitched, cancellationToken).ConfigureAwait(false); 1991public Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) 2003public Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) => Task.CompletedTask; 2004public Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken) => Task.CompletedTask; 2010public Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken) => Task.CompletedTask;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
2175incrementalAnalyzer.AnalyzeProjectAsync(project, semanticsChanged:=True, reasons:=InvocationReasons.Empty, cancellationToken:=CancellationToken.None).Wait()
Microsoft.CodeAnalysis.Features (57)
SolutionCrawler\AbstractDocumentDifferenceService.cs (7)
26return new DocumentDifferenceResult(InvocationReasons.DocumentChanged); 34return new DocumentDifferenceResult(InvocationReasons.DocumentChanged); 61return new DocumentDifferenceResult(InvocationReasons.DocumentChanged); 84return new DocumentDifferenceResult(InvocationReasons.SyntaxChanged, GetChangedMember(syntaxFactsService, oldRoot, newRoot, range)); 87return new DocumentDifferenceResult(InvocationReasons.DocumentChanged, GetBestGuessChangedMember(syntaxFactsService, oldRoot, newRoot, range)); 92return new DocumentDifferenceResult(InvocationReasons.SyntaxChanged); 95return new DocumentDifferenceResult(InvocationReasons.DocumentChanged);
SolutionCrawler\IDocumentDifferenceService.cs (2)
13public InvocationReasons ChangeType { get; } 16public DocumentDifferenceResult(InvocationReasons changeType, SyntaxNode? changedMember = null)
SolutionCrawler\IncrementalAnalyzerBase.cs (4)
32public virtual Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) 35public virtual Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) 38public virtual Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken) 56public virtual Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken)
SolutionCrawler\SolutionCrawlerLogger.cs (1)
156CountLogAggregator<object> logAggregator, string language, DocumentId? documentId, InvocationReasons reasons, bool lowPriority, SyntaxPath? activeMember, bool added)
SolutionCrawler\WorkCoordinator.cs (31)
155EnqueueFullDocumentEvent(solution, activeDocumentId, InvocationReasons.ActiveDocumentSwitched, eventName: nameof(OnActiveDocumentSwitched)); 201EnqueueFullSolutionEvent(args.NewSolution, InvocationReasons.DocumentAdded, eventName); 206EnqueueFullSolutionEvent(args.OldSolution, InvocationReasons.SolutionRemoved, eventName); 216EnqueueFullProjectEvent(args.NewSolution, args.ProjectId, InvocationReasons.DocumentAdded, eventName); 221EnqueueFullProjectEvent(args.OldSolution, args.ProjectId, InvocationReasons.DocumentRemoved, eventName); 232EnqueueFullDocumentEvent(args.NewSolution, args.DocumentId, InvocationReasons.DocumentAdded, eventName); 237EnqueueFullDocumentEvent(args.OldSolution, args.DocumentId, InvocationReasons.DocumentRemoved, eventName); 256EnqueueFullProjectEvent(args.NewSolution, args.ProjectId, InvocationReasons.AdditionalDocumentChanged, eventName); 267() => EnqueueDocumentWorkItemAsync(e.Document.Project, e.Document.Id, e.Document, InvocationReasons.DocumentOpened), _shutdownToken); 273() => EnqueueDocumentWorkItemAsync(e.Document.Project, e.Document.Id, e.Document, InvocationReasons.DocumentClosed), _shutdownToken); 287await EnqueueFullProjectWorkItemAsync(addedProject, InvocationReasons.DocumentAdded).ConfigureAwait(false); 297await EnqueueFullProjectWorkItemAsync(removedProject, InvocationReasons.DocumentRemoved).ConfigureAwait(false); 303private void EnqueueFullSolutionEvent(Solution solution, InvocationReasons invocationReasons, string eventName) 331private void EnqueueFullProjectEvent(Solution solution, ProjectId projectId, InvocationReasons invocationReasons, string eventName) 337private void EnqueueFullDocumentEvent(Solution solution, DocumentId documentId, InvocationReasons invocationReasons, string eventName) 377EnqueueFullDocumentEvent(oldSolution, oldDocumentId, InvocationReasons.DocumentRemoved, "OnWorkspaceChanged"); 386EnqueueFullDocumentEvent(newSolution, newDocumentId, InvocationReasons.DocumentAdded, "OnWorkspaceChanged"); 399private async Task EnqueueDocumentWorkItemAsync(Project project, DocumentId documentId, TextDocument? document, InvocationReasons invocationReasons, SyntaxNode? changedMember = null) 439private async Task EnqueueFullProjectWorkItemAsync(Project project, InvocationReasons invocationReasons) 462var invocationReasons = highPriority ? InvocationReasons.ReanalyzeHighPriority : InvocationReasons.Reanalyze; 469IIncrementalAnalyzer analyzer, Project project, DocumentId documentId, Document? document, InvocationReasons invocationReasons) 485await EnqueueDocumentWorkItemAsync(projectChanges.NewProject, addedDocumentId, document: null, InvocationReasons.DocumentAdded).ConfigureAwait(false); 494await EnqueueDocumentWorkItemAsync(projectChanges.OldProject, removedDocumentId, document: null, InvocationReasons.DocumentRemoved).ConfigureAwait(false); 503var projectConfigurationChange = InvocationReasons.Empty; 507projectConfigurationChange = projectConfigurationChange.With(InvocationReasons.ProjectParseOptionChanged); 526projectConfigurationChange = projectConfigurationChange.With(InvocationReasons.ProjectConfigurationChanged); 543await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, InvocationReasons.DocumentChanged).ConfigureAwait(false); 577list.Add(new WorkItem(document.Id, document.Project.Language, InvocationReasons.DocumentAdded, isLowPriority: false, activeMember: null, EmptyAsyncToken.Instance));
SolutionCrawler\WorkCoordinator.IncrementalAnalyzerProcessor.cs (3)
171var reasons = workItem.InvocationReasons; 197static async Task AnalyzeSyntaxAsync(IIncrementalAnalyzer analyzer, TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken) 269var reasons = workItem.InvocationReasons;
SolutionCrawler\WorkCoordinator.LowPriorityProcessor.cs (1)
142var reasons = workItem.InvocationReasons;
SolutionCrawler\WorkCoordinator.NormalPriorityProcessor.cs (2)
411var reasons = workItem.InvocationReasons; 444static async Task AnalyzeSyntaxAsync(IIncrementalAnalyzer analyzer, TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken)
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (1)
400new WorkItem(documentId, project.Language, InvocationReasons.SemanticChanged,
SolutionCrawler\WorkCoordinator.WorkItem.cs (5)
27public readonly InvocationReasons InvocationReasons; 70InvocationReasons invocationReasons, 93public WorkItem(DocumentId documentId, string language, InvocationReasons invocationReasons, bool isLowPriority, SyntaxPath? activeMember, IAsyncToken asyncToken) 98public WorkItem(DocumentId documentId, string language, InvocationReasons invocationReasons, bool isLowPriority, IIncrementalAnalyzer? analyzer, IAsyncToken asyncToken) 115InvocationReasons invocationReasons, SyntaxPath? currentMember,
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Features\Diagnostics\DefaultDiagnosticAnalyzerService.cs (4)
84public Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) 87public Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken) 103public async Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) 227public Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (4)
24public Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) 27public Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) 30public Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken) 126public async Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Host\RemoteDocumentDifferenceService.cs (2)
70return new DocumentDifferenceResult(InvocationReasons.SyntaxChanged); 74return new DocumentDifferenceResult(InvocationReasons.DocumentChanged);
Microsoft.CodeAnalysis.Workspaces (32)
ExternalAccess\UnitTesting\Api\UnitTestingInvocationReasonsWrapper.cs (6)
12public static readonly UnitTestingInvocationReasonsWrapper SemanticChanged = new(InvocationReasons.SemanticChanged); 13public static readonly UnitTestingInvocationReasonsWrapper Reanalyze = new(InvocationReasons.Reanalyze); 14public static readonly UnitTestingInvocationReasonsWrapper ProjectConfigurationChanged = new(InvocationReasons.ProjectConfigurationChanged); 15public static readonly UnitTestingInvocationReasonsWrapper SyntaxChanged = new(InvocationReasons.SyntaxChanged); 28internal InvocationReasons UnderlyingObject { get; } 30internal UnitTestingInvocationReasonsWrapper(InvocationReasons underlyingObject)
ExternalAccess\UnitTesting\UnitTestingIncrementalAnalyzer.cs (4)
22public Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken) 25public Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken) 28public Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken) 67public Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken)
SolutionCrawler\IIncrementalAnalyzer.cs (4)
26Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken); 27Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken); 28Task AnalyzeProjectAsync(Project project, bool semanticsChanged, InvocationReasons reasons, CancellationToken cancellationToken); 41Task AnalyzeNonSourceDocumentAsync(TextDocument textDocument, InvocationReasons reasons, CancellationToken cancellationToken);
SolutionCrawler\InvocationReasons.cs (4)
15public static readonly InvocationReasons Empty = new(ImmutableHashSet<string>.Empty); 33public InvocationReasons With(InvocationReasons invocationReasons) 36public InvocationReasons With(string reason)
SolutionCrawler\InvocationReasons_Constants.cs (14)
13public static readonly InvocationReasons DocumentAdded = 20public static readonly InvocationReasons DocumentRemoved = 28public static readonly InvocationReasons ProjectParseOptionChanged = 35public static readonly InvocationReasons ProjectConfigurationChanged = 42public static readonly InvocationReasons SolutionRemoved = 48public static readonly InvocationReasons DocumentOpened = 54public static readonly InvocationReasons DocumentClosed = 60public static readonly InvocationReasons DocumentChanged = 66public static readonly InvocationReasons AdditionalDocumentChanged = 72public static readonly InvocationReasons SyntaxChanged = 77public static readonly InvocationReasons SemanticChanged = 82public static readonly InvocationReasons Reanalyze = 85public static readonly InvocationReasons ReanalyzeHighPriority = 88public static readonly InvocationReasons ActiveDocumentSwitched =
Microsoft.VisualStudio.LanguageServices (1)
TaskList\TaskListIncrementalAnalyzer.cs (1)
69public override async Task AnalyzeSyntaxAsync(Document document, InvocationReasons reasons, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.UnitTests (13)
Diagnostics\DefaultDiagnosticUpdateSourceTests.vb (13)
60Await analyzer.AnalyzeSyntaxAsync(workspace.CurrentSolution.Projects.First().Documents.First(), InvocationReasons.Empty, CancellationToken.None) 100Await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None) 101Await analyzer.AnalyzeDocumentAsync(document, Nothing, InvocationReasons.Empty, CancellationToken.None) 138Await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None) 139Await analyzer.AnalyzeDocumentAsync(document, Nothing, InvocationReasons.Empty, CancellationToken.None) 177Await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None) 178Await analyzer.AnalyzeDocumentAsync(document, Nothing, InvocationReasons.Empty, CancellationToken.None) 218Await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None) 219Await analyzer.AnalyzeDocumentAsync(document, Nothing, InvocationReasons.Empty, CancellationToken.None) 254Await analyzer.AnalyzeSyntaxAsync(workspace.CurrentSolution.Projects.First().Documents.First(), InvocationReasons.Empty, CancellationToken.None) 283Await analyzer.AnalyzeSyntaxAsync(workspace.CurrentSolution.Projects.First().Documents.First(), InvocationReasons.Empty, CancellationToken.None) 322Await analyzer.AnalyzeSyntaxAsync(document, InvocationReasons.Empty, CancellationToken.None) 323Await analyzer.AnalyzeDocumentAsync(document, Nothing, InvocationReasons.Empty, CancellationToken.None)
Roslyn.VisualStudio.Next.UnitTests (1)
Services\SolutionServiceTests.cs (1)
875public override Task AnalyzeDocumentAsync(Document document, SyntaxNode bodyOpt, InvocationReasons reasons, CancellationToken cancellationToken)