6 instantiations of SourceGeneratorExecutionVersion
Microsoft.CodeAnalysis.Workspaces (4)
Workspace\Solution\SolutionCompilationState.cs (1)
349versionMapBuilder.Add(projectInfo.Id, new());
Workspace\Solution\SourceGeneratorExecutionVersion.cs (3)
33=> new(MajorVersion + 1, MinorVersion: 0); 36=> new(MajorVersion, MinorVersion + 1); 45=> new(reader.ReadInt32(), reader.ReadInt32());
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SolutionTests\SourceGeneratorExecutionVersionMapTests.cs (2)
23var project1Kvp = new KeyValuePair<ProjectId, SourceGeneratorExecutionVersion>(projectId1, new(MajorVersion: 1, MinorVersion: 1)); 24var project2Kvp = new KeyValuePair<ProjectId, SourceGeneratorExecutionVersion>(projectId2, new(MajorVersion: 2, MinorVersion: 2));
27 references to SourceGeneratorExecutionVersion
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Handler\SourceGenerators\SourceGeneratedDocumentCache.cs (3)
17internal sealed class SourceGeneratedDocumentCache(string uniqueKey) : VersionedPullCache<(SourceGeneratorExecutionVersion, VersionStamp), object?, SourceGeneratedDocumentGetTextState, SourceText?>(uniqueKey), ILspService 19public override async Task<(SourceGeneratorExecutionVersion, VersionStamp)> ComputeCheapVersionAsync(SourceGeneratedDocumentGetTextState state, CancellationToken cancellationToken) 23var executionVersion = state.Document.Project.Solution.GetSourceGeneratorExecutionVersion(state.Document.Project.Id);
Microsoft.CodeAnalysis.Workspaces (22)
Diagnostics\Extensions.cs (2)
462/// This checksum is also affected by the <see cref="SourceGeneratorExecutionVersion"/> for this project. 486if (solution.CompilationState.SourceGeneratorExecutionVersionMap.Map.TryGetValue(project.Id, out var executionVersion))
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (1)
30/// cref="SourceGeneratorExecutionVersion"/> for the project changes, we'll still have the same project state.
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ISolutionExtensions.cs (2)
119var projectIdToSourceGenerationVersion = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 125var currentVersion = solution.GetSourceGeneratorExecutionVersion(projectId);
Workspace\Solution\Solution.cs (1)
1906internal SourceGeneratorExecutionVersion GetSourceGeneratorExecutionVersion(ProjectId projectId)
Workspace\Solution\SolutionCompilationState.cs (2)
306/// Map from each project to the <see cref="SourceGeneratorExecutionVersion"/> it is currently at. Loosely, the 1512var currentExecutionVersion = versionMapBuilder[projectId];
Workspace\Solution\SourceGeneratorExecutionVersion.cs (11)
32public SourceGeneratorExecutionVersion IncrementMajorVersion() 35public SourceGeneratorExecutionVersion IncrementMinorVersion() 44public static SourceGeneratorExecutionVersion ReadFrom(ObjectReader reader) 54/// Helper construct to allow a mapping from <see cref="ProjectId"/>s to <see cref="SourceGeneratorExecutionVersion"/>. 57internal sealed class SourceGeneratorExecutionVersionMap(ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion> map) 61public ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion> Map { get; } = map; 64: this(ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion>.Empty) 68public SourceGeneratorExecutionVersion this[ProjectId projectId] => Map[projectId]; 97var builder = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 101var version = SourceGeneratorExecutionVersion.ReadFrom(reader);
Workspace\Workspace_SourceGeneration.cs (3)
77var result = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 133static SourceGeneratorExecutionVersion Increment(SourceGeneratorExecutionVersion version, bool major)
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SolutionTests\SourceGeneratorExecutionVersionMapTests.cs (2)
23var project1Kvp = new KeyValuePair<ProjectId, SourceGeneratorExecutionVersion>(projectId1, new(MajorVersion: 1, MinorVersion: 1)); 24var project2Kvp = new KeyValuePair<ProjectId, SourceGeneratorExecutionVersion>(projectId2, new(MajorVersion: 2, MinorVersion: 2));