1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
40
State
= projectState;
78 references to State
Microsoft.CodeAnalysis.Workspaces (78)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (5)
35
if (!s_projectToIndex.TryGetValue(project.
State
, out var lazyIndex))
38
project.
State
, p => AsyncLazy.Create(
58
var regularDocumentStates = project.
State
.DocumentStates;
59
var sourceGeneratorDocumentStates = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.
State
, cancellationToken).ConfigureAwait(false);
70
solutionKey, project.
State
, document, cancellationToken).ConfigureAwait(false);
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
148
document.Project.
State
,
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
73
project.
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)
596
var provider = (ProjectState.ProjectHostAnalyzerConfigOptionsProvider)Project.
State
.HostAnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Solution\Project.cs (41)
54
public ProjectId Id =>
State
.Id;
59
public string? FilePath =>
State
.FilePath;
64
public string? OutputFilePath =>
State
.OutputFilePath;
69
public string? OutputRefFilePath =>
State
.OutputRefFilePath;
74
public CompilationOutputInfo CompilationOutputInfo =>
State
.CompilationOutputInfo;
87
public string? DefaultNamespace =>
State
.DefaultNamespace;
102
public HostLanguageServices LanguageServices =>
State
.LanguageServices.HostLanguageServices;
109
public LanguageServices Services =>
State
.LanguageServices;
114
public string Language =>
State
.Language;
119
public string AssemblyName =>
State
.AssemblyName;
124
public string Name =>
State
.Name;
129
public IReadOnlyList<MetadataReference> MetadataReferences =>
State
.MetadataReferences;
134
public IEnumerable<ProjectReference> ProjectReferences =>
State
.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId));
140
public IReadOnlyList<ProjectReference> AllProjectReferences =>
State
.ProjectReferences;
145
public IReadOnlyList<AnalyzerReference> AnalyzerReferences =>
State
.AnalyzerReferences;
150
public AnalyzerOptions AnalyzerOptions =>
State
.ProjectAnalyzerOptions;
155
public AnalyzerOptions HostAnalyzerOptions =>
State
.HostAnalyzerOptions;
160
public CompilationOptions? CompilationOptions =>
State
.CompilationOptions;
165
public ParseOptions? ParseOptions =>
State
.ParseOptions;
170
public bool IsSubmission =>
State
.IsSubmission;
175
public bool HasDocuments => !
State
.DocumentStates.IsEmpty;
180
public IReadOnlyList<DocumentId> DocumentIds =>
State
.DocumentStates.Ids;
185
public IReadOnlyList<DocumentId> AdditionalDocumentIds =>
State
.AdditionalDocumentStates.Ids;
190
internal IReadOnlyList<DocumentId> AnalyzerConfigDocumentIds =>
State
.AnalyzerConfigDocumentStates.Ids;
212
=>
State
.DocumentStates.Contains(documentId);
218
=>
State
.AdditionalDocumentStates.Contains(documentId);
224
=>
State
.AnalyzerConfigDocumentStates.Contains(documentId);
287
var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(this.
State
, cancellationToken).ConfigureAwait(false);
319
var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(
State
, cancellationToken).ConfigureAwait(false);
364
return Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(this.
State
, cancellationToken);
369
return Solution.CompilationState.GetSourceGeneratorRunResultAsync(this.
State
, cancellationToken);
466
(documentId, project) => project.
State
.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null;
469
(documentId, project) => project.
State
.AdditionalDocumentStates.TryGetState(documentId, out var state) ? new AdditionalDocument(project, state) : null;
472
(documentId, project) => project.
State
.AnalyzerConfigDocumentStates.TryGetState(documentId, out var state) ? new AnalyzerConfigDocument(project, state) : null;
494
=> Solution.CompilationState.GetCompilationAsync(
State
, cancellationToken);
501
=> Solution.CompilationState.HasSuccessfullyLoadedAsync(
State
, cancellationToken);
519
public VersionStamp Version =>
State
.Version;
525
=>
State
.GetLatestDocumentVersionAsync(cancellationToken);
545
=>
State
.GetSemanticVersionAsync(cancellationToken);
822
=>
State
.GetAnalyzerConfigOptions();
838
var 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)
1759
var document = projectChanges.OldProject.
State
.DocumentStates.GetState(documentId) ??
1760
projectChanges.NewProject.
State
.DocumentStates.GetState(documentId)!;
2031
project.
State
.Attributes.With(version: VersionStamp.Create()),
2040
hostObjectType: project.
State
.HostObjectType);