1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
42
State
= projectState;
79 references to State
Microsoft.CodeAnalysis.Workspaces (79)
Diagnostics\Extensions.cs (1)
492
var projectChecksum = await project.
State
.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (5)
48
if (!s_projectToIndex.TryGetValue(project.
State
, out var tuple) ||
54
s_projectToIndex.AddOrUpdate(project.
State
, tuple);
79
var regularDocumentStates = project.
State
.DocumentStates;
80
var sourceGeneratorDocumentStates = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.
State
, cancellationToken).ConfigureAwait(false);
91
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)
615
var provider = (ProjectState.ProjectHostAnalyzerConfigOptionsProvider)Project.
State
.HostAnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Solution\Project.cs (41)
56
public ProjectId Id =>
State
.Id;
61
public string? FilePath =>
State
.FilePath;
66
public string? OutputFilePath =>
State
.OutputFilePath;
71
public string? OutputRefFilePath =>
State
.OutputRefFilePath;
76
public CompilationOutputInfo CompilationOutputInfo =>
State
.CompilationOutputInfo;
89
public string? DefaultNamespace =>
State
.DefaultNamespace;
104
public HostLanguageServices LanguageServices =>
State
.LanguageServices.HostLanguageServices;
111
public LanguageServices Services =>
State
.LanguageServices;
116
public string Language =>
State
.Language;
121
public string AssemblyName =>
State
.AssemblyName;
126
public string Name =>
State
.Name;
131
public IReadOnlyList<MetadataReference> MetadataReferences =>
State
.MetadataReferences;
136
public IEnumerable<ProjectReference> ProjectReferences =>
State
.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId));
142
public IReadOnlyList<ProjectReference> AllProjectReferences =>
State
.ProjectReferences;
147
public IReadOnlyList<AnalyzerReference> AnalyzerReferences =>
State
.AnalyzerReferences;
152
public AnalyzerOptions AnalyzerOptions =>
State
.ProjectAnalyzerOptions;
157
public AnalyzerOptions HostAnalyzerOptions =>
State
.HostAnalyzerOptions;
162
public CompilationOptions? CompilationOptions =>
State
.CompilationOptions;
167
public ParseOptions? ParseOptions =>
State
.ParseOptions;
172
public bool IsSubmission =>
State
.IsSubmission;
177
public bool HasDocuments => !
State
.DocumentStates.IsEmpty;
182
public IReadOnlyList<DocumentId> DocumentIds =>
State
.DocumentStates.Ids;
187
public IReadOnlyList<DocumentId> AdditionalDocumentIds =>
State
.AdditionalDocumentStates.Ids;
192
internal IReadOnlyList<DocumentId> AnalyzerConfigDocumentIds =>
State
.AnalyzerConfigDocumentStates.Ids;
214
=>
State
.DocumentStates.Contains(documentId);
220
=>
State
.AdditionalDocumentStates.Contains(documentId);
226
=>
State
.AnalyzerConfigDocumentStates.Contains(documentId);
318
var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(this.
State
, cancellationToken).ConfigureAwait(false);
350
var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(
State
, cancellationToken).ConfigureAwait(false);
394
return Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(this.
State
, cancellationToken);
399
return Solution.CompilationState.GetSourceGeneratorRunResultAsync(this.
State
, cancellationToken);
496
(documentId, project) => project.
State
.DocumentStates.TryGetState(documentId, out var state) ? new Document(project, state) : null;
499
(documentId, project) => project.
State
.AdditionalDocumentStates.TryGetState(documentId, out var state) ? new AdditionalDocument(project, state) : null;
502
(documentId, project) => project.
State
.AnalyzerConfigDocumentStates.TryGetState(documentId, out var state) ? new AnalyzerConfigDocument(project, state) : null;
524
=> Solution.CompilationState.GetCompilationAsync(
State
, cancellationToken);
531
=> Solution.CompilationState.HasSuccessfullyLoadedAsync(
State
, cancellationToken);
549
public VersionStamp Version =>
State
.Version;
555
=>
State
.GetLatestDocumentVersionAsync(cancellationToken);
575
=>
State
.GetSemanticVersionAsync(cancellationToken);
824
=>
State
.GetAnalyzerConfigOptions();
837
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)
1784
var document = projectChanges.OldProject.
State
.DocumentStates.GetState(documentId) ??
1785
projectChanges.NewProject.
State
.DocumentStates.GetState(documentId)!;
2056
project.
State
.Attributes.With(version: VersionStamp.Create()),
2065
hostObjectType: project.
State
.HostObjectType);