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));
31 references to SourceGeneratorExecutionVersion
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Handler\SourceGenerators\SourceGeneratedDocumentCache.cs (3)
17internal sealed class SourceGeneratedDocumentCache(string uniqueKey) : VersionedPullCache<(SourceGeneratorExecutionVersion, VersionStamp), SourceGeneratedDocumentGetTextState, SourceText?>(uniqueKey), ILspService 19public override async Task<(SourceGeneratorExecutionVersion, VersionStamp)> ComputeVersionAsync(SourceGeneratedDocumentGetTextState state, CancellationToken cancellationToken) 23var executionVersion = state.Document.Project.Solution.GetSourceGeneratorExecutionVersion(state.Document.Project.Id);
Microsoft.CodeAnalysis.Workspaces (26)
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)
120var projectIdToSourceGenerationVersion = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 126var currentVersion = solution.GetSourceGeneratorExecutionVersion(projectId);
Workspace\Solution\Solution.cs (1)
1905internal 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 1506var currentExecutionVersion = versionMapBuilder[projectId];
Workspace\Solution\SourceGeneratorExecutionVersion.cs (15)
32public SourceGeneratorExecutionVersion IncrementMajorVersion() 35public SourceGeneratorExecutionVersion IncrementMinorVersion() 44public static SourceGeneratorExecutionVersion ReadFrom(ObjectReader reader) 52public static bool operator >(SourceGeneratorExecutionVersion left, SourceGeneratorExecutionVersion right) 56public static bool operator <(SourceGeneratorExecutionVersion left, SourceGeneratorExecutionVersion right) 61/// Helper construct to allow a mapping from <see cref="ProjectId"/>s to <see cref="SourceGeneratorExecutionVersion"/>. 64internal sealed class SourceGeneratorExecutionVersionMap(ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion> map) 68public ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion> Map { get; } = map; 71: this(ImmutableSortedDictionary<ProjectId, SourceGeneratorExecutionVersion>.Empty) 75public SourceGeneratorExecutionVersion this[ProjectId projectId] => Map[projectId]; 104var builder = ImmutableSortedDictionary.CreateBuilder<ProjectId, SourceGeneratorExecutionVersion>(); 108var 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));