1 instantiation of ProjectState
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\SolutionState.cs (1)
366
var newProject = new
ProjectState
(languageServices, projectInfo, fallbackAnalyzerOptions);
218 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)
31
/// cref="
ProjectState
.GetParseOptionsChecksum"/> and <see cref="DocumentStateChecksums.Text"/>
Microsoft.CodeAnalysis.Workspaces (215)
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 _)
330
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)
300
var
projectState = solution.SolutionState.GetRequiredProjectState(projectId);
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (2)
596
var
projectWithMetadataReference = solution.GetProjectState(projectIdWithMetadataReference);
597
var
referencedProject = solution.GetProjectState(referencedProjectId);
Workspace\Solution\Document.cs (1)
560
var provider = (
ProjectState
.ProjectAnalyzerConfigOptionsProvider)Project.State.AnalyzerOptions.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 (36)
335
internal sealed class ProjectAnalyzerConfigOptionsProvider(
ProjectState
projectState) : AnalyzerConfigOptionsProvider
581
private
ProjectState
With(
607
private
ProjectState
WithNewerAttributes(ProjectInfo.ProjectAttributes attributes)
615
public
ProjectState
WithName(string name)
618
public
ProjectState
WithFilePath(string? filePath)
621
public
ProjectState
WithAssemblyName(string assemblyName)
624
public
ProjectState
WithOutputFilePath(string? outputFilePath)
627
public
ProjectState
WithOutputRefFilePath(string? outputRefFilePath)
630
public
ProjectState
WithCompilationOutputInfo(in CompilationOutputInfo info)
633
public
ProjectState
WithDefaultNamespace(string? defaultNamespace)
636
public
ProjectState
WithHasAllInformation(bool hasAllInformation)
639
public
ProjectState
WithRunAnalyzers(bool runAnalyzers)
642
public
ProjectState
WithChecksumAlgorithm(SourceHashAlgorithm checksumAlgorithm)
657
public
ProjectState
WithCompilationOptions(CompilationOptions? options)
675
public
ProjectState
WithParseOptions(ParseOptions? options)
697
public
ProjectState
WithFallbackAnalyzerOptions(StructuredAnalyzerConfigOptions options)
707
public static bool IsSameLanguage(
ProjectState
project1,
ProjectState
project2)
726
public
ProjectState
WithProjectReferences(IReadOnlyList<ProjectReference> projectReferences)
736
public
ProjectState
WithMetadataReferences(IReadOnlyList<MetadataReference> metadataReferences)
746
public
ProjectState
WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
756
public
ProjectState
AddDocuments(ImmutableArray<DocumentState> documents)
768
public
ProjectState
AddAdditionalDocuments(ImmutableArray<AdditionalDocumentState> documents)
780
public
ProjectState
AddAnalyzerConfigDocuments(ImmutableArray<AnalyzerConfigDocumentState> documents)
792
private
ProjectState
CreateNewStateForChangedAnalyzerConfig(TextDocumentStates<AnalyzerConfigDocumentState> newAnalyzerConfigDocumentStates, StructuredAnalyzerConfigOptions fallbackOptions)
811
public
ProjectState
RemoveDocuments(ImmutableArray<DocumentId> documentIds)
824
public
ProjectState
RemoveAdditionalDocuments(ImmutableArray<DocumentId> documentIds)
834
public
ProjectState
RemoveAnalyzerConfigDocuments(ImmutableArray<DocumentId> documentIds)
844
public
ProjectState
RemoveAllNormalDocuments()
857
public
ProjectState
UpdateDocument(DocumentState newDocument)
860
public
ProjectState
UpdateDocuments(ImmutableArray<DocumentState> oldDocuments, ImmutableArray<DocumentState> newDocuments)
883
public
ProjectState
UpdateAdditionalDocument(AdditionalDocumentState newDocument)
886
public
ProjectState
UpdateAdditionalDocuments(ImmutableArray<AdditionalDocumentState> oldDocuments, ImmutableArray<AdditionalDocumentState> newDocuments)
908
public
ProjectState
UpdateAnalyzerConfigDocument(AnalyzerConfigDocumentState newDocument)
911
public
ProjectState
UpdateAnalyzerConfigDocuments(ImmutableArray<AnalyzerConfigDocumentState> oldDocuments, ImmutableArray<AnalyzerConfigDocumentState> newDocuments)
918
public
ProjectState
UpdateDocumentsOrder(ImmutableList<DocumentId> documentIds)
Workspace\Solution\Solution.cs (15)
86
internal
ProjectState
? GetProjectState(ProjectId projectId) => this.SolutionState.GetProjectState(projectId);
155
var
state = solution.SolutionState.GetProjectState(projectId);
637
var
oldProject = GetRequiredProjectState(projectId);
729
var
oldProject = GetRequiredProjectState(projectId);
814
var
oldProject = GetRequiredProjectState(projectId);
901
private static SourceCodeKind GetSourceCodeKind(
ProjectState
project)
916
var
project = GetRequiredProjectState(documentId.ProjectId);
937
var
project = GetRequiredProjectState(documentId.ProjectId);
956
var
project = GetRequiredProjectState(documentId.ProjectId);
963
private Solution AddDocumentImpl(
ProjectState
project, DocumentId documentId, string name, SourceText text, IReadOnlyList<string>? folders, string? filePath, bool isGenerated)
988
var
project = GetRequiredProjectState(documentId.ProjectId);
1081
var
project = GetRequiredProjectState(documentId.ProjectId);
1094
internal
ProjectState
GetRequiredProjectState(ProjectId projectId)
1819
var
projectState = this.SolutionState.GetRequiredProjectState(projectId);
1827
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;
555
var
oldProject = SolutionState.GetRequiredProjectState(projectId);
590
var
oldProjectState = SolutionState.GetRequiredProjectState(projectId);
818
var
oldProjectState = SolutionState.GetRequiredProjectState(projectId);
843
Func<
ProjectState
, ImmutableArray<TDocumentState>, TranslationAction> getTranslationAction)
877
private static TranslationAction GetUpdateDocumentsTranslationAction<TDocumentState>(
ProjectState
oldProjectState, ImmutableArray<TDocumentState> newDocumentStates)
888
TranslationAction GetUpdateOrdinaryDocumentsTranslationAction(
ProjectState
oldProjectState, ImmutableArray<DocumentState> newDocumentStates)
895
TranslationAction GetUpdateAdditionalDocumentsTranslationAction(
ProjectState
oldProjectState, ImmutableArray<AdditionalDocumentState> newDocumentStates)
902
TranslationAction GetUpdateAnalyzerConfigDocumentsTranslationAction(
ProjectState
oldProjectState, ImmutableArray<AnalyzerConfigDocumentState> newDocumentStates)
1102
var
projectState = solution.GetProjectState(projectId);
1149
/// Returns the compilation for the specified <see cref="
ProjectState
"/>. Can return <see langword="null"/> when the project
1155
public Task<Compilation?> GetCompilationAsync(
ProjectState
project, CancellationToken cancellationToken)
1165
public Task<bool> HasSuccessfullyLoadedAsync(
ProjectState
project, CancellationToken cancellationToken)
1177
public ValueTask<TextDocumentStates<SourceGeneratedDocumentState>> GetSourceGeneratedDocumentStatesAsync(
ProjectState
project, CancellationToken cancellationToken)
1180
/// <inheritdoc cref="GetSourceGeneratedDocumentStatesAsync(
ProjectState
, CancellationToken)"/>
1182
ProjectState
project, bool withFrozenSourceGeneratedDocuments, CancellationToken cancellationToken)
1190
ProjectState
project, CancellationToken cancellationToken)
1198
ProjectState
project, CancellationToken cancellationToken)
1226
ICompilationTracker tracker,
ProjectState
fromProject, ProjectReference projectReference, bool includeCrossLanguage, CancellationToken cancellationToken)
1260
ProjectReference projectReference,
ProjectState
fromProject, bool includeCrossLanguage, CancellationToken cancellationToken)
1613
var
oldProjectState = currentState.SolutionState.GetRequiredProjectState(documentId.ProjectId);
1658
var
projectState = SolutionState.GetRequiredProjectState(projectId);
1691
var
oldProjectState = SolutionState.GetRequiredProjectState(projectId);
1715
private static TranslationAction GetRemoveDocumentsTranslationAction<TDocumentState>(
ProjectState
oldProject, ImmutableArray<DocumentId> documentIds, ImmutableArray<TDocumentState> states)
1724
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);
812
var
frozenProjectState = inProgressState.PendingTranslationActions.IsEmpty
931
var
projectState = inProgressState.PendingTranslationActions is [var translationAction, ..]
948
private static void ValidateCompilationTreesMatchesProjectState(Compilation compilation,
ProjectState
projectState, CompilationTrackerGeneratorInfo? generatorInfo)
1033
var
projectState = this.ProjectState;
1072
var
projectState = this.ProjectState;
1123
var
depProject = solution.GetRequiredProjectState(id);
1129
var
referencedProject = solution.GetRequiredProjectState(projectId);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (2)
391
static GeneratorDriver CreateGeneratorDriver(
ProjectState
projectState)
404
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 (58)
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);
731
var
oldProject = GetRequiredProjectState(projectId);
771
var
oldProject = GetRequiredProjectState(projectId);
788
var
oldProject = GetRequiredProjectState(projectId);
819
var
oldProject = GetRequiredProjectState(projectId);
837
var
oldProject = GetRequiredProjectState(projectId);
854
var
oldProject = GetRequiredProjectState(projectId);
870
var
oldProject = GetRequiredProjectState(projectId);
888
var
oldProject = GetRequiredProjectState(projectId);
905
var
oldProject = GetRequiredProjectState(projectId);
957
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
973
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
985
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1001
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1017
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1033
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1049
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1065
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1081
var
oldProject = GetRequiredProjectState(documentId.ProjectId);
1125
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1138
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1149
var
oldProject = GetRequiredProjectState(newDocument.Id.ProjectId);
1165
ProjectState
oldProjectState,
1166
ProjectState
newProjectState,
1210
ImmutableDictionary<ProjectId,
ProjectState
> projectStates)
1261
var
projectState = this.GetProjectState(documentId.ProjectId);
1286
var
relatedProject = relatedProjectIdHint is null ? null : this.ProjectStates[relatedProjectIdHint];
1312
var
projectState = this.GetProjectState(documentId.ProjectId);
1337
var
projectState = args.solution.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)
317
var
projectState = solution.GetProjectState(assetPath.ProjectId);
Microsoft.VisualStudio.LanguageServices (1)
Progression\GraphBuilder.cs (1)
88
var
projectState = _solution.GetProjectState(docIdWithPath.ProjectId);