1 write to State
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
42
State
= 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)
245
var filePath = project.
State
.DocumentStates.GetRequiredState(documentId).FilePath;
Diagnostics\Service\DiagnosticAnalyzerService.HostAnalyzerInfo.cs (2)
108
var key = new HostAnalyzerInfoKey(project.Language, project.
State
.HasSdkCodeStyleAnalyzers, solution.SolutionState.Analyzers.HostAnalyzerReferences);
194
if (project.
State
.HasSdkCodeStyleAnalyzers)
Diagnostics\Service\DiagnosticAnalyzerService.ProjectStates.cs (2)
59
var analyzersPerReference = solutionAnalyzers.CreateProjectDiagnosticAnalyzersPerReference(project.
State
);
70
var skippedAnalyzersInfo = solutionAnalyzers.GetSkippedAnalyzersInfo(project.
State
, _analyzerInfoCache);
Diagnostics\Service\DiagnosticAnalyzerService_CompilationWithAnalyzersPair.cs (5)
135
return (project.
State
.HostAnalyzerOptions, null);
140
return (project.
State
.ProjectAnalyzerOptions, null);
149
project.
State
.HostAnalyzerOptions,
151
? project.
State
.ProjectAnalyzerOptions.AnalyzerConfigOptionsProvider
152
: project.
State
.HostAnalyzerOptions.AnalyzerConfigOptionsProvider);
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (1)
54
var skippedAnalyzersInfo = project.Solution.SolutionState.Analyzers.GetSkippedAnalyzersInfo(project.
State
, _analyzerInfoCache);
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
65
if (!project.
State
.RunAnalyzers || globalOptions.GetBackgroundAnalysisScope(project.Language) == BackgroundAnalysisScope.None)
EditAndContinue\DebuggingSession.cs (2)
513
EditSession.Telemetry.LogRudeEditDiagnostics(analysis.RudeEdits, project.
State
.Attributes.TelemetryId);
626
_editSessionTelemetry.LogUpdatedBaseline(solution.GetRequiredProject(projectId).
State
.ProjectInfo.Attributes.TelemetryId);
EditAndContinue\EditAndContinueService.cs (1)
139
from documentState in GetDocumentStates(project.
State
)
EditAndContinue\EditSession.cs (34)
338
if (oldProject.
State
== newProject.
State
)
348
foreach (var documentId in newProject.
State
.DocumentStates.GetChangedStateIds(oldProject.
State
.DocumentStates, ignoreUnchangedContent: true))
369
foreach (var documentId in newProject.
State
.DocumentStates.GetAddedStateIds(oldProject.
State
.DocumentStates))
385
foreach (var documentId in newProject.
State
.DocumentStates.GetRemovedStateIds(oldProject.
State
.DocumentStates))
412
foreach (var documentId in newProject.
State
.AdditionalDocumentStates.GetChangedStateIds(oldProject.
State
.AdditionalDocumentStates, ignoreUnchangedContent: true))
421
foreach (var documentId in newProject.
State
.AnalyzerConfigDocumentStates.GetChangedStateIds(oldProject.
State
.AnalyzerConfigDocumentStates, ignoreUnchangedContent: true))
430
if (newProject.
State
.AdditionalDocumentStates.GetRemovedStateIds(oldProject.
State
.AdditionalDocumentStates).Any() ||
431
newProject.
State
.AdditionalDocumentStates.GetAddedStateIds(oldProject.
State
.AdditionalDocumentStates).Any() ||
432
newProject.
State
.AnalyzerConfigDocumentStates.GetRemovedStateIds(oldProject.
State
.AnalyzerConfigDocumentStates).Any() ||
433
newProject.
State
.AnalyzerConfigDocumentStates.GetAddedStateIds(oldProject.
State
.AnalyzerConfigDocumentStates).Any())
553
var generatorDiagnostics = await project.Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(project.
State
, cancellationToken).ConfigureAwait(false);
565
return await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.
State
, cancellationToken).ConfigureAwait(false);
575
if (!newProject.SupportsEditAndContinue() || oldProject.
State
== newProject.
State
)
580
foreach (var documentId in newProject.
State
.DocumentStates.GetChangedStateIds(oldProject.
State
.DocumentStates, ignoreUnchangedContent: true))
593
if (!newProject.
State
.DocumentStates.HasAnyStateChanges(oldProject.
State
.DocumentStates) &&
594
!newProject.
State
.AdditionalDocumentStates.HasAnyStateChanges(oldProject.
State
.AdditionalDocumentStates) &&
595
!newProject.
State
.AnalyzerConfigDocumentStates.HasAnyStateChanges(oldProject.
State
.AnalyzerConfigDocumentStates))
1314
Telemetry.LogRudeEditDiagnostics(analysis.RudeEdits, newProject.
State
.Attributes.TelemetryId);
1507
Telemetry.LogProjectAnalysisSummary(projectSummaryToReport, newProject.
State
.ProjectInfo.Attributes.TelemetryId, projectDiagnostics);
EditAndContinue\RunningProjectOptions.cs (1)
54
if (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)
495
if (oldProject.
State
.RunAnalyzers != newProject.
State
.RunAnalyzers)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (2)
222
var projectState = document.Project.
State
;
582
? definition.SourceSpans[0].Document.Project.
State
NavigateTo\RoslynNavigateToItem.cs (2)
144
var (firstProjectName, firstProjectFlavor) = firstProject.
State
.NameAndFlavor;
159
var (projectName, projectFlavor) = additionalProject.
State
.NameAndFlavor;
Microsoft.CodeAnalysis.Workspaces (85)
Diagnostics\Extensions.cs (1)
394
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)
74
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\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)
696
projectBeforeMutation.
State
, path, properties, projectUpdateState, solutionChanges.Solution, out var projectReference);
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);
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);
551
public VersionStamp Version =>
State
.Version;
557
=>
State
.GetLatestDocumentVersionAsync(cancellationToken);
577
=>
State
.GetSemanticVersionAsync(cancellationToken);
826
=>
State
.GetAnalyzerConfigOptions();
839
var 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);
119
newProject.
State
.ProjectReferences == oldProject.
State
.ProjectReferences)
Workspace\Workspace.cs (4)
1753
var document = projectChanges.OldProject.
State
.DocumentStates.GetState(documentId) ??
1754
projectChanges.NewProject.
State
.DocumentStates.GetState(documentId)!;
2025
project.
State
.Attributes.With(version: VersionStamp.Create()),
2034
hostObjectType: project.
State
.HostObjectType);
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
MSBuild\ProjectMap.cs (1)
78
AddProjectInfo(project.
State
.ProjectInfo);