5 instantiations of VersionStamp
Microsoft.CodeAnalysis.Workspaces (4)
Workspace\Solution\VersionStamp.cs (4)
69=> new(DateTime.UtcNow); 75=> new(utcTimeLastModified); 112return new VersionStamp(_utcLastModified, (thisGlobalVersion > thatGlobalVersion) ? thisGlobalVersion : thatGlobalVersion, GlobalVersionMarker); 130return new VersionStamp(now, incr);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PersistentStorage\AbstractPersistentStorageTests.cs (1)
839workspace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), new VersionStamp(), @"D:\git\PCLCrypto\PCLCrypto.sln"));
585 references to VersionStamp
GenerateDocumentationAndConfigFiles (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
56.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
56.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.CodeAnalysis.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (16)
CodeActions\PreviewTests.cs (1)
81solution = solution.AddProject(ProjectInfo.Create(s_addedProjectId, VersionStamp.Create(), AddedProjectName, AddedProjectName, LanguageNames.CSharp));
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (1)
40.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj1", "proj1.dll", LanguageNames.CSharp, filePath: "/a/b/proj1.csproj"))
Formatting\RazorLineFormattingOptionsTests.cs (1)
63loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "file.razor.g.cs")),
Workspaces\WorkspaceTests_EditorFeatures.cs (13)
585var newVersion = await cs.GetProject(project1.Id).GetDependentSemanticVersionAsync(); 586var newVersionX = await doc1Z.Project.GetDependentSemanticVersionAsync(); 587Assert.NotEqual(VersionStamp.Default, newVersion); 1123var oldVersion = await project.GetSemanticVersionAsync(); 1156var oldVersion = await project.GetSemanticVersionAsync(); 1455Assert.Throws<ArgumentException>(() => VersionStamp.Create(DateTime.Now)); 1461var version1 = VersionStamp.Create(default); 1462var version2 = VersionStamp.Create(default); 1464var version3 = version1.GetNewerVersion(version2); 1467var version4 = version1.GetNewerVersion(); 1468var version5 = version4.GetNewerVersion(version3);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\AddAttributesTests.cs (1)
30VersionStamp.Default,
CodeGeneration\AddImportsTests.cs (2)
34VersionStamp.Default, 855VersionStamp.Default,
CodeGeneration\SymbolEditorTests.cs (2)
40loader: TextLoader.From(TextAndVersion.Create(SourceText.From(s, encoding: null, SourceHashAlgorithms.Default), VersionStamp.Default)))).ToList(); 42var proj = ProjectInfo.Create(pid, VersionStamp.Default, "test", "test.dll", LanguageNames.CSharp, documents: docs,
Microsoft.CodeAnalysis.EditorFeatures (8)
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (4)
124var currentSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 144VersionStamp currentSemanticVersion, 156var (lastSemanticVersion, lastTextImageVersion) = ((VersionStamp, ITextImageVersion))context.State; 222VersionStamp currentSemanticVersion,
Interactive\InteractiveSession.cs (1)
309version: VersionStamp.Create(),
Shared\Preview\PreviewWorkspace.cs (3)
77var version = document.GetTextVersionSynchronously(CancellationToken.None); 86var version = document.GetTextVersionSynchronously(CancellationToken.None); 95var version = document.GetTextVersionSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Rename\RenamerTests.cs (4)
44var projectInfo = ProjectInfo.Create(projectId, VersionStamp.Create(), "ProjectName", "AssemblyName", LanguageName, filePath: ""); 179var projectInfo = ProjectInfo.Create(projectId, VersionStamp.Create(), "ProjectName", "AssemblyName", LanguageName, filePath: ""); 218var projectInfo = ProjectInfo.Create(projectId, VersionStamp.Create(), "ProjectName", "AssemblyName", LanguageName, filePath: ""); 229loader: TextLoader.From(TextAndVersion.Create(startSourceText, VersionStamp.Create(), documentName)),
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (7)
155VersionStamp.Create(), 246VersionStamp.Create(), 254loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 321VersionStamp.Create(), 330loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 361var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "CSharpProject", "CSharpProject", LanguageNames.CSharp); 815VersionStamp.Create(),
SymbolFinder\SymbolFinderTests.cs (1)
35VersionStamp.Default,
Microsoft.CodeAnalysis.Features (34)
CodeLens\CodeLensReferencesService.cs (2)
84public async ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken) 91var projectVersion = await GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false);
CodeLens\ICodeLensReferencesService.cs (1)
14ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken);
DesignerAttribute\DesignerAttributeDiscoveryService.cs (6)
60private readonly ConcurrentDictionary<DocumentId, (string? category, VersionStamp projectVersion)> _documentToLastReportedInformation = []; 200AsyncLazy<VersionStamp> lazyProjectVersion, 220private async Task<ImmutableArray<(DesignerAttributeData data, VersionStamp version)>> ComputeChangedDataAsync( 223AsyncLazy<VersionStamp> lazyProjectVersion, 234using var _ = ArrayBuilder<(DesignerAttributeData data, VersionStamp version)>.GetInstance(out var results); 251var projectVersion = await lazyProjectVersion.GetValueAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\DiagnosticAnalyzerExtensions.cs (4)
29public static (string analyzerId, VersionStamp version) GetAnalyzerIdAndVersion(this DiagnosticAnalyzer analyzer) 37private static VersionStamp GetAnalyzerVersion(string path) 41return VersionStamp.Default; 44return VersionStamp.Create(File.GetLastWriteTimeUtc(path));
Diagnostics\Service\DiagnosticAnalyzerService.cs (1)
80public static Task<VersionStamp> GetDiagnosticVersionAsync(Project project, CancellationToken cancellationToken)
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (3)
51VersionStamp version, 76var oldDocumentVersion = await GetDiagnosticVersionAsync(oldDocument.Project, cancellationToken).ConfigureAwait(false); 86if (oldDocumentVersion == VersionStamp.Default)
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer_MemberSpans.cs (4)
24private readonly record struct MemberSpans(DocumentId DocumentId, VersionStamp Version, ImmutableArray<TextSpan> Spans); 29private async Task<ImmutableArray<TextSpan>> GetOrCreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 46static async Task<ImmutableArray<TextSpan>> CreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 59private void SaveMemberSpans(DocumentId documentId, VersionStamp version, ImmutableArray<TextSpan> memberSpans)
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (1)
233var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false);
EditAndContinue\CommittedSolution.cs (1)
249var sourceTextVersion = (committedDocument == null) ? await document.GetTextVersionAsync(cancellationToken).ConfigureAwait(false) : default;
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (2)
35if (oldDocument.TryGetSyntaxVersion(out var oldVersion) && 36newDocument.TryGetSyntaxVersion(out var newVersion) &&
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (2)
79loader: TextLoader.From(assemblyInfoSourceText.Container, VersionStamp.Default), 96version: VersionStamp.Default,
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (1)
200var textAndVersion = TextAndVersion.Create(sourceText, VersionStamp.Default, filePath);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
326version: VersionStamp.Default,
SolutionCrawler\AbstractDocumentDifferenceService.cs (4)
38if (oldDocument.TryGetSyntaxVersion(out var oldVersion) && 39newDocument.TryGetSyntaxVersion(out var newVersion) && 74if (!oldDocument.TryGetTopLevelChangeTextVersion(out var oldTopLevelChangeVersion) || 75!newDocument.TryGetTopLevelChangeTextVersion(out var newTopLevelChangeVersion))
Workspace\MiscellaneousFileUtilities.cs (1)
73version: VersionStamp.Create(),
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
487loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), path)),
EditAndContinue\Extensions.cs (1)
105VersionStamp.Create(),
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
42AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj", "proj", LanguageNames.CSharp, filePath: projectFilePath)). 109.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj", "proj", LanguageNames.CSharp))
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
350loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "design-time-only.cs")), 4015loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), filePath)),
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Handler\CodeLens\CodeLensHandler.cs (1)
90var syntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
Handler\CodeLens\CodeLensResolveHandler.cs (1)
39var currentDocumentSyntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticsPullCache.cs (3)
25/// changed. The <see cref="VersionStamp"/> is produced by <see 32: VersionedPullCache<(int globalStateVersion, VersionStamp? dependentVersion), (int globalStateVersion, Checksum dependentChecksum), DiagnosticsRequestState, ImmutableArray<DiagnosticData>>(uniqueKey) 36public override async Task<(int globalStateVersion, VersionStamp? dependentVersion)> ComputeCheapVersionAsync(DiagnosticsRequestState state, CancellationToken cancellationToken)
Handler\InlayHint\InlayHintHandler.cs (1)
54var syntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
Handler\InlayHint\InlayHintResolveHandler.cs (1)
49var currentSyntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
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) 24var dependentVersion = await state.Document.Project.GetDependentVersionAsync(cancellationToken).ConfigureAwait(false);
Workspaces\SourceTextLoader.cs (1)
27=> Task.FromResult(TextAndVersion.Create(_sourceText, VersionStamp.Create(), _fileUri));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Workspaces\LspWorkspaceManagerTests.cs (2)
66var firstDocumentInitialVersion = await firstDocument.GetSyntaxVersionAsync(CancellationToken.None); 67var secondDocumentInitialVersion = await secondDocument.GetSyntaxVersionAsync(CancellationToken.None);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
34VersionStamp.Default,
Microsoft.CodeAnalysis.Workspaces (204)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
30private readonly ConcurrentDictionary<ProjectId, (VersionStamp semanticVersion, SymbolTreeInfo info)> _projectIdToInfo = []; 166var semanticVersion = await project.GetSemanticVersionAsync(cancellationToken).ConfigureAwait(false);
Serialization\SerializableSourceText.cs (2)
218private readonly VersionStamp _version = VersionStamp.Create();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Workspace\AdhocWorkspace.cs (5)
65var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 126var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())); 168var version = doc.GetTextVersionSynchronously(CancellationToken.None); 196var version = doc.GetTextVersionSynchronously(CancellationToken.None); 224var version = doc.GetTextVersionSynchronously(CancellationToken.None);
Workspace\CommandLineProject.cs (1)
120version: VersionStamp.Create(),
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
668=> Task.FromResult(TextAndVersion.Create(_textContainer.CurrentText, VersionStamp.Create(), _filePath));
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (5)
117var versionStamp = creationInfo.FilePath != null 118? VersionStamp.Create(File.GetLastWriteTimeUtc(creationInfo.FilePath)) 119: VersionStamp.Create(); 152VersionStamp.Create(), 463VersionStamp.Create(),
Workspace\Solution\ConstantTextAndVersionSource.cs (2)
39public bool TryGetVersion(LoadTextOptions options, out VersionStamp version) 45public ValueTask<VersionStamp> GetVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
Workspace\Solution\Document.cs (7)
107public bool TryGetSyntaxVersion(out VersionStamp version) 110if (!this.TryGetTextVersion(out var textVersion)) 115var projectVersion = this.Project.Version; 123internal bool TryGetTopLevelChangeTextVersion(out VersionStamp version) 129public async Task<VersionStamp> GetSyntaxVersionAsync(CancellationToken cancellationToken = default) 131var textVersion = await this.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 132var projectVersion = this.Project.Version;
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\DocumentState_LinkedFileReuse.cs (1)
133VersionStamp siblingVersion,
Workspace\Solution\DocumentState_TreeTextSource.cs (4)
16internal sealed class TreeTextSource(AsyncLazy<SourceText> textSource, VersionStamp version) : ITextAndVersionSource 18private readonly VersionStamp _version = version; 55public bool TryGetVersion(LoadTextOptions options, out VersionStamp version) 61public ValueTask<VersionStamp> GetVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
Workspace\Solution\FileTextLoader.cs (4)
178var version = VersionStamp.Create(t.prevLastWriteTime); 206var version = VersionStamp.Create(t.prevLastWriteTime);
Workspace\Solution\Project.cs (5)
550public VersionStamp Version => State.Version; 555public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken = default) 561public Task<VersionStamp> GetDependentVersionAsync(CancellationToken cancellationToken = default) 568public Task<VersionStamp> GetDependentSemanticVersionAsync(CancellationToken cancellationToken = default) 575public Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default)
Workspace\Solution\ProjectInfo.cs (9)
32public VersionStamp Version => Attributes.Version; 187VersionStamp version, 215VersionStamp version, 338public ProjectInfo WithVersion(VersionStamp version) 414VersionStamp version, 443public VersionStamp Version { get; } = version; 535VersionStamp? version = null, 551var newVersion = version ?? Version; 652VersionStamp.Create(),
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); 610public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken) 613public async Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default) 615var docVersion = await _lazyLatestDocumentTopLevelChangeVersion.GetValueAsync(cancellationToken).ConfigureAwait(false); 666public VersionStamp Version => this.ProjectInfo.Version; 703AsyncLazy<VersionStamp>? latestDocumentVersion = null, 704AsyncLazy<VersionStamp>? latestDocumentTopLevelChangeVersion = null, 1055out AsyncLazy<VersionStamp> dependentDocumentVersion, 1056out AsyncLazy<VersionStamp> dependentSemanticVersion) 1069if (oldDocument.TryGetTextVersion(out var oldVersion)) 1071if (!_lazyLatestDocumentVersion.TryGetValue(out var documentVersion) || documentVersion == oldVersion) 1074if (!_lazyLatestDocumentTopLevelChangeVersion.TryGetValue(out var semanticVersion) || semanticVersion == oldVersion) 1094var finalVersion = await newDocuments[0].GetTextVersionAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\Solution.cs (6)
115public VersionStamp Version => this.SolutionState.Version; 138public VersionStamp GetLatestProjectVersion() => this.SolutionState.GetLatestProjectVersion(); 368=> this.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), name, assemblyName, language)); 1003loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 1116var version = VersionStamp.Create();
Workspace\Solution\SolutionCompilationState.cs (2)
1173public Task<VersionStamp> GetDependentVersionAsync(ProjectId projectId, CancellationToken cancellationToken) 1176public Task<VersionStamp> GetDependentSemanticVersionAsync(ProjectId projectId, CancellationToken cancellationToken)
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (2)
54Task<VersionStamp> GetDependentVersionAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken); 55Task<VersionStamp> GetDependentSemanticVersionAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (12)
1018private AsyncLazy<VersionStamp>? _lazyDependentVersion; 1019private AsyncLazy<VersionStamp>? _lazyDependentSemanticVersion; 1021public Task<VersionStamp> GetDependentVersionAsync( 1038private async Task<VersionStamp> ComputeDependentVersionAsync( 1042var projVersion = projectState.Version; 1043var docVersion = await projectState.GetLatestDocumentVersionAsync(cancellationToken).ConfigureAwait(false); 1045var version = docVersion.GetNewerVersion(projVersion); 1052var dependentProjectVersion = await compilationState.GetDependentVersionAsync(dependentProjectReference.ProjectId, cancellationToken).ConfigureAwait(false); 1060public Task<VersionStamp> GetDependentSemanticVersionAsync( 1077private async Task<VersionStamp> ComputeDependentSemanticVersionAsync( 1081var version = await projectState.GetSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 1089var dependentProjectVersion = await compilationState.GetDependentSemanticVersionAsync(
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (7)
38/// cref="VersionStamp"/> for a project. As long as the <see cref="Project.GetDependentSemanticVersionAsync"/> for 105/// cref="_skeletonReferenceSet"/> corresponds to. Initially set to <see cref="VersionStamp.Default"/>. 107private VersionStamp _version; 146var version = await compilationTracker.GetDependentSemanticVersionAsync( 149Debug.Assert(version != VersionStamp.Default); 161VersionStamp version, 164Debug.Assert(version != VersionStamp.Default);
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (2)
153public Task<VersionStamp> GetDependentVersionAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken) 156public Task<VersionStamp> GetDependentSemanticVersionAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken)
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\Solution\SolutionState.cs (4)
151public VersionStamp Version => SolutionAttributes.Version; 261public VersionStamp GetLatestProjectVersion() 264var latestVersion = VersionStamp.Default;
Workspace\Solution\SourceGeneratedDocumentState.cs (4)
91var textAndVersion = TextAndVersion.Create(generatedSourceText, VersionStamp.Create()); 108treeSource = SimpleTreeAndVersionSource.Create(new TreeAndVersion(newTree, VersionStamp.Create())); 242var textAndVersion = TextAndVersion.Create(sourceText, VersionStamp.Create()); 244var newTreeVersion = GetNewTreeVersionForUpdatedTree(newRoot, GetNewerVersion(), PreservationMode.PreserveValue);
Workspace\Solution\TextAndVersion.cs (4)
23public VersionStamp Version { get; } 36private TextAndVersion(SourceText text, VersionStamp version, string? filePath, string? exceptionMessage) 53public static TextAndVersion Create(SourceText text, VersionStamp version, string? filePath = null) 61internal static TextAndVersion Create(SourceText text, VersionStamp version, string? filePath, string? exceptionMessage)
Workspace\Solution\TextDocument.cs (4)
69public bool TryGetTextVersion(out VersionStamp version) 92public async Task<VersionStamp> GetTextVersionAsync(CancellationToken cancellationToken = default) 100internal VersionStamp GetTextVersionSynchronously(CancellationToken cancellationToken) 106internal ValueTask<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken = default)
Workspace\Solution\TextDocumentState.cs (9)
94public bool TryGetTextVersion(out VersionStamp version) 120public VersionStamp GetTextVersionSynchronously(CancellationToken cancellationToken) 126public async ValueTask<VersionStamp> GetTextVersionAsync(CancellationToken cancellationToken) 129if (TryGetTextVersion(out var version)) 147var newVersion = GetNewerVersion(); 164: CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, encoding: null, loadTextOptions.ChecksumAlgorithm), VersionStamp.Default, filePath)); 207private VersionStamp GetNewerVersion() 214return VersionStamp.Create(); 217public virtual ValueTask<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken)
Workspace\Solution\TextLoader.cs (4)
162VersionStamp.Default, 186public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null) 213private readonly VersionStamp _version; 216internal TextContainerLoader(SourceTextContainer container, VersionStamp version, string? filePath)
Workspace\Solution\TreeAndVersion.cs (2)
10internal sealed class TreeAndVersion(SyntaxTree tree, VersionStamp version) 20public VersionStamp Version { get; } = version;
Workspace\Solution\VersionSource\ITextAndVersionSource.cs (2)
29bool TryGetVersion(LoadTextOptions options, out VersionStamp version); 35ValueTask<VersionStamp> GetVersionAsync(LoadTextOptions options, CancellationToken cancellationToken);
Workspace\Solution\VersionSource\LoadableTextAndVersionSource.cs (2)
135public bool TryGetVersion(LoadTextOptions options, out VersionStamp version) 147public async ValueTask<VersionStamp> GetVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (4)
69public bool TryGetVersion(LoadTextOptions options, out VersionStamp version) 132public async ValueTask<VersionStamp> GetVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 141public readonly VersionStamp Version; 207public bool TryGetTextVersion(LoadTextOptions options, out VersionStamp version)
Workspace\Solution\VersionStamp.cs (17)
15public readonly struct VersionStamp : IEquatable<VersionStamp> 17public static VersionStamp Default => default; 68public static VersionStamp Create() 74public static VersionStamp Create(DateTime utcTimeLastModified) 81public VersionStamp GetNewerVersion(VersionStamp version) 122public VersionStamp GetNewerVersion() 147if (obj is VersionStamp v) 155public bool Equals(VersionStamp version) 165public static bool operator ==(VersionStamp left, VersionStamp right) 168public static bool operator !=(VersionStamp left, VersionStamp right) 171private static int GetGlobalVersion(VersionStamp version) 187var globalVersion = Interlocked.Increment(ref VersionStamp.s_globalVersion); 195internal readonly struct TestAccessor(VersionStamp versionStamp) 201internal bool IsNewerThan(in VersionStamp version)
Workspace\Workspace.cs (8)
92SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()), 143=> CreateSolution(SolutionInfo.Create(id, VersionStamp.Create())); 2059project.State.Attributes.With(version: VersionStamp.Create()), 2072=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2239this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2283this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2316this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2338this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (3)
398oldDocument.TryGetTextVersion(out var version)) 486private static TextAndVersion GetProperTextAndVersion(SourceText oldText, SourceText newText, VersionStamp version, string? filePath) 596var version = oldDocument.GetTextVersionSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildProjectLoader.Worker.cs (3)
277var version = projectPath is null 278? VersionStamp.Default 279: VersionStamp.Create(FileUtilities.GetFileTimeStamp(projectPath));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
VisualStudioMSBuildWorkspaceTests.cs (8)
397var sversion = solution.Version; 398var latestPV = solution.GetLatestProjectVersion(); 400var pversion = project.Version; 402var dversion = await document.GetTextVersionAsync(); 403var latestDV = await project.GetLatestDocumentVersionAsync(); 408var dversion1 = await document1.GetTextVersionAsync(); 413var latestDV1 = await document1.Project.GetLatestDocumentVersionAsync(); 421var dversion2 = await document2.GetTextVersionAsync();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (9)
SolutionUtilities.cs (1)
111VersionStamp.Default,
TestTextLoader.cs (1)
18_textAndVersion = TextAndVersion.Create(SourceText.From(text, encoding: null, checksumAlgorithm), VersionStamp.Create());
Workspaces\TestHostDocument.cs (1)
190=> Task.FromResult(TextAndVersion.Create(SourceText.From(_text, encoding: Encoding.UTF8, options.ChecksumAlgorithm), VersionStamp.Create(), _hostDocument.FilePath));
Workspaces\TestHostProject`1.cs (3)
78public VersionStamp Version { get; } 120Version = VersionStamp.Create(); 156Version = VersionStamp.Create();
Workspaces\TestHostSolution`1.cs (2)
15public readonly VersionStamp Version; 22this.Version = VersionStamp.Create();
Workspaces\TestWorkspace`1.cs (1)
78SetCurrentSolutionEx(CreateSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()).WithTelemetryId(solutionTelemetryId)));
Microsoft.CodeAnalysis.Workspaces.UnitTests (177)
FindReferencesTests.cs (2)
34VersionStamp.Default, 50VersionStamp.Default,
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
30var projectInfo = ProjectInfo.Create(projectId, VersionStamp.Create(), "ProjectName" + i, "AssemblyName" + i, languageName);
SolutionTests\ProjectDependencyGraphTests.cs (2)
246var projectAInfo = ProjectInfo.Create(projectAId, VersionStamp.Create(), "A", "A", LanguageNames.CSharp, 713return solution.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), projectName, projectName, LanguageNames.CSharp, projectName));
SolutionTests\ProjectInfoTests.cs (28)
24Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(id: null, version: VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#")); 25Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: null, assemblyName: "Bar", language: "C#")); 26Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: null, language: "C#")); 27Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: null)); 29Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 40() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", documents: [documentInfo, documentInfo])); 42Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 46() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", additionalDocuments: [documentInfo, documentInfo])); 48Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 53() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", projectReferences: [projectReference, projectReference])); 55Assert.Throws<ArgumentNullException>("analyzerReferences[0]", () => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 60() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", analyzerReferences: [analyzerReference, analyzerReference])); 62Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 67() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", metadataReferences: [metadataReference, metadataReference])); 73var version = VersionStamp.Default; 92var version = VersionStamp.Default; 111var version = VersionStamp.Default; 130var version = VersionStamp.Default; 149var version = VersionStamp.Default; 168var projectInfo = ProjectInfo.Create(name: "Goo", filePath: @"C:\", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 175var projectInfo = ProjectInfo.Create(name: "Goo", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 184var instance = ProjectInfo.Create(name: "Name", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "AssemblyName", language: "C#"); 187SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithVersion(value), opt => opt.Version, VersionStamp.Create());
SolutionTests\SolutionInfoTests.cs (5)
20var version = VersionStamp.Default; 31var version = VersionStamp.Default; 53var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Default, filePath: path);
SolutionTests\SolutionTests.cs (100)
57.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))) 372var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 376Assert.True(newSolution1.GetDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 437var version1 = await document1.GetTextVersionAsync(); 438var version2 = await document2.GetTextVersionAsync(); 450var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 525var version1 = await document1.GetTextVersionAsync(); 526var version2 = await document2.GetTextVersionAsync(); 538var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 604var version1 = await document1.GetTextVersionAsync(); 605var version2 = await document2.GetTextVersionAsync(); 621var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 690var version1 = await document1.GetTextVersionAsync(); 691var version2 = await document2.GetTextVersionAsync(); 704var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 767var version1 = await document1.GetTextVersionAsync(); 768var version2 = await document2.GetTextVersionAsync(); 780var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 855var version1 = await document1.GetTextVersionAsync(); 856var version2 = await document2.GetTextVersionAsync(); 867var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 940var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 944Assert.True(newSolution1.GetAdditionalDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 986var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 990Assert.True(newSolution1.GetAnalyzerConfigDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 1089.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))) 1090.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, "proj2", "proj2", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj2.dll"))) 1106loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD1;", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1115loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1125loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1134loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1144loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1153loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1166VersionStamp.Create(), 1298.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1305VersionStamp.Create(), 1333.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1340VersionStamp.Create(), 1368.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1375VersionStamp.Create(), 1403.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1410VersionStamp.Create(), 2049.AddProject(ProjectInfo.Create(submissionId1, VersionStamp.Default, name: "submission1", assemblyName: "submission1.dll", LanguageNames.CSharp, isSubmission: true)) 2050.AddProject(ProjectInfo.Create(submissionId2, VersionStamp.Default, name: "submission2", assemblyName: "submission2.dll", LanguageNames.CSharp, isSubmission: true)) 2051.AddProject(ProjectInfo.Create(submissionId3, VersionStamp.Default, name: "submission3", assemblyName: "submission3.dll", LanguageNames.CSharp, isSubmission: true)) 2850.AddProject(ProjectInfo.Create(pm1, VersionStamp.Create(), "goo", "goo.dll", LanguageNames.CSharp, compilationOptions: workspace.Services 4060VersionStamp.Create(), 4072VersionStamp.Create(), 4092VersionStamp.Create(), 4102VersionStamp.Create(), 4265VersionStamp.Create(), 4278VersionStamp.Create(), 4615VersionStamp GetVersion() => solution.GetProject(pid).Version; 4634var oldVersion = GetVersion(); 4638var newVersion = GetVersion(); 4663var newSameVersion = GetVersion(); 4717loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4750loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4791loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4803TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA6789.severity = error"), VersionStamp.Default)), 4839loader: TextLoader.From(TextAndVersion.Create(SourceText.From("is_global = true\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4885loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ngenerated_code = true"), VersionStamp.Default))))); 4971ProjectInfo.Create(projectId, VersionStamp.Default, "Test", "Test", LanguageNames.CSharp) 4993projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 4994projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5017projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId2)])); 5018projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5045projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 5046projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId1)])); 5071solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 5076projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5077projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5101solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId2)])); 5107projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5108projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5132solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, 5139projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5140projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5170projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5171projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5189projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, 5191projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5192projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5235projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 5236projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5237projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5278projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5279projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5301ProjectInfo.Create(csProjectId, VersionStamp.Default, "CS1", "CS1", LanguageNames.CSharp), 5302ProjectInfo.Create(vbProjectId, VersionStamp.Default, "VB1", "VB1", LanguageNames.VisualBasic) 5354VersionStamp.Create(), 5368VersionStamp.Create(), 5381VersionStamp.Create(), 5395VersionStamp.Create(), 5409VersionStamp.Create(), 5419VersionStamp.Create(), 5468var version = VersionStamp.Create(); 5472version: VersionStamp.Default, 5553VersionStamp.Default,
SolutionTests\TextLoaderTests.cs (3)
82public static readonly TextAndVersion Value = TextAndVersion.Create(SourceText.From(""), VersionStamp.Default); 91public static new readonly TextAndVersion Value = TextAndVersion.Create(SourceText.From(""), VersionStamp.Default); 100public static readonly TextAndVersion Value = TextAndVersion.Create(SourceText.From(""), VersionStamp.Default);
SolutionTests\TryApplyChangesTests.cs (1)
40OnProjectAdded(ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Default, "TestProject", "TestProject", LanguageNames.CSharp));
WorkspaceTests\AdhocWorkspaceTests.cs (25)
30version: VersionStamp.Default, 85version: VersionStamp.Default, 90var sinfo = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Default, projects: [pinfo]); 112version: VersionStamp.Default, 120version: VersionStamp.Default, 155loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create()))); 159VersionStamp.Create(), 190version: VersionStamp.Default, 214var version = VersionStamp.Create(); 218version: VersionStamp.Default, 233Assert.True(doc.TryGetTextVersion(out var currentVersion)); 248var version = VersionStamp.Create(); 252version: VersionStamp.Default, 267Assert.True(doc.TryGetTextVersion(out var currentVersion)); 282var version = VersionStamp.Create(); 291version: VersionStamp.Default, 306Assert.True(doc.TryGetTextVersion(out var currentVersion)); 321var version = VersionStamp.Create(); 325version: VersionStamp.Default, 335Assert.False(doc.TryGetTextVersion(out var currentVersion)); 357var actualVersion = await newDoc.GetTextVersionAsync();
WorkspaceTests\WorkspaceReferenceTests.cs (8)
22VersionStamp.Create(), 51VersionStamp.Create(), 61VersionStamp.Create(), 91VersionStamp.Create(), 101VersionStamp.Create(), 131VersionStamp.Create(), 141VersionStamp.Create(), 175VersionStamp.Create(),
WorkspaceTests\WorkspaceTests.cs (2)
129var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 165var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()));
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
79.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
79.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
79.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
79.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
79.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
79.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()))
Microsoft.VisualStudio.LanguageServices (8)
CodeLens\CodeLensCallbackListener.cs (3)
75var projectVersion = await service.GetProjectCodeLensVersionAsync(solution, project.Id, cancellationToken).ConfigureAwait(false); 103var currentProjectVersion = await service.GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false); 138var projectVersion = await service.GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false);
CodeLens\RemoteCodeLensReferencesService.cs (1)
35public ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\Api\VSTypeScriptContainedLanguageWrapper.cs (1)
74workspace.OnProjectAdded(ProjectInfo.Create(projectId, VersionStamp.Default, filePath, string.Empty, InternalLanguageNames.TypeScript));
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (2)
119if (oldDocument.TryGetTextVersion(out var oldTextVersion) 120&& newDocument.TryGetTextVersion(out var newTextVersion)
Preview\PreviewUpdater.PreviewDialogWorkspace.cs (1)
54=> TextAndVersion.Create(_text, VersionStamp.Create());
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
ReferenceCodeLensProvider.cs (1)
134var versionedPoints = _dataPoints.GetOrAdd(dataPoint.Descriptor.ProjectGuid, _ => (version: VersionStamp.Default.ToString(), dataPoints: []));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (7)
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
31.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj1", "proj1.dll", LanguageNames.CSharp, filePath: projectFilePath))
PersistentStorage\AbstractPersistentStorageTests.cs (2)
978var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), solutionFile.Path); 986solution = solution.AddProject(ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "Project1", "Project1", LanguageNames.CSharp,
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (4)
69VersionStamp GetVersion() => environment.Workspace.CurrentSolution.Projects.Single().Version; 90var oldVersion = GetVersion(); 94var newVersion = GetVersion(); 98var newSameVersion = GetVersion();
Microsoft.VisualStudio.LanguageServices.LiveShare (4)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
102VersionStamp.Create(),
Client\Projects\WorkspaceFileTextLoaderNoException.cs (1)
32return Task.FromResult(TextAndVersion.Create(SourceText.From("", encoding: null, options.ChecksumAlgorithm), VersionStamp.Create()));
Client\Razor\CSharpLspRazorProjectFactory.cs (1)
26var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(projectName), VersionStamp.Default, projectName, projectName, LanguageNames.CSharp);
Client\RemoteLanguageServiceWorkspace.cs (1)
323VersionStamp.Create(),
Roslyn.Diagnostics.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,
Roslyn.VisualStudio.Next.UnitTests (33)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
46workspace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Default));
Remote\SnapshotSerializationTests.cs (1)
67loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())))]);
Services\ServiceHubServicesTests.cs (26)
369SolutionId.CreateNewId(), VersionStamp.Create(), "", 372p1, VersionStamp.Create(), "p1", "p1", LanguageNames.CSharp, outputFilePath: file.Path, 375p2, VersionStamp.Create(), "p2", "p2", LanguageNames.CSharp, 445.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 768.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 910.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 919.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 961.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 970.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1002.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1011.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1045.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1054.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1097.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1106.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1150.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1159.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1203.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1212.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1248.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1257.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1293.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1302.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1336.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1345.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1542.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp))
Services\SolutionServiceTests.cs (5)
87ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 116ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 326loader: TextLoader.From(TextAndVersion.Create(SourceText.From("test"), VersionStamp.Create()))); 358loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create(), filePath: configPath)), 390loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A { }"), VersionStamp.Create())));
Text.Analyzers (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion; 145var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 178VersionStamp topLevelSemanticVersion,