1 instantiation of ProjectState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SolutionState.cs (1)
366var newProject = new ProjectState(languageServices, projectInfo, fallbackAnalyzerOptions);
221 references to ProjectState
Microsoft.CodeAnalysis.Features (1)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
215var 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 (218)
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
24private static readonly ConditionalWeakTable<ProjectState, AsyncLazy<ProjectIndex>> s_projectToIndex = new();
FindSymbols\Shared\AbstractSyntaxIndex.cs (6)
19protected delegate TIndex IndexCreator(ProjectState project, SyntaxNode root, Checksum checksum, CancellationToken cancellationToken); 30SolutionKey solutionKey, ProjectState project, DocumentState document, IndexReader read, IndexCreator create, CancellationToken cancellationToken) 37protected static ValueTask<TIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, IndexReader read, IndexCreator create, CancellationToken cancellationToken) 43ProjectState project, 81ProjectState project, 115ProjectState project,
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (4)
39ProjectState project, 93ProjectState project, 135ProjectState project, 156ProjectState project,
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (2)
68private static readonly ConditionalWeakTable<ProjectState, AsyncLazy<Checksum>> s_projectToSourceChecksum = new(); 81private static async Task<Checksum> ComputeSourceSymbolsChecksumAsync(ProjectState projectState, CancellationToken cancellationToken)
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (3)
41public static ValueTask<SyntaxTreeIndex> GetRequiredIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, CancellationToken cancellationToken) 47public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, CancellationToken cancellationToken) 53public static ValueTask<SyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, bool loadOnly, CancellationToken cancellationToken)
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (3)
38private static readonly ConditionalWeakTable<ProjectState, StringTable> s_projectStringTable = new(); 41ProjectState project, SyntaxNode root, Checksum checksum, CancellationToken _) 330public static StringTable GetStringTable(ProjectState project)
FindSymbols\TopLevelSyntaxTree\IDeclaredSymbolInfoFactoryService.cs (1)
16void AddDeclaredSymbolInfos(ProjectState project, SyntaxNode root, ArrayBuilder<DeclaredSymbolInfo> declaredSymbolInfos, Dictionary<string, ArrayBuilder<int>> extensionMethodInfo, CancellationToken cancellationToken);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (3)
49public static ValueTask<TopLevelSyntaxTreeIndex> GetRequiredIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, CancellationToken cancellationToken) 55public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, CancellationToken cancellationToken) 61public static ValueTask<TopLevelSyntaxTreeIndex?> GetIndexAsync(SolutionKey solutionKey, ProjectState project, DocumentState document, bool loadOnly, CancellationToken cancellationToken)
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex_Create.cs (1)
16ProjectState project, SyntaxNode root, Checksum checksum, CancellationToken cancellationToken)
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (1)
153ProjectState project,
Workspace\Host\PersistentStorage\ProjectKey.cs (2)
37public static ProjectKey ToProjectKey(SolutionState solutionState, ProjectState projectState) 40public static ProjectKey ToProjectKey(SolutionKey solutionKey, ProjectState projectState)
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
302var projectState = solution.SolutionState.GetRequiredProjectState(projectId);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
600var projectWithMetadataReference = solution.GetProjectState(projectIdWithMetadataReference); 601var referencedProject = solution.GetProjectState(referencedProjectId);
Workspace\Solution\Document.cs (1)
560var provider = (ProjectState.ProjectHostAnalyzerConfigOptionsProvider)Project.State.HostAnalyzerOptions.AnalyzerConfigOptionsProvider;
Workspace\Solution\Project.cs (2)
34internal Project(Solution solution, ProjectState projectState) 43internal 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)
362internal sealed class ProjectAnalyzerConfigOptionsProvider(ProjectState projectState) : AnalyzerConfigOptionsProvider 432internal sealed class ProjectHostAnalyzerConfigOptionsProvider(ProjectState projectState) : AnalyzerConfigOptionsProvider 681private ProjectState With( 707private ProjectState WithNewerAttributes(ProjectInfo.ProjectAttributes attributes) 715public ProjectState WithName(string name) 718public ProjectState WithFilePath(string? filePath) 721public ProjectState WithAssemblyName(string assemblyName) 724public ProjectState WithOutputFilePath(string? outputFilePath) 727public ProjectState WithOutputRefFilePath(string? outputRefFilePath) 730public ProjectState WithCompilationOutputInfo(in CompilationOutputInfo info) 733public ProjectState WithDefaultNamespace(string? defaultNamespace) 736public ProjectState WithHasAllInformation(bool hasAllInformation) 739public ProjectState WithRunAnalyzers(bool runAnalyzers) 742internal ProjectState WithHasSdkCodeStyleAnalyzers(bool hasSdkCodeStyleAnalyzers) 745public ProjectState WithChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm) 760public ProjectState WithCompilationOptions(CompilationOptions? options) 778public ProjectState WithParseOptions(ParseOptions? options) 800public ProjectState WithFallbackAnalyzerOptions(StructuredAnalyzerConfigOptions options) 810public static bool IsSameLanguage(ProjectState project1, ProjectState project2) 829public ProjectState WithProjectReferences(IReadOnlyList<ProjectReference> projectReferences) 839public ProjectState WithMetadataReferences(IReadOnlyList<MetadataReference> metadataReferences) 849public ProjectState WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences) 859public ProjectState AddDocuments(ImmutableArray<DocumentState> documents) 871public ProjectState AddAdditionalDocuments(ImmutableArray<AdditionalDocumentState> documents) 883public ProjectState AddAnalyzerConfigDocuments(ImmutableArray<AnalyzerConfigDocumentState> documents) 895private ProjectState CreateNewStateForChangedAnalyzerConfig(TextDocumentStates<AnalyzerConfigDocumentState> newAnalyzerConfigDocumentStates, StructuredAnalyzerConfigOptions fallbackOptions) 914public ProjectState RemoveDocuments(ImmutableArray<DocumentId> documentIds) 927public ProjectState RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds) 937public ProjectState RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds) 947public ProjectState RemoveAllNormalDocuments() 960public ProjectState UpdateDocument(DocumentState newDocument) 963public ProjectState UpdateDocuments(ImmutableArray<DocumentState> oldDocuments, ImmutableArray<DocumentState> newDocuments) 986public ProjectState UpdateAdditionalDocument(AdditionalDocumentState newDocument) 989public ProjectState UpdateAdditionalDocuments(ImmutableArray<AdditionalDocumentState> oldDocuments, ImmutableArray<AdditionalDocumentState> newDocuments) 1011public ProjectState UpdateAnalyzerConfigDocument(AnalyzerConfigDocumentState newDocument) 1014public ProjectState UpdateAnalyzerConfigDocuments(ImmutableArray<AnalyzerConfigDocumentState> oldDocuments, ImmutableArray<AnalyzerConfigDocumentState> newDocuments) 1021public ProjectState UpdateDocumentsOrder(ImmutableList<DocumentId> documentIds)
Workspace\Solution\Solution.cs (15)
86internal ProjectState? GetProjectState(ProjectId projectId) => this.SolutionState.GetProjectState(projectId); 155var state = solution.SolutionState.GetProjectState(projectId); 648var oldProject = GetRequiredProjectState(projectId); 740var oldProject = GetRequiredProjectState(projectId); 825var oldProject = GetRequiredProjectState(projectId); 912private static SourceCodeKind GetSourceCodeKind(ProjectState project) 927var project = GetRequiredProjectState(documentId.ProjectId); 948var project = GetRequiredProjectState(documentId.ProjectId); 967var project = GetRequiredProjectState(documentId.ProjectId); 974private Solution AddDocumentImpl(ProjectState project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated) 999var project = GetRequiredProjectState(documentId.ProjectId); 1092var project = GetRequiredProjectState(documentId.ProjectId); 1105internal ProjectState GetRequiredProjectState(ProjectId projectId) 1836var projectState = this.SolutionState.GetRequiredProjectState(projectId); 1844var referencedProjectState = this.SolutionState.GetProjectState(projectReference.ProjectId);
Workspace\Solution\SolutionChanges.cs (2)
40var newState = _newSolution.GetProjectState(id); 41var 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 180var newProjectState = stateChange.NewProjectState; 565var oldProject = SolutionState.GetRequiredProjectState(projectId); 601var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 829var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 854Func<ProjectState, ImmutableArray<TDocumentState>, TranslationAction> getTranslationAction) 888private static TranslationAction GetUpdateDocumentsTranslationAction<TDocumentState>(ProjectState oldProjectState, ImmutableArray<TDocumentState> newDocumentStates) 899TranslationAction GetUpdateOrdinaryDocumentsTranslationAction(ProjectState oldProjectState, ImmutableArray<DocumentState> newDocumentStates) 906TranslationAction GetUpdateAdditionalDocumentsTranslationAction(ProjectState oldProjectState, ImmutableArray<AdditionalDocumentState> newDocumentStates) 913TranslationAction GetUpdateAnalyzerConfigDocumentsTranslationAction(ProjectState oldProjectState, ImmutableArray<AnalyzerConfigDocumentState> newDocumentStates) 1113var projectState = solution.GetProjectState(projectId); 1160/// Returns the compilation for the specified <see cref="ProjectState"/>. Can return <see langword="null"/> when the project 1166public Task<Compilation?> GetCompilationAsync(ProjectState project, CancellationToken cancellationToken) 1176public Task<bool> HasSuccessfullyLoadedAsync(ProjectState project, CancellationToken cancellationToken) 1188public ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(ProjectState project, CancellationToken cancellationToken) 1191/// <inheritdoc cref="GetSourceGeneratedDocumentStatesAsync(ProjectState, CancellationToken)"/> 1193ProjectState project, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken) 1201ProjectState project, CancellationToken cancellationToken) 1209ProjectState project, CancellationToken cancellationToken) 1237ICompilationTracker tracker, ProjectState fromProject, ProjectReference projectReference, bool includeCrossLanguage, CancellationToken cancellationToken) 1271ProjectReference projectReference, ProjectState fromProject, bool includeCrossLanguage, CancellationToken cancellationToken) 1629var oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId); 1674var projectState = SolutionState.GetRequiredProjectState(projectId); 1707var oldProjectState = SolutionState.GetRequiredProjectState(projectId); 1731private static TranslationAction GetRemoveDocumentsTranslationAction<TDocumentState>(ProjectState oldProject, ImmutableArray<DocumentId> documentIds, ImmutableArray<TDocumentState> states) 1740private static TranslationAction GetAddDocumentsTranslationAction<TDocumentState>(ProjectState oldProject, ImmutableArray<TDocumentState> states)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (2)
16ProjectState ProjectState { get; } 38ICompilationTracker Fork(ProjectState newProject, TranslationAction? translate);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (13)
32private static readonly Func<ProjectState, string> s_logBuildCompilationAsync = 37public ProjectState ProjectState { get; } 59ProjectState project, 79public RegularCompilationTracker(ProjectState project) 125ProjectState newProjectState, 495var referencedProject = compilationState.SolutionState.GetProjectState(projectReference.ProjectId); 811var frozenProjectState = inProgressState.PendingTranslationActions.IsEmpty 930var projectState = inProgressState.PendingTranslationActions is [var translationAction, ..] 947private static void ValidateCompilationTreesMatchesProjectState(Compilation compilation, ProjectState projectState, CompilationTrackerGeneratorInfo? generatorInfo) 1032var projectState = this.ProjectState; 1071var projectState = this.ProjectState; 1122var depProject = solution.GetRequiredProjectState(id); 1128var referencedProject = solution.GetRequiredProjectState(projectId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
391static GeneratorDriver CreateGeneratorDriver(ProjectState projectState) 406static 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)
24var projectState = this.SolutionState.GetProjectState(documentId.ProjectId);
Workspace\Solution\SolutionCompilationState.TranslationAction.cs (4)
21public readonly ProjectState OldProjectState; 26public readonly ProjectState NewProjectState; 28protected TranslationAction(ProjectState oldProjectState, ProjectState newProjectState)
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (6)
22ProjectState oldProjectState, 23ProjectState newProjectState, 70ProjectState oldProjectState, 71ProjectState newProjectState, 112ProjectState oldProjectState, 113ProjectState newProjectState)
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (2)
41public ProjectState ProjectState => UnderlyingTracker.ProjectState; 76public 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 39private static readonly ConditionalWeakTable<ProjectState, SourceGeneratorMap> s_projectStateToSourceGeneratorsMap = new(); 56private static ImmutableArray<ISourceGenerator> GetSourceGenerators(ProjectState projectState) 65private static AnalyzerReference GetAnalyzerReference(ProjectState projectState, ISourceGenerator sourceGenerator) 79private static SourceGeneratorMap? GetSourceGeneratorMap(ProjectState projectState) 86static SourceGeneratorMap ComputeSourceGenerators(ProjectState projectState) 106var projectState = this.SolutionState.GetRequiredProjectState(projectId); 122AsyncLazy<bool> GetLazy(AnalyzerReferenceMap analyzerReferenceMap, ProjectState projectState) 129SolutionCompilationState solution, ProjectState projectState, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.cs (59)
25ProjectState OldProjectState, 26ProjectState NewProjectState); 73ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap, 119idToProjectStateMap: ImmutableDictionary<ProjectId, ProjectState>.Empty, 129public ImmutableDictionary<ProjectId, ProjectState> ProjectStates { get; } 172ImmutableDictionary<ProjectId, ProjectState>? idToProjectStateMap = null, 254foreach (var project in this.ProjectStates.Values) 310public ProjectState? GetProjectState(ProjectId projectId) 311=> ProjectStates.TryGetValue(projectId, out var state) ? state : null; 313public ProjectState GetRequiredProjectState(ProjectId projectId) 315var result = GetProjectState(projectId); 332using var _ = ArrayBuilder<ProjectState>.GetInstance(projectInfos.Count, out var projectStates); 338ProjectState CreateProjectState(ProjectInfo projectInfo) 366var newProject = new ProjectState(languageServices, projectInfo, fallbackAnalyzerOptions); 370SolutionState AddProjects(ArrayBuilder<ProjectState> projectStates) 381foreach (var projectState in projectStates) 393foreach (var projectState in projectStates) 511var oldProject = GetRequiredProjectState(projectId); 527var oldProject = GetRequiredProjectState(projectId); 543var oldProject = GetRequiredProjectState(projectId); 559var oldProject = GetRequiredProjectState(projectId); 575var oldProject = GetRequiredProjectState(projectId); 591var oldProject = GetRequiredProjectState(projectId); 607var oldProject = GetRequiredProjectState(projectId); 623var oldProject = GetRequiredProjectState(projectId); 640var oldProject = GetRequiredProjectState(projectId); 657var oldProject = GetRequiredProjectState(projectId); 674var oldProject = GetRequiredProjectState(projectId); 692var oldProject = GetRequiredProjectState(projectId); 710var oldProject = GetRequiredProjectState(projectId); 728var oldProject = GetRequiredProjectState(projectId); 749var oldProject = GetRequiredProjectState(projectId); 789var oldProject = GetRequiredProjectState(projectId); 806var oldProject = GetRequiredProjectState(projectId); 837var oldProject = GetRequiredProjectState(projectId); 855var oldProject = GetRequiredProjectState(projectId); 872var oldProject = GetRequiredProjectState(projectId); 888var oldProject = GetRequiredProjectState(projectId); 906var oldProject = GetRequiredProjectState(projectId); 923var oldProject = GetRequiredProjectState(projectId); 975var oldProject = GetRequiredProjectState(documentId.ProjectId); 991var oldProject = GetRequiredProjectState(documentId.ProjectId); 1003var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1019var oldProject = GetRequiredProjectState(documentId.ProjectId); 1035var oldProject = GetRequiredProjectState(documentId.ProjectId); 1051var oldProject = GetRequiredProjectState(documentId.ProjectId); 1067var oldProject = GetRequiredProjectState(documentId.ProjectId); 1083var oldProject = GetRequiredProjectState(documentId.ProjectId); 1099var oldProject = GetRequiredProjectState(documentId.ProjectId); 1143var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1156var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1167var oldProject = GetRequiredProjectState(newDocument.Id.ProjectId); 1183ProjectState oldProjectState, 1184ProjectState newProjectState, 1225ImmutableDictionary<ProjectId, ProjectState> projectStates) 1276var projectState = this.GetProjectState(documentId.ProjectId); 1301var relatedProject = relatedProjectIdHint is null ? null : this.ProjectStates[relatedProjectIdHint]; 1327var projectState = this.GetProjectState(documentId.ProjectId); 1354var projectState = @this.GetProjectState(documentId.ProjectId);
Workspace\Solution\SolutionState_Checksum.cs (2)
121var projectState = this.ProjectStates[orderedProjectId]; 173var projectState = this.GetProjectState(projectConeId);
Workspace\Solution\StateChecksums.cs (1)
318var projectState = solution.GetProjectState(assetPath.ProjectId);
Microsoft.VisualStudio.LanguageServices (1)
Progression\GraphBuilder.cs (1)
88var projectState = _solution.GetProjectState(docIdWithPath.ProjectId);