1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
40State = projectState;
77 references to State
Microsoft.CodeAnalysis.Workspaces (77)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (5)
35if (!s_projectToIndex.TryGetValue(project.State, out var lazyIndex)) 38project.State, p => AsyncLazy.Create( 58var regularDocumentStates = project.State.DocumentStates; 59var sourceGeneratorDocumentStates = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, cancellationToken).ConfigureAwait(false); 70solutionKey, project.State, document, cancellationToken).ConfigureAwait(false);
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
148document.Project.State,
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
73project.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\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\Solution\Document.cs (1)
560var provider = (ProjectState.ProjectAnalyzerConfigOptionsProvider)Project.State.AnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Solution\Project.cs (40)
54public ProjectId Id => State.Id; 59public string? FilePath => State.FilePath; 64public string? OutputFilePath => State.OutputFilePath; 69public string? OutputRefFilePath => State.OutputRefFilePath; 74public CompilationOutputInfo CompilationOutputInfo => State.CompilationOutputInfo; 87public string? DefaultNamespace => State.DefaultNamespace; 102public HostLanguageServices LanguageServices => State.LanguageServices.HostLanguageServices; 109public LanguageServices Services => State.LanguageServices; 114public string Language => State.Language; 119public string AssemblyName => State.AssemblyName; 124public string Name => State.Name; 129public IReadOnlyList<MetadataReference> MetadataReferences => State.MetadataReferences; 134public IEnumerable<ProjectReference> ProjectReferences => State.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId)); 140public IReadOnlyList<ProjectReference> AllProjectReferences => State.ProjectReferences; 145public IReadOnlyList<AnalyzerReference> AnalyzerReferences => State.AnalyzerReferences; 150public AnalyzerOptions AnalyzerOptions => State.AnalyzerOptions; 155public CompilationOptions? CompilationOptions => State.CompilationOptions; 160public ParseOptions? ParseOptions => State.ParseOptions; 165public bool IsSubmission => State.IsSubmission; 170public bool HasDocuments => !State.DocumentStates.IsEmpty; 175public IReadOnlyList<DocumentId> DocumentIds => State.DocumentStates.Ids; 180public IReadOnlyList<DocumentId> AdditionalDocumentIds => State.AdditionalDocumentStates.Ids; 185internal IReadOnlyList<DocumentId> AnalyzerConfigDocumentIds => State.AnalyzerConfigDocumentStates.Ids; 207=> State.DocumentStates.Contains(documentId); 213=> State.AdditionalDocumentStates.Contains(documentId); 219=> State.AnalyzerConfigDocumentStates.Contains(documentId); 282var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(this.State, cancellationToken).ConfigureAwait(false); 314var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(State, cancellationToken).ConfigureAwait(false); 359return Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(this.State, cancellationToken); 364return Solution.CompilationState.GetSourceGeneratorRunResultAsync(this.State, cancellationToken); 461(documentId, project) => project.State.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null; 464(documentId, project) => project.State.AdditionalDocumentStates.TryGetState(documentId, out var state) ? new AdditionalDocument(project, state) : null; 467(documentId, project) => project.State.AnalyzerConfigDocumentStates.TryGetState(documentId, out var state) ? new AnalyzerConfigDocument(project, state) : null; 489=> Solution.CompilationState.GetCompilationAsync(State, cancellationToken); 496=> Solution.CompilationState.HasSuccessfullyLoadedAsync(State, cancellationToken); 514public VersionStamp Version => State.Version; 520=> State.GetLatestDocumentVersionAsync(cancellationToken); 540=> State.GetSemanticVersionAsync(cancellationToken); 808=> State.GetAnalyzerConfigOptions(); 824var documentId = await State.GetDocumentIdAsync(contentHash, cancellationToken).ConfigureAwait(false);
Workspace\Solution\ProjectChanges.cs (18)
100=> NewProject.State.DocumentStates.GetAddedStateIds(OldProject.State.DocumentStates); 106=> NewProject.State.AdditionalDocumentStates.GetAddedStateIds(OldProject.State.AdditionalDocumentStates); 112=> NewProject.State.AnalyzerConfigDocumentStates.GetAddedStateIds(OldProject.State.AnalyzerConfigDocumentStates); 130=> NewProject.State.DocumentStates.GetChangedStateIds(OldProject.State.DocumentStates, onlyGetDocumentsWithTextChanges, ignoreUnchangeableDocuments); 137=> NewProject.State.AdditionalDocumentStates.GetChangedStateIds(OldProject.State.AdditionalDocumentStates); 144=> NewProject.State.AnalyzerConfigDocumentStates.GetChangedStateIds(OldProject.State.AnalyzerConfigDocumentStates); 150=> NewProject.State.DocumentStates.GetRemovedStateIds(OldProject.State.DocumentStates); 156=> NewProject.State.AdditionalDocumentStates.GetRemovedStateIds(OldProject.State.AdditionalDocumentStates); 162=> NewProject.State.AnalyzerConfigDocumentStates.GetRemovedStateIds(OldProject.State.AnalyzerConfigDocumentStates);
Workspace\Workspace.cs (4)
1715var document = projectChanges.OldProject.State.DocumentStates.GetState(documentId) ?? 1716projectChanges.NewProject.State.DocumentStates.GetState(documentId)!; 1996project.State.Attributes.With(version: VersionStamp.Create()), 2005hostObjectType: project.State.HostObjectType);