1 instantiation of ProjectState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SolutionState.cs (1)
366
var newProject = new
ProjectState
(languageServices, projectInfo, fallbackAnalyzerOptions);
219 references to ProjectState
Microsoft.CodeAnalysis.Features (1)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
215
var
projectState = document.Project.State;
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (1)
33
/// cref="
ProjectState
.GetParseOptionsChecksum"/> and <see cref="DocumentStateChecksums.Text"/>
Microsoft.CodeAnalysis.Workspaces (216)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
24
private static readonly ConditionalWeakTable<
ProjectState
, AsyncLazy<ProjectIndex>> s_projectToIndex = new();
FindSymbols\Shared\AbstractSyntaxIndex.cs (6)
19
protected delegate TIndex IndexCreator(
ProjectState
project, SyntaxNode root, Checksum checksum, CancellationToken cancellationToken);
30
SolutionKey solutionKey,
ProjectState
project, DocumentState document, IndexReader read, IndexCreator create, CancellationToken cancellationToken)
37
protected static ValueTask<TIndex?> GetIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, IndexReader read, IndexCreator create, CancellationToken cancellationToken)
43
ProjectState
project,
81
ProjectState
project,
115
ProjectState
project,
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (4)
39
ProjectState
project,
93
ProjectState
project,
135
ProjectState
project,
156
ProjectState
project,
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (2)
68
private static readonly ConditionalWeakTable<
ProjectState
, AsyncLazy<Checksum>> s_projectToSourceChecksum = new();
81
private static async Task<Checksum> ComputeSourceSymbolsChecksumAsync(
ProjectState
projectState, CancellationToken cancellationToken)
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (3)
41
public static ValueTask<SyntaxTreeIndex> GetRequiredIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, CancellationToken cancellationToken)
47
public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, CancellationToken cancellationToken)
53
public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, bool loadOnly, CancellationToken cancellationToken)
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (3)
38
private static readonly ConditionalWeakTable<
ProjectState
, StringTable> s_projectStringTable = new();
41
ProjectState
project, SyntaxNode root, Checksum checksum, CancellationToken _)
332
public static StringTable GetStringTable(
ProjectState
project)
FindSymbols\TopLevelSyntaxTree\IDeclaredSymbolInfoFactoryService.cs (1)
16
void AddDeclaredSymbolInfos(
ProjectState
project, SyntaxNode root, ArrayBuilder<DeclaredSymbolInfo> declaredSymbolInfos, Dictionary<string, ArrayBuilder<int>> extensionMethodInfo, CancellationToken cancellationToken);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (3)
49
public static ValueTask<TopLevelSyntaxTreeIndex> GetRequiredIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, CancellationToken cancellationToken)
55
public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, CancellationToken cancellationToken)
61
public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey,
ProjectState
project, DocumentState document, bool loadOnly, CancellationToken cancellationToken)
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex_Create.cs (1)
16
ProjectState
project, SyntaxNode root, Checksum checksum, CancellationToken cancellationToken)
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (1)
153
ProjectState
project,
Workspace\Host\PersistentStorage\ProjectKey.cs (2)
37
public static ProjectKey ToProjectKey(SolutionState solutionState,
ProjectState
projectState)
40
public static ProjectKey ToProjectKey(SolutionKey solutionKey,
ProjectState
projectState)
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
302
var
projectState = solution.SolutionState.GetRequiredProjectState(projectId);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
600
var
projectWithMetadataReference = solution.GetProjectState(projectIdWithMetadataReference);
601
var
referencedProject = solution.GetProjectState(referencedProjectId);
Workspace\Solution\Document.cs (1)
577
var provider = (
ProjectState
.ProjectHostAnalyzerConfigOptionsProvider)Project.State.HostAnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Solution\Project.cs (2)
34
internal Project(Solution solution,
ProjectState
projectState)
43
internal
ProjectState
State { get; }
Workspace\Solution\ProjectState.AnalyzerConfigOptionsCache.cs (1)
19
/// This cache is stored on <see cref="
ProjectState
"/> and needs to be invalidated whenever <see cref="SolutionState.FallbackAnalyzerOptions"/> for the language of the project change,
Workspace\Solution\ProjectState.cs (38)
362
internal sealed class ProjectAnalyzerConfigOptionsProvider(
ProjectState
projectState) : AnalyzerConfigOptionsProvider
432
internal sealed class ProjectHostAnalyzerConfigOptionsProvider(
ProjectState
projectState) : AnalyzerConfigOptionsProvider
681
private
ProjectState
With(
707
private
ProjectState
WithNewerAttributes(ProjectInfo.ProjectAttributes attributes)
715
public
ProjectState
WithName(string name)
718
public
ProjectState
WithFilePath(string? filePath)
721
public
ProjectState
WithAssemblyName(string assemblyName)
724
public
ProjectState
WithOutputFilePath(string? outputFilePath)
727
public
ProjectState
WithOutputRefFilePath(string? outputRefFilePath)
730
public
ProjectState
WithCompilationOutputInfo(in CompilationOutputInfo info)
733
public
ProjectState
WithDefaultNamespace(string? defaultNamespace)
736
public
ProjectState
WithHasAllInformation(bool hasAllInformation)
739
public
ProjectState
WithRunAnalyzers(bool runAnalyzers)
742
internal
ProjectState
WithHasSdkCodeStyleAnalyzers(bool hasSdkCodeStyleAnalyzers)
745
public
ProjectState
WithChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm)
760
public
ProjectState
WithCompilationOptions(CompilationOptions? options)
778
public
ProjectState
WithParseOptions(ParseOptions? options)
800
public
ProjectState
WithFallbackAnalyzerOptions(StructuredAnalyzerConfigOptions options)
810
public static bool IsSameLanguage(
ProjectState
project1,
ProjectState
project2)
829
public
ProjectState
WithProjectReferences(IReadOnlyList<ProjectReference> projectReferences)
839
public
ProjectState
WithMetadataReferences(IReadOnlyList<MetadataReference> metadataReferences)
849
public
ProjectState
WithAnalyzerReferences(IReadOnlyList<AnalyzerReference> analyzerReferences)
859
public
ProjectState
AddDocuments(ImmutableArray<DocumentState> documents)
871
public
ProjectState
AddAdditionalDocuments(ImmutableArray<AdditionalDocumentState> documents)
883
public
ProjectState
AddAnalyzerConfigDocuments(ImmutableArray<AnalyzerConfigDocumentState> documents)
895
private
ProjectState
CreateNewStateForChangedAnalyzerConfig(TextDocumentStates<AnalyzerConfigDocumentState> newAnalyzerConfigDocumentStates, StructuredAnalyzerConfigOptions fallbackOptions)
914
public
ProjectState
RemoveDocuments(ImmutableArray<DocumentId> documentIds)
927
public
ProjectState
RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
937
public
ProjectState
RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
947
public
ProjectState
RemoveAllNormalDocuments()
960
public
ProjectState
UpdateDocument(DocumentState newDocument)
963
public
ProjectState
UpdateDocuments(ImmutableArray<DocumentState> oldDocuments, ImmutableArray<DocumentState> newDocuments)
986
public
ProjectState
UpdateAdditionalDocument(AdditionalDocumentState newDocument)
989
public
ProjectState
UpdateAdditionalDocuments(ImmutableArray<AdditionalDocumentState> oldDocuments, ImmutableArray<AdditionalDocumentState> newDocuments)
1011
public
ProjectState
UpdateAnalyzerConfigDocument(AnalyzerConfigDocumentState newDocument)
1014
public
ProjectState
UpdateAnalyzerConfigDocuments(ImmutableArray<AnalyzerConfigDocumentState> oldDocuments, ImmutableArray<AnalyzerConfigDocumentState> newDocuments)
1021
public
ProjectState
UpdateDocumentsOrder(ImmutableList<DocumentId> documentIds)
Workspace\Solution\Solution.cs (15)
86
internal
ProjectState
? GetProjectState(ProjectId projectId) => this.SolutionState.GetProjectState(projectId);
156
var
state = solution.SolutionState.GetProjectState(projectId);
649
var
oldProject = GetRequiredProjectState(projectId);
741
var
oldProject = GetRequiredProjectState(projectId);
828
var
oldProject = GetRequiredProjectState(projectId);
922
private static SourceCodeKind GetSourceCodeKind(
ProjectState
project)
937
var
project = GetRequiredProjectState(documentId.ProjectId);
958
var
project = GetRequiredProjectState(documentId.ProjectId);
977
var
project = GetRequiredProjectState(documentId.ProjectId);
984
private Solution AddDocumentImpl(
ProjectState
project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
1009
var
project = GetRequiredProjectState(documentId.ProjectId);
1102
var
project = GetRequiredProjectState(documentId.ProjectId);
1115
internal
ProjectState
GetRequiredProjectState(ProjectId projectId)
1846
var
projectState = this.SolutionState.GetRequiredProjectState(projectId);
1854
var
referencedProjectState = this.SolutionState.GetProjectState(projectReference.ProjectId);
Workspace\Solution\SolutionChanges.cs (2)
40
var
newState = _newSolution.GetProjectState(id);
41
var
oldState = old.GetProjectState(id);
Workspace\Solution\SolutionCompilationState.cs (26)
36
/// about the solution structure. Specifically, the set of green <see cref="
ProjectState
"/>s, with all their
180
var
newProjectState = stateChange.NewProjectState;
565
var
oldProject = SolutionState.GetRequiredProjectState(projectId);
601
var
oldProjectState = SolutionState.GetRequiredProjectState(projectId);
807
var
oldProjectState = SolutionState.GetRequiredProjectState(projectId);
832
Func<
ProjectState
, ImmutableArray<TDocumentState>, TranslationAction> getTranslationAction)
866
private static TranslationAction GetUpdateDocumentsTranslationAction<TDocumentState>(
ProjectState
oldProjectState, ImmutableArray<TDocumentState> newDocumentStates)
877
TranslationAction GetUpdateOrdinaryDocumentsTranslationAction(
ProjectState
oldProjectState, ImmutableArray<DocumentState> newDocumentStates)
884
TranslationAction GetUpdateAdditionalDocumentsTranslationAction(
ProjectState
oldProjectState, ImmutableArray<AdditionalDocumentState> newDocumentStates)
891
TranslationAction GetUpdateAnalyzerConfigDocumentsTranslationAction(
ProjectState
oldProjectState, ImmutableArray<AnalyzerConfigDocumentState> newDocumentStates)
1091
var
projectState = solution.GetProjectState(projectId);
1138
/// Returns the compilation for the specified <see cref="
ProjectState
"/>. Can return <see langword="null"/> when the project
1144
public Task<Compilation?> GetCompilationAsync(
ProjectState
project, CancellationToken cancellationToken)
1154
public Task<bool> HasSuccessfullyLoadedAsync(
ProjectState
project, CancellationToken cancellationToken)
1166
public ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(
ProjectState
project, CancellationToken cancellationToken)
1169
/// <inheritdoc cref="GetSourceGeneratedDocumentStatesAsync(
ProjectState
, CancellationToken)"/>
1171
ProjectState
project, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken)
1179
ProjectState
project, CancellationToken cancellationToken)
1187
ProjectState
project, CancellationToken cancellationToken)
1215
ICompilationTracker tracker,
ProjectState
fromProject, ProjectReference projectReference, bool includeCrossLanguage, CancellationToken cancellationToken)
1249
ProjectReference projectReference,
ProjectState
fromProject, bool includeCrossLanguage, CancellationToken cancellationToken)
1607
var
oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId);
1652
var
projectState = SolutionState.GetRequiredProjectState(projectId);
1685
var
oldProjectState = SolutionState.GetRequiredProjectState(projectId);
1709
private static TranslationAction GetRemoveDocumentsTranslationAction<TDocumentState>(
ProjectState
oldProject, ImmutableArray<DocumentId> documentIds, ImmutableArray<TDocumentState> states)
1718
private static TranslationAction GetAddDocumentsTranslationAction<TDocumentState>(
ProjectState
oldProject, ImmutableArray<TDocumentState> states)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (2)
16
ProjectState
ProjectState { get; }
38
ICompilationTracker Fork(
ProjectState
newProject, TranslationAction? translate);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (13)
32
private static readonly Func<
ProjectState
, string> s_logBuildCompilationAsync =
37
public
ProjectState
ProjectState { get; }
59
ProjectState
project,
79
public RegularCompilationTracker(
ProjectState
project)
125
ProjectState
newProjectState,
495
var
referencedProject = compilationState.SolutionState.GetProjectState(projectReference.ProjectId);
811
var
frozenProjectState = inProgressState.PendingTranslationActions.IsEmpty
930
var
projectState = inProgressState.PendingTranslationActions is [var translationAction, ..]
947
private static void ValidateCompilationTreesMatchesProjectState(Compilation compilation,
ProjectState
projectState, CompilationTrackerGeneratorInfo? generatorInfo)
1032
var
projectState = this.ProjectState;
1071
var
projectState = this.ProjectState;
1122
var
depProject = solution.GetRequiredProjectState(id);
1128
var
referencedProject = solution.GetRequiredProjectState(projectId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
391
static GeneratorDriver CreateGeneratorDriver(
ProjectState
projectState)
406
static void CheckGeneratorDriver(GeneratorDriver generatorDriver,
ProjectState
projectState)
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (2)
43
/// cref="
ProjectState
"/>, causing it to see a view of the world inapplicable to its current snapshot. A downside
115
/// Produces a copy of the <see cref="SkeletonReferenceCache"/>, allowing forks of <see cref="
ProjectState
"/> to
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
24
var
projectState = this.SolutionState.GetProjectState(documentId.ProjectId);
Workspace\Solution\SolutionCompilationState.TranslationAction.cs (4)
21
public readonly
ProjectState
OldProjectState;
26
public readonly
ProjectState
NewProjectState;
28
protected TranslationAction(
ProjectState
oldProjectState,
ProjectState
newProjectState)
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (6)
22
ProjectState
oldProjectState,
23
ProjectState
newProjectState,
70
ProjectState
oldProjectState,
71
ProjectState
newProjectState,
112
ProjectState
oldProjectState,
113
ProjectState
newProjectState)
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (2)
41
public
ProjectState
ProjectState => UnderlyingTracker.ProjectState;
76
public ICompilationTracker Fork(
ProjectState
newProject, TranslationAction? translate)
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (9)
34
/// of analyzer references (see <see cref="
ProjectState
.AnalyzerReferences"/>) to all the <see
39
private static readonly ConditionalWeakTable<
ProjectState
, SourceGeneratorMap> s_projectStateToSourceGeneratorsMap = new();
56
private static ImmutableArray<ISourceGenerator> GetSourceGenerators(
ProjectState
projectState)
65
private static AnalyzerReference GetAnalyzerReference(
ProjectState
projectState, ISourceGenerator sourceGenerator)
79
private static SourceGeneratorMap? GetSourceGeneratorMap(
ProjectState
projectState)
86
static SourceGeneratorMap ComputeSourceGenerators(
ProjectState
projectState)
106
var
projectState = this.SolutionState.GetRequiredProjectState(projectId);
122
AsyncLazy<bool> GetLazy(AnalyzerReferenceMap analyzerReferenceMap,
ProjectState
projectState)
129
SolutionCompilationState solution,
ProjectState
projectState, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.cs (57)
25
ProjectState
OldProjectState,
26
ProjectState
NewProjectState);
73
ImmutableDictionary<ProjectId,
ProjectState
> idToProjectStateMap,
119
idToProjectStateMap: ImmutableDictionary<ProjectId,
ProjectState
>.Empty,
129
public ImmutableDictionary<ProjectId,
ProjectState
> ProjectStates { get; }
172
ImmutableDictionary<ProjectId,
ProjectState
>? idToProjectStateMap = null,
254
foreach (
var
project in this.ProjectStates.Values)
310
public
ProjectState
? GetProjectState(ProjectId projectId)
311
=> ProjectStates.TryGetValue(projectId, out
var
state) ? state : null;
313
public
ProjectState
GetRequiredProjectState(ProjectId projectId)
315
var
result = GetProjectState(projectId);
332
using var _ = ArrayBuilder<
ProjectState
>.GetInstance(projectInfos.Count, out var projectStates);
338
ProjectState
CreateProjectState(ProjectInfo projectInfo)
366
var
newProject = new ProjectState(languageServices, projectInfo, fallbackAnalyzerOptions);
370
SolutionState AddProjects(ArrayBuilder<
ProjectState
> projectStates)
381
foreach (
var
projectState in projectStates)
393
foreach (
var
projectState in projectStates)
511
var
oldProject = GetRequiredProjectState(projectId);
527
var
oldProject = GetRequiredProjectState(projectId);
543
var
oldProject = GetRequiredProjectState(projectId);
559
var
oldProject = GetRequiredProjectState(projectId);
575
var
oldProject = GetRequiredProjectState(projectId);
591
var
oldProject = GetRequiredProjectState(projectId);
607
var
oldProject = GetRequiredProjectState(projectId);
623
var
oldProject = GetRequiredProjectState(projectId);
640
var
oldProject = GetRequiredProjectState(projectId);
657
var
oldProject = GetRequiredProjectState(projectId);
674
var
oldProject = GetRequiredProjectState(projectId);
692
var
oldProject = GetRequiredProjectState(projectId);
710
var
oldProject = GetRequiredProjectState(projectId);
728
var
oldProject = GetRequiredProjectState(projectId);
749
var
oldProject = GetRequiredProjectState(projectId);
789
var
oldProject = GetRequiredProjectState(projectId);
806
var
oldProject = GetRequiredProjectState(projectId);
837
var
oldProject = GetRequiredProjectState(projectId);
855
var
oldProject = GetRequiredProjectState(projectId);
872
var
oldProject = GetRequiredProjectState(projectId);
888
var
oldProject = GetRequiredProjectState(projectId);
940
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
956
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
968
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
984
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1000
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1016
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1032
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1048
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1064
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1108
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1121
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1132
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1148
ProjectState
oldProjectState,
1149
ProjectState
newProjectState,
1190
ImmutableDictionary<ProjectId,
ProjectState
> projectStates)
1241
var
projectState = this.GetProjectState(documentId.ProjectId);
1266
var
relatedProject = relatedProjectIdHint is null ? null : this.ProjectStates[relatedProjectIdHint];
1292
var
projectState = this.GetProjectState(documentId.ProjectId);
1319
var
projectState = @this.GetProjectState(documentId.ProjectId);
Workspace\Solution\SolutionState_Checksum.cs (2)
121
var
projectState = this.ProjectStates[orderedProjectId];
173
var
projectState = this.GetProjectState(projectConeId);
Workspace\Solution\StateChecksums.cs (1)
318
var
projectState = solution.GetProjectState(assetPath.ProjectId);
Microsoft.VisualStudio.LanguageServices (1)
Progression\GraphBuilder.cs (1)
88
var
projectState = _solution.GetProjectState(docIdWithPath.ProjectId);