1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
42State = projectState;
144 references to State
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadService.cs (1)
182=> project.State.NameAndFlavor.flavor;
Microsoft.CodeAnalysis.Features (57)
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
245var filePath = project.State.DocumentStates.GetRequiredState(documentId).FilePath;
Diagnostics\Service\DiagnosticAnalyzerService.HostAnalyzerInfo.cs (2)
108var key = new HostAnalyzerInfoKey(project.Language, project.State.HasSdkCodeStyleAnalyzers, solution.SolutionState.Analyzers.HostAnalyzerReferences); 194if (project.State.HasSdkCodeStyleAnalyzers)
Diagnostics\Service\DiagnosticAnalyzerService.ProjectStates.cs (2)
59var analyzersPerReference = solutionAnalyzers.CreateProjectDiagnosticAnalyzersPerReference(project.State); 70var skippedAnalyzersInfo = solutionAnalyzers.GetSkippedAnalyzersInfo(project.State, _analyzerInfoCache);
Diagnostics\Service\DiagnosticAnalyzerService_CompilationWithAnalyzersPair.cs (5)
135return (project.State.HostAnalyzerOptions, null); 140return (project.State.ProjectAnalyzerOptions, null); 149project.State.HostAnalyzerOptions, 151? project.State.ProjectAnalyzerOptions.AnalyzerConfigOptionsProvider 152: project.State.HostAnalyzerOptions.AnalyzerConfigOptionsProvider);
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (1)
54var skippedAnalyzersInfo = project.Solution.SolutionState.Analyzers.GetSkippedAnalyzersInfo(project.State, _analyzerInfoCache);
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
65if (!project.State.RunAnalyzers || globalOptions.GetBackgroundAnalysisScope(project.Language) == BackgroundAnalysisScope.None)
EditAndContinue\DebuggingSession.cs (2)
513EditSession.Telemetry.LogRudeEditDiagnostics(analysis.RudeEdits, project.State.Attributes.TelemetryId); 626_editSessionTelemetry.LogUpdatedBaseline(solution.GetRequiredProject(projectId).State.ProjectInfo.Attributes.TelemetryId);
EditAndContinue\EditAndContinueService.cs (1)
139from documentState in GetDocumentStates(project.State)
EditAndContinue\EditSession.cs (34)
338if (oldProject.State == newProject.State) 348foreach (var documentId in newProject.State.DocumentStates.GetChangedStateIds(oldProject.State.DocumentStates, ignoreUnchangedContent: true)) 369foreach (var documentId in newProject.State.DocumentStates.GetAddedStateIds(oldProject.State.DocumentStates)) 385foreach (var documentId in newProject.State.DocumentStates.GetRemovedStateIds(oldProject.State.DocumentStates)) 412foreach (var documentId in newProject.State.AdditionalDocumentStates.GetChangedStateIds(oldProject.State.AdditionalDocumentStates, ignoreUnchangedContent: true)) 421foreach (var documentId in newProject.State.AnalyzerConfigDocumentStates.GetChangedStateIds(oldProject.State.AnalyzerConfigDocumentStates, ignoreUnchangedContent: true)) 430if (newProject.State.AdditionalDocumentStates.GetRemovedStateIds(oldProject.State.AdditionalDocumentStates).Any() || 431newProject.State.AdditionalDocumentStates.GetAddedStateIds(oldProject.State.AdditionalDocumentStates).Any() || 432newProject.State.AnalyzerConfigDocumentStates.GetRemovedStateIds(oldProject.State.AnalyzerConfigDocumentStates).Any() || 433newProject.State.AnalyzerConfigDocumentStates.GetAddedStateIds(oldProject.State.AnalyzerConfigDocumentStates).Any()) 553var generatorDiagnostics = await project.Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(project.State, cancellationToken).ConfigureAwait(false); 565return await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, cancellationToken).ConfigureAwait(false); 575if (!newProject.SupportsEditAndContinue() || oldProject.State == newProject.State) 580foreach (var documentId in newProject.State.DocumentStates.GetChangedStateIds(oldProject.State.DocumentStates, ignoreUnchangedContent: true)) 593if (!newProject.State.DocumentStates.HasAnyStateChanges(oldProject.State.DocumentStates) && 594!newProject.State.AdditionalDocumentStates.HasAnyStateChanges(oldProject.State.AdditionalDocumentStates) && 595!newProject.State.AnalyzerConfigDocumentStates.HasAnyStateChanges(oldProject.State.AnalyzerConfigDocumentStates)) 1314Telemetry.LogRudeEditDiagnostics(analysis.RudeEdits, newProject.State.Attributes.TelemetryId); 1507Telemetry.LogProjectAnalysisSummary(projectSummaryToReport, newProject.State.ProjectInfo.Attributes.TelemetryId, projectDiagnostics);
EditAndContinue\RunningProjectOptions.cs (1)
54if (runningProjectsByPathAndTfm.TryGetValue((project.FilePath, project.State.NameAndFlavor.flavor), out var restartAutomatically))
EditAndContinue\Utilities\Extensions.cs (1)
97? $"'{project.FilePath}'" + (project.State.NameAndFlavor.flavor is { } flavor ? $" ('{flavor}')" : "")
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (2)
495if (oldProject.State.RunAnalyzers != newProject.State.RunAnalyzers)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (2)
222var projectState = document.Project.State; 582? definition.SourceSpans[0].Document.Project.State
NavigateTo\RoslynNavigateToItem.cs (2)
144var (firstProjectName, firstProjectFlavor) = firstProject.State.NameAndFlavor; 159var (projectName, projectFlavor) = additionalProject.State.NameAndFlavor;
Microsoft.CodeAnalysis.Workspaces (85)
Diagnostics\Extensions.cs (1)
394var projectChecksum = await project.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (5)
48if (!s_projectToIndex.TryGetValue(project.State, out var tuple) || 54s_projectToIndex.AddOrUpdate(project.State, tuple); 79var regularDocumentStates = project.State.DocumentStates; 80var sourceGeneratorDocumentStates = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, cancellationToken).ConfigureAwait(false); 91solutionKey, project.State, document, cancellationToken).ConfigureAwait(false);
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
148document.Project.State,
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
74project.State,
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (3)
39=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 45=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 51=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
FindSymbols\TopLevelSyntaxTree\NavigateToSearchIndex.cs (3)
47=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 53=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 59=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (3)
47=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 53=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 59=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
Workspace\Host\PersistentStorage\ProjectKey.cs (1)
35=> ToProjectKey(project.Solution.SolutionState, project.State);
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
696projectBeforeMutation.State, path, properties, projectUpdateState, solutionChanges.Solution, out var projectReference);
Workspace\Solution\Document.cs (1)
615var provider = (ProjectState.ProjectHostAnalyzerConfigOptionsProvider)Project.State.HostAnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Solution\Project.cs (41)
56public ProjectId Id => State.Id; 61public string? FilePath => State.FilePath; 66public string? OutputFilePath => State.OutputFilePath; 71public string? OutputRefFilePath => State.OutputRefFilePath; 76public CompilationOutputInfo CompilationOutputInfo => State.CompilationOutputInfo; 89public string? DefaultNamespace => State.DefaultNamespace; 104public HostLanguageServices LanguageServices => State.LanguageServices.HostLanguageServices; 111public LanguageServices Services => State.LanguageServices; 116public string Language => State.Language; 121public string AssemblyName => State.AssemblyName; 126public string Name => State.Name; 131public IReadOnlyList<MetadataReference> MetadataReferences => State.MetadataReferences; 136public IEnumerable<ProjectReference> ProjectReferences => State.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId)); 142public IReadOnlyList<ProjectReference> AllProjectReferences => State.ProjectReferences; 147public IReadOnlyList<AnalyzerReference> AnalyzerReferences => State.AnalyzerReferences; 152public AnalyzerOptions AnalyzerOptions => State.ProjectAnalyzerOptions; 157public AnalyzerOptions HostAnalyzerOptions => State.HostAnalyzerOptions; 162public CompilationOptions? CompilationOptions => State.CompilationOptions; 167public ParseOptions? ParseOptions => State.ParseOptions; 172public bool IsSubmission => State.IsSubmission; 177public bool HasDocuments => !State.DocumentStates.IsEmpty; 182public IReadOnlyList<DocumentId> DocumentIds => State.DocumentStates.Ids; 187public IReadOnlyList<DocumentId> AdditionalDocumentIds => State.AdditionalDocumentStates.Ids; 192internal IReadOnlyList<DocumentId> AnalyzerConfigDocumentIds => State.AnalyzerConfigDocumentStates.Ids; 214=> State.DocumentStates.Contains(documentId); 220=> State.AdditionalDocumentStates.Contains(documentId); 226=> State.AnalyzerConfigDocumentStates.Contains(documentId); 318var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(this.State, cancellationToken).ConfigureAwait(false); 350var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(State, cancellationToken).ConfigureAwait(false); 394return Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(this.State, cancellationToken); 399return Solution.CompilationState.GetSourceGeneratorRunResultAsync(this.State, cancellationToken); 498(documentId, project) => project.State.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null; 501(documentId, project) => project.State.AdditionalDocumentStates.TryGetState(documentId, out var state) ? new AdditionalDocument(project, state) : null; 504(documentId, project) => project.State.AnalyzerConfigDocumentStates.TryGetState(documentId, out var state) ? new AnalyzerConfigDocument(project, state) : null; 526=> Solution.CompilationState.GetCompilationAsync(State, cancellationToken); 533=> Solution.CompilationState.HasSuccessfullyLoadedAsync(State, cancellationToken); 551public VersionStamp Version => State.Version; 557=> State.GetLatestDocumentVersionAsync(cancellationToken); 577=> State.GetSemanticVersionAsync(cancellationToken); 826=> State.GetAnalyzerConfigOptions(); 839var documentId = await State.GetDocumentIdAsync(contentHash, cancellationToken).ConfigureAwait(false);
Workspace\Solution\ProjectChanges.cs (20)
47=> NewProject.State.DocumentStates.GetAddedStateIds(OldProject.State.DocumentStates); 53=> NewProject.State.AdditionalDocumentStates.GetAddedStateIds(OldProject.State.AdditionalDocumentStates); 59=> NewProject.State.AnalyzerConfigDocumentStates.GetAddedStateIds(OldProject.State.AnalyzerConfigDocumentStates); 77=> NewProject.State.DocumentStates.GetChangedStateIds(OldProject.State.DocumentStates, onlyGetDocumentsWithTextChanges, ignoreUnchangeableDocuments); 84=> NewProject.State.AdditionalDocumentStates.GetChangedStateIds(OldProject.State.AdditionalDocumentStates); 91=> NewProject.State.AnalyzerConfigDocumentStates.GetChangedStateIds(OldProject.State.AnalyzerConfigDocumentStates); 97=> NewProject.State.DocumentStates.GetRemovedStateIds(OldProject.State.DocumentStates); 103=> NewProject.State.AdditionalDocumentStates.GetRemovedStateIds(OldProject.State.AdditionalDocumentStates); 109=> NewProject.State.AnalyzerConfigDocumentStates.GetRemovedStateIds(OldProject.State.AnalyzerConfigDocumentStates); 119newProject.State.ProjectReferences == oldProject.State.ProjectReferences)
Workspace\Workspace.cs (4)
1753var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ?? 1754projectChanges.NewProject.State.DocumentStates.GetState(documentId)!; 2025project.State.Attributes.With(version: VersionStamp.Create()), 2034hostObjectType: project.State.HostObjectType);
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\ProjectMap.cs (1)
78AddProjectInfo(project.State.ProjectInfo);