4 instantiations of VersionStamp
Microsoft.CodeAnalysis.Workspaces (4)
265 references to VersionStamp
dotnet-format (2)
GenerateDocumentationAndConfigFiles (4)
Microsoft.Analyzers.Extra.Tests (1)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.CodeAnalysis.Analyzers (4)
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.Features (31)
Diagnostics\Service\DiagnosticAnalyzerService.IncrementalMemberEditAnalyzer.cs (7)
40private readonly record struct MemberSpans(DocumentId DocumentId, VersionStamp Version, ImmutableArray<TextSpan> Spans);
57VersionStamp version,
82var oldDocumentVersion = await GetDiagnosticVersionAsync(oldDocument.Project, cancellationToken).ConfigureAwait(false);
92if (oldDocumentVersion == VersionStamp.Default)
227private async Task<ImmutableArray<TextSpan>> GetOrCreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken)
244static async Task<ImmutableArray<TextSpan>> CreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken)
257private void SaveMemberSpans(DocumentId documentId, VersionStamp version, ImmutableArray<TextSpan> memberSpans)
Microsoft.CodeAnalysis.Workspaces (204)
Workspace\Solution\DocumentState.cs (13)
250private static TreeAndVersion MakeNewTreeAndVersion(SyntaxTree oldTree, SourceText oldText, VersionStamp oldVersion, SyntaxTree newTree, SourceText newText, VersionStamp newVersion)
253var version = topLevelChanged ? newVersion : oldVersion;
493var newTextVersion = GetNewerVersion();
494var newTreeVersion = GetNewTreeVersionForUpdatedTree(newRoot, newTextVersion, mode);
530VersionStamp textVersion,
531VersionStamp treeVersion,
552protected VersionStamp GetNewTreeVersionForUpdatedTree(SyntaxNode newRoot, VersionStamp newTextVersion, PreservationMode mode)
569protected VersionStamp GetNewerVersion()
581return VersionStamp.Create();
622public bool TryGetTopLevelChangeTextVersion(out VersionStamp version)
636public override async ValueTask<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken)
Workspace\Solution\ProjectState.cs (32)
48private readonly AsyncLazy<VersionStamp> _lazyLatestDocumentVersion;
49private readonly AsyncLazy<VersionStamp> _lazyLatestDocumentTopLevelChangeVersion;
62AsyncLazy<VersionStamp> lazyLatestDocumentVersion,
63AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion,
213private static async ValueTask<VersionStamp> ComputeLatestDocumentVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken)
216var latestVersion = VersionStamp.Default;
223var version = await state.GetTextVersionAsync(cancellationToken).ConfigureAwait(false);
232var version = await state.GetTextVersionAsync(cancellationToken).ConfigureAwait(false);
239private AsyncLazy<VersionStamp> CreateLazyLatestDocumentTopLevelChangeVersion(
244if (_lazyLatestDocumentTopLevelChangeVersion.TryGetValue(out var oldVersion))
258private static async Task<VersionStamp> ComputeTopLevelChangeTextVersionAsync(
259VersionStamp oldVersion, ImmutableArray<TextDocumentState> newDocuments, CancellationToken cancellationToken)
261var finalVersion = oldVersion;
264var newVersion = await newDocument.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false);
271private static async Task<VersionStamp> ComputeLatestDocumentTopLevelChangeVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken)
274var latestVersion = VersionStamp.Default;
279var version = await state.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false);
287var version = await state.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false);
600public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken)
603public async Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default)
605var docVersion = await _lazyLatestDocumentTopLevelChangeVersion.GetValueAsync(cancellationToken).ConfigureAwait(false);
656public VersionStamp Version => this.ProjectInfo.Version;
693AsyncLazy<VersionStamp>? latestDocumentVersion = null,
694AsyncLazy<VersionStamp>? latestDocumentTopLevelChangeVersion = null,
1045out AsyncLazy<VersionStamp> dependentDocumentVersion,
1046out AsyncLazy<VersionStamp> dependentSemanticVersion)
1059if (oldDocument.TryGetTextVersion(out var oldVersion))
1061if (!_lazyLatestDocumentVersion.TryGetValue(out var documentVersion) || documentVersion == oldVersion)
1064if (!_lazyLatestDocumentTopLevelChangeVersion.TryGetValue(out var semanticVersion) || semanticVersion == oldVersion)
1084var finalVersion = await newDocuments[0].GetTextVersionAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\SolutionInfo.cs (9)
29public VersionStamp Version => Attributes.Version;
71VersionStamp version,
83VersionStamp version,
94VersionStamp version,
118internal sealed class SolutionAttributes(SolutionId id, VersionStamp version, string? filePath, Guid telemetryId)
130public VersionStamp Version { get; } = version;
143VersionStamp? version = null,
147var newVersion = version ?? Version;
180return new SolutionAttributes(solutionId, VersionStamp.Create(), filePath, telemetryId);
Workspace\Workspace.cs (8)
90SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()),
140=> CreateSolution(SolutionInfo.Create(id, VersionStamp.Create()));
2022project.State.Attributes.With(version: VersionStamp.Create()),
2035=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath)));
2202this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()))));
2246this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()))));
2279this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()))));
2301this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Roslyn.Diagnostics.Analyzers (4)