6 instantiations of VersionStamp
Microsoft.CodeAnalysis.Workspaces (5)
Workspace\Solution\VersionStamp.cs (5)
69=> new(DateTime.UtcNow); 75=> new(utcTimeLastModified); 112return new VersionStamp(_utcLastModified, (thisGlobalVersion > thatGlobalVersion) ? thisGlobalVersion : thatGlobalVersion, GlobalVersionMarker); 130return new VersionStamp(now, incr); 208return new VersionStamp(DateTime.FromBinary(raw), localIncrement, globalIncrement);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PersistentStorage\AbstractPersistentStorageTests.cs (1)
848workspace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), new VersionStamp(), @"D:\git\PCLCrypto\PCLCrypto.sln"));
576 references to VersionStamp
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (18)
CodeActions\Preview\PreviewTests.cs (1)
85solution = solution.AddProject(ProjectInfo.Create(s_addedProjectId, VersionStamp.Create(), AddedProjectName, AddedProjectName, LanguageNames.CSharp));
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
46AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj", "proj", LanguageNames.CSharp)).GetProject(projectId). 464AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj", "proj", LanguageNames.CSharp)).GetProject(projectId).
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)
62loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "file.razor.g.cs")),
Workspaces\WorkspaceTests_EditorFeatures.cs (13)
553var newVersion = await cs.GetProject(project1.Id).GetDependentSemanticVersionAsync(); 554var newVersionX = await doc1Z.Project.GetDependentSemanticVersionAsync(); 555Assert.NotEqual(VersionStamp.Default, newVersion); 1047var oldVersion = await project.GetSemanticVersionAsync(); 1080var oldVersion = await project.GetSemanticVersionAsync(); 1370Assert.Throws<ArgumentException>(() => VersionStamp.Create(DateTime.Now)); 1376var version1 = VersionStamp.Create(default); 1377var version2 = VersionStamp.Create(default); 1379var version3 = version1.GetNewerVersion(version2); 1382var version4 = version1.GetNewerVersion(); 1383var version5 = version4.GetNewerVersion(version3);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\AddAttributesTests.cs (1)
27VersionStamp.Default,
CodeGeneration\AddImportsTests.cs (2)
34VersionStamp.Default, 778VersionStamp.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 (7)
Classification\Semantic\ClassificationUtilities.cs (3)
107var lastSemanticVersion = (VersionStamp?)context.State; 110var currentSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 173var version = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false);
Interactive\InteractiveSession.cs (1)
295version: VersionStamp.Create(),
Shared\Preview\PreviewWorkspace.cs (3)
83var version = document.GetTextVersionSynchronously(CancellationToken.None); 92var version = document.GetTextVersionSynchronously(CancellationToken.None); 101var version = document.GetTextVersionSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (15)
EditAndContinue\EditAndContinueTestHelpers.cs (1)
388version: VersionStamp.Create(),
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
402var version = VersionStamp.Create();
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)),
Workspaces\TestHostDocument.cs (1)
217=> Task.FromResult(TextAndVersion.Create(SourceText.From(_text, encoding: null, options.ChecksumAlgorithm), VersionStamp.Create(), _hostDocument.FilePath));
Workspaces\TestHostProject.cs (4)
32private readonly VersionStamp _version; 114public VersionStamp Version 197_version = VersionStamp.Create(); 250_version = VersionStamp.Create();
Workspaces\TestHostSolution.cs (2)
18public readonly VersionStamp Version; 34this.Version = VersionStamp.Create();
Workspaces\TestWorkspace.cs (1)
85SetCurrentSolutionEx(CreateSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()).WithTelemetryId(solutionTelemetryId)));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (35)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (11)
180VersionStamp.Create(), 294VersionStamp.Create(), 355VersionStamp.Create(), 365loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create(), filePath)), 436VersionStamp.Create(), 480VersionStamp.Create(), 488loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 577VersionStamp.Create(), 586loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 632var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "CSharpProject", "CSharpProject", LanguageNames.CSharp); 1194VersionStamp.Create(),
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
48AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj", "proj", LanguageNames.CSharp, filePath: projectFilePath)). 120AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj", "proj", LanguageNames.CSharp)).
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (5)
125AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj", "proj", LanguageNames.CSharp, parseOptions: CSharpParseOptions.Default.WithNoRefSafetyRulesAttribute()).WithTelemetryId(s_defaultProjectTelemetryId)).GetProject(projectId). 401loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), path)), 756loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "design-time-only.cs")), 3718loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), filePath)), 4558AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "P", "P", LanguageNames.CSharp, parseOptions: CSharpParseOptions.Default.WithNoRefSafetyRulesAttribute())).GetProject(projectId).
SolutionCrawler\WorkCoordinatorTests.cs (16)
95var solutionInfo = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), 98ProjectInfo.Create(projectId, VersionStamp.Create(), "P1", "P1", LanguageNames.CSharp, 220projectId, VersionStamp.Create(), "P3", "P3", LanguageNames.CSharp, 1435var solution = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), 1438ProjectInfo.Create(projectId1, VersionStamp.Create(), "P1", "P1", LanguageNames.CSharp, 1440ProjectInfo.Create(projectId2, VersionStamp.Create(), "P2", "P2", LanguageNames.CSharp, 1442ProjectInfo.Create(projectId3, VersionStamp.Create(), "P3", "P3", LanguageNames.CSharp, 1621var solution = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), 1624ProjectInfo.Create(projectId1, VersionStamp.Create(), "P1", "P1", LanguageNames.CSharp, 1626ProjectInfo.Create(projectId2, VersionStamp.Create(), "P2", "P2", LanguageNames.CSharp, 1629ProjectInfo.Create(projectId3, VersionStamp.Create(), "P3", "P3", LanguageNames.CSharp, 1632ProjectInfo.Create(projectId4, VersionStamp.Create(), "P4", "P4", LanguageNames.CSharp, 1634ProjectInfo.Create(projectId5, VersionStamp.Create(), "P5", "P5", LanguageNames.CSharp, 1647return SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), 1650ProjectInfo.Create(projectId1, VersionStamp.Create(), "P1", "P1", LanguageNames.CSharp, 1652ProjectInfo.Create(projectId2, VersionStamp.Create(), "P2", "P2", LanguageNames.CSharp,
SymbolFinder\DependentTypeFinderTests.cs (1)
34VersionStamp.Default,
Microsoft.CodeAnalysis.Features (25)
CodeLens\CodeLensReferencesService.cs (2)
85public async ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken) 92var 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)
45private readonly ConcurrentDictionary<DocumentId, (string? category, VersionStamp projectVersion)> _documentToLastReportedInformation = new(); 148AsyncLazy<VersionStamp> lazyProjectVersion, 169private async Task<ImmutableArray<(DesignerAttributeData data, VersionStamp version)>> ComputeChangedDataAsync( 172AsyncLazy<VersionStamp> lazyProjectVersion, 182using var _ = ArrayBuilder<(DesignerAttributeData data, VersionStamp version)>.GetInstance(out var results); 196var projectVersion = await lazyProjectVersion.GetValueAsync(cancellationToken).ConfigureAwait(false);
Diagnostics\DiagnosticAnalyzerExtensions.cs (4)
37public static (string analyzerId, VersionStamp version) GetAnalyzerIdAndVersion(this DiagnosticAnalyzer analyzer) 45private static VersionStamp GetAnalyzerVersion(string path) 49return VersionStamp.Default; 52return VersionStamp.Create(File.GetLastWriteTimeUtc(path));
EditAndContinue\CommittedSolution.cs (1)
225var sourceTextVersion = (committedDocument == null) ? await document.GetTextVersionAsync(cancellationToken).ConfigureAwait(false) : default;
ExternalAccess\UnitTesting\SolutionCrawler\AbstractUnitTestingDocumentDifferenceService.cs (2)
36if (oldDocument.TryGetSyntaxVersion(out var oldVersion) && 37newDocument.TryGetSyntaxVersion(out var newVersion) &&
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (2)
80loader: TextLoader.From(assemblyInfoSourceText.Container, VersionStamp.Default), 97version: VersionStamp.Default,
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (1)
206var textAndVersion = TextAndVersion.Create(sourceText, VersionStamp.Default, filePath);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
298version: VersionStamp.Default,
SolutionCrawler\AbstractDocumentDifferenceService.cs (4)
37if (oldDocument.TryGetSyntaxVersion(out var oldVersion) && 38newDocument.TryGetSyntaxVersion(out var newVersion) && 73if (!oldDocument.TryGetTopLevelChangeTextVersion(out var oldTopLevelChangeVersion) || 74!newDocument.TryGetTopLevelChangeTextVersion(out var newTopLevelChangeVersion))
Workspace\MiscellaneousFileUtilities.cs (1)
63version: VersionStamp.Create(),
Microsoft.CodeAnalysis.LanguageServer.Protocol (74)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ActiveFileState.cs (2)
45_syntax = new DocumentAnalysisData(VersionStamp.Default, _syntax.Items); 46_semantic = new DocumentAnalysisData(VersionStamp.Default, _semantic.Items);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (11)
23public static readonly DocumentAnalysisData Empty = new(VersionStamp.Default, ImmutableArray<DiagnosticData>.Empty); 28public readonly VersionStamp Version; 40public DocumentAnalysisData(VersionStamp version, ImmutableArray<DiagnosticData> items) 49public DocumentAnalysisData(VersionStamp version, ImmutableArray<DiagnosticData> oldItems, ImmutableArray<DiagnosticData> newItems) 78public readonly VersionStamp Version; 90public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 101VersionStamp version, 117VersionStamp? version = null; 130else if (version.Value != VersionStamp.Default && version.Value != result.Version) 135version = VersionStamp.Default; 144return new ProjectAnalysisData(project.Id, VersionStamp.Default, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (2)
224public static Task<VersionStamp> GetDiagnosticVersionAsync(Project project, CancellationToken cancellationToken) 227private static DiagnosticAnalysisResult GetResultOrEmpty(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> map, DiagnosticAnalyzer analyzer, ProjectId projectId, VersionStamp version)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (9)
34AnalysisKind kind, VersionStamp version, 152var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); 178var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 230return new ProjectAnalysisData(project.Id, VersionStamp.Default, existingData.Result, results); 352var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 385VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 407CompilationWithAnalyzers compilationWithAnalyzers, VersionStamp version, 449var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 503VersionStamp version,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (2)
49VersionStamp version, 76var oldDocumentVersion = await GetDiagnosticVersionAsync(oldDocument.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer_MemberSpans.cs (4)
22private readonly record struct MemberSpans(DocumentId DocumentId, VersionStamp Version, ImmutableArray<TextSpan> Spans); 27private async Task<ImmutableArray<TextSpan>> GetOrCreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 44static async Task<ImmutableArray<TextSpan>> CreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 53private void SaveMemberSpans(DocumentId documentId, VersionStamp version, ImmutableArray<TextSpan> memberSpans)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InMemoryStorage.cs (2)
73public readonly VersionStamp Version; 76public CacheEntry(VersionStamp version, ImmutableArray<DiagnosticData> diagnostics)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (2)
96var version = await DiagnosticIncrementalAnalyzer.GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 201var version = await DiagnosticIncrementalAnalyzer.GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (28)
67var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 80var serializerVersion = lastResult.Version; 93Debug.Assert(lastResult.Version == VersionStamp.Default); 124var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); 137var serializerVersion = lastResult.Version; 142Debug.Assert(lastResult.Version == VersionStamp.Default); 165var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 178var serializerVersion = lastResult.Version; 201var serializerVersion = result.Version; 265syntax.Version != VersionStamp.Default && 274var version = VersionStamp.Default; 277var serializerVersion = version; 302var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 303var serializerVersion = version; 315return DiagnosticAnalysisResult.CreateEmpty(project.Id, VersionStamp.Default); 325var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 326var serializerVersion = version; 331return DiagnosticAnalysisResult.CreateEmpty(project.Id, VersionStamp.Default); 340var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 341var serializerVersion = version; 345return DiagnosticAnalysisResult.CreateEmpty(project.Id, VersionStamp.Default); 350private ValueTask AddToInMemoryStorageAsync(VersionStamp serializerVersion, Project project, TextDocument? document, object key, string stateKey, ImmutableArray<DiagnosticData> diagnostics) 359private async ValueTask<bool> TryGetDiagnosticsFromInMemoryStorageAsync(VersionStamp serializerVersion, TextDocument document, Builder builder, CancellationToken cancellationToken) 398private async ValueTask<bool> TryGetProjectDiagnosticsFromInMemoryStorageAsync(VersionStamp serializerVersion, Project project, Builder builder, CancellationToken cancellationToken) 411VersionStamp serializerVersion, Project project, TextDocument? document, object key, string stateKey, CancellationToken _) 449private readonly VersionStamp _version; 457public Builder(Project project, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds = null)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_BuildSynchronization.cs (1)
59var result = GetResultOrEmpty(newResult, stateSet.Analyzer, project.Id, VersionStamp.Default);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (2)
294var version = await GetDiagnosticVersionAsync(_document.Project, cancellationToken).ConfigureAwait(false); 328var version = await GetDiagnosticVersionAsync(_document.Project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (3)
54var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); 469var oldAnalysisResult = GetResultOrEmpty(oldResult, analyzer, project.Id, VersionStamp.Default); 470var newAnalysisResult = GetResultOrEmpty(newResult, analyzer, project.Id, VersionStamp.Default);
Handler\CodeLens\CodeLensCache.cs (1)
32internal record CodeLensCacheEntry(ImmutableArray<CodeLensMember> CodeLensMembers, TextDocumentIdentifier TextDocumentIdentifier, VersionStamp SyntaxVersion);
Handler\CodeLens\CodeLensHandler.cs (1)
46var syntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
Handler\CodeLens\CodeLensResolveHandler.cs (2)
43var currentSyntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false); 44var cachedSyntaxVersion = cacheEntry.SyntaxVersion;
Handler\Diagnostics\AbstractPullDiagnosticHandler.cs (1)
65private readonly ConcurrentDictionary<string, VersionedPullCache<(int, VersionStamp?), (int, Checksum)>> _categoryToVersionedCache = new();
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
113=> Task.FromResult(TextAndVersion.Create(_sourceText, VersionStamp.Create(), _fileUri));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (3)
Diagnostics\PullDiagnosticTests.cs (1)
1214document.Id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspaces\LspWorkspaceManagerTests.cs (2)
65var firstDocumentInitialVersion = await firstDocument.GetSyntaxVersionAsync(CancellationToken.None); 66var secondDocumentInitialVersion = await secondDocument.GetSyntaxVersionAsync(CancellationToken.None);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (1)
CompilerInvocation.cs (1)
81version: VersionStamp.Default,
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
181_project, VersionStamp.Default, compilationWithAnalyzers.Compilation,
Microsoft.CodeAnalysis.Remote.Workspaces (1)
AbstractAssetProvider.cs (1)
92var textLoader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), attributes.FilePath));
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (2)
CodeActions\Preview\PreviewTests.vb (1)
59solution = solution.AddProject(ProjectInfo.Create(s_addedProjectId, VersionStamp.Create(), s_addedProjectName, s_addedProjectName, LanguageNames.CSharp))
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
35AddProject(ProjectInfo.Create(pid, VersionStamp.Create(), "proj", "proj", LanguageNames.VisualBasic)).GetProject(pid).
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.vb (1)
35VersionStamp.Default,
Microsoft.CodeAnalysis.Workspaces (214)
Diagnostics\DiagnosticAnalysisResult.cs (10)
25public readonly VersionStamp Version; 53private DiagnosticAnalysisResult(ProjectId projectId, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds, bool isEmpty, bool fromBuild) 69VersionStamp version, 95public static DiagnosticAnalysisResult CreateEmpty(ProjectId projectId, VersionStamp version) 112version: VersionStamp.Default, 122var version = VersionStamp.Default; 159VersionStamp version, 274public DiagnosticAnalysisResult UpdateAggregatedResult(VersionStamp version, DocumentId documentId, bool fromBuild) 278=> new(ProjectId, VersionStamp.Default, DocumentIds, IsEmpty, FromBuild);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (2)
23public readonly VersionStamp Version; 33public DiagnosticAnalysisResultBuilder(Project project, VersionStamp version)
Diagnostics\Extensions.cs (1)
89VersionStamp version,
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
29private readonly ConcurrentDictionary<ProjectId, (VersionStamp semanticVersion, SymbolTreeInfo info)> _projectIdToInfo = new(); 165var semanticVersion = await project.GetSemanticVersionAsync(cancellationToken).ConfigureAwait(false);
SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (4)
38public readonly VersionStamp TopLevelSemanticVersion; 40public SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 144var topLevelSemanticVersion = await document.Project.GetDependentSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 177VersionStamp topLevelSemanticVersion,
Workspace\AdhocWorkspace.cs (5)
70var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 131var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())); 173var version = doc.GetTextVersionSynchronously(CancellationToken.None); 201var version = doc.GetTextVersionSynchronously(CancellationToken.None); 229var version = doc.GetTextVersionSynchronously(CancellationToken.None);
Workspace\CommandLineProject.cs (1)
177version: VersionStamp.Create(),
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
610=> Task.FromResult(TextAndVersion.Create(_textContainer.CurrentText, VersionStamp.Create(), _filePath));
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (5)
96var versionStamp = creationInfo.FilePath != null ? VersionStamp.Create(File.GetLastWriteTimeUtc(creationInfo.FilePath)) 97: VersionStamp.Create(); 122VersionStamp.Create(), 316VersionStamp.Create(),
Workspace\Solution\Document.cs (7)
103public bool TryGetSyntaxVersion(out VersionStamp version) 106if (!this.TryGetTextVersion(out var textVersion)) 111var projectVersion = this.Project.Version; 119internal bool TryGetTopLevelChangeTextVersion(out VersionStamp version) 125public async Task<VersionStamp> GetSyntaxVersionAsync(CancellationToken cancellationToken = default) 127var textVersion = await this.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 128var projectVersion = this.Project.Version;
Workspace\Solution\DocumentState.cs (13)
237private static TreeAndVersion MakeNewTreeAndVersion(SyntaxTree oldTree, SourceText oldText, VersionStamp oldVersion, SyntaxTree newTree, SourceText newText, VersionStamp newVersion) 240var version = topLevelChanged ? newVersion : oldVersion; 498var newTextVersion = GetNewerVersion(); 499var newTreeVersion = GetNewTreeVersionForUpdatedTree(newRoot, newTextVersion, mode); 536VersionStamp textVersion, 537VersionStamp treeVersion, 558private VersionStamp GetNewTreeVersionForUpdatedTree(SyntaxNode newRoot, VersionStamp newTextVersion, PreservationMode mode) 585private VersionStamp GetNewerVersion() 597return VersionStamp.Create(); 638public bool TryGetTopLevelChangeTextVersion(out VersionStamp version) 652public override async Task<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
88VersionStamp siblingVersion,
Workspace\Solution\DocumentState_TreeTextSource.cs (3)
21private readonly VersionStamp _version; 26public TreeTextSource(ValueSource<SourceText> textSource, VersionStamp version) 58public bool TryGetTextVersion(LoadTextOptions options, out VersionStamp version)
Workspace\Solution\FileTextLoader.cs (4)
176var version = VersionStamp.Create(prevLastWriteTime); 215var version = VersionStamp.Create(prevLastWriteTime);
Workspace\Solution\ITextVersionable.cs (1)
11bool TryGetTextVersion(LoadTextOptions options, out VersionStamp version);
Workspace\Solution\Project.cs (5)
500public VersionStamp Version => _projectState.Version; 505public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken = default) 511public Task<VersionStamp> GetDependentVersionAsync(CancellationToken cancellationToken = default) 518public Task<VersionStamp> GetDependentSemanticVersionAsync(CancellationToken cancellationToken = default) 525public Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default)
Workspace\Solution\ProjectInfo.cs (9)
35public VersionStamp Version => Attributes.Version; 185VersionStamp version, 213VersionStamp version, 333public ProjectInfo WithVersion(VersionStamp version) 417public VersionStamp Version { get; } 511VersionStamp version, 545VersionStamp? version = null, 560var newVersion = version ?? Version; 659VersionStamp.Create(),
Workspace\Solution\ProjectState.cs (37)
50private readonly AsyncLazy<VersionStamp> _lazyLatestDocumentVersion; 51private readonly AsyncLazy<VersionStamp> _lazyLatestDocumentTopLevelChangeVersion; 74AsyncLazy<VersionStamp> lazyLatestDocumentVersion, 75AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion, 122_lazyLatestDocumentVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentVersionAsync(DocumentStates, AdditionalDocumentStates, c), cacheResult: true); 123_lazyLatestDocumentTopLevelChangeVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(DocumentStates, AdditionalDocumentStates, c), cacheResult: true); 165private static async Task<VersionStamp> ComputeLatestDocumentVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 168var latestVersion = VersionStamp.Default; 175var version = await state.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 184var version = await state.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 191private AsyncLazy<VersionStamp> CreateLazyLatestDocumentTopLevelChangeVersion( 196if (_lazyLatestDocumentTopLevelChangeVersion.TryGetValue(out var oldVersion)) 198return new AsyncLazy<VersionStamp>(c => ComputeTopLevelChangeTextVersionAsync(oldVersion, newDocument, c), cacheResult: true); 202return new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(newDocumentStates, newAdditionalDocumentStates, c), cacheResult: true); 206private static async Task<VersionStamp> ComputeTopLevelChangeTextVersionAsync(VersionStamp oldVersion, TextDocumentState newDocument, CancellationToken cancellationToken) 208var newVersion = await newDocument.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false); 212private static async Task<VersionStamp> ComputeLatestDocumentTopLevelChangeVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 215var latestVersion = VersionStamp.Default; 220var version = await state.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false); 228var version = await state.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false); 516public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken) 519public async Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default) 521var docVersion = await _lazyLatestDocumentTopLevelChangeVersion.GetValueAsync(cancellationToken).ConfigureAwait(false); 572public VersionStamp Version => this.ProjectInfo.Version; 606AsyncLazy<VersionStamp>? latestDocumentVersion = null, 607AsyncLazy<VersionStamp>? latestDocumentTopLevelChangeVersion = null, 934out AsyncLazy<VersionStamp> dependentDocumentVersion, out AsyncLazy<VersionStamp> dependentSemanticVersion) 941if (oldDocument.TryGetTextVersion(out var oldVersion)) 943if (!_lazyLatestDocumentVersion.TryGetValue(out var documentVersion) || documentVersion == oldVersion) 948if (!_lazyLatestDocumentTopLevelChangeVersion.TryGetValue(out var semanticVersion) || semanticVersion == oldVersion) 956? new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentVersionAsync(newDocumentStates, newAdditionalDocumentStates, c), cacheResult: true) 958? new AsyncLazy<VersionStamp>(newDocument.GetTextVersionAsync, cacheResult: true) 962? new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(newDocumentStates, newAdditionalDocumentStates, c), cacheResult: true)
Workspace\Solution\RecoverableTextAndVersion.cs (3)
75public bool TryGetTextVersion(LoadTextOptions options, out VersionStamp version) 145public readonly VersionStamp Version; 206public bool TryGetTextVersion(LoadTextOptions options, out VersionStamp version)
Workspace\Solution\Solution.cs (6)
89public VersionStamp Version => _state.Version; 104public VersionStamp GetLatestProjectVersion() => _state.GetLatestProjectVersion(); 322=> this.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), name, assemblyName, language)); 1057loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 1186var version = VersionStamp.Create();
Workspace\Solution\SolutionInfo.cs (8)
32public VersionStamp Version => Attributes.Version; 63VersionStamp version, 75VersionStamp version, 109public VersionStamp Version { get; } 121public SolutionAttributes(SolutionId id, VersionStamp version, string? filePath, Guid telemetryId) 130VersionStamp? version = null, 134var newVersion = version ?? Version; 169return new SolutionAttributes(solutionId, VersionStamp.Create(), filePath, telemetryId);
Workspace\Solution\SolutionState.CompilationTracker.cs (14)
1130private AsyncLazy<VersionStamp>? _lazyDependentVersion; 1131private AsyncLazy<VersionStamp>? _lazyDependentSemanticVersion; 1134public Task<VersionStamp> GetDependentVersionAsync(SolutionState solution, CancellationToken cancellationToken) 1140Interlocked.CompareExchange(ref _lazyDependentVersion, new AsyncLazy<VersionStamp>(c => ComputeDependentVersionAsync(tmp, c), cacheResult: true), null); 1146private async Task<VersionStamp> ComputeDependentVersionAsync(SolutionState solution, CancellationToken cancellationToken) 1149var projVersion = projectState.Version; 1150var docVersion = await projectState.GetLatestDocumentVersionAsync(cancellationToken).ConfigureAwait(false); 1152var version = docVersion.GetNewerVersion(projVersion); 1159var dependentProjectVersion = await solution.GetDependentVersionAsync(dependentProjectReference.ProjectId, cancellationToken).ConfigureAwait(false); 1167public Task<VersionStamp> GetDependentSemanticVersionAsync(SolutionState solution, CancellationToken cancellationToken) 1173Interlocked.CompareExchange(ref _lazyDependentSemanticVersion, new AsyncLazy<VersionStamp>(c => ComputeDependentSemanticVersionAsync(tmp, c), cacheResult: true), null); 1179private async Task<VersionStamp> ComputeDependentSemanticVersionAsync(SolutionState solution, CancellationToken cancellationToken) 1182var version = await projectState.GetSemanticVersionAsync(cancellationToken).ConfigureAwait(false); 1190var dependentProjectVersion = await solution.GetDependentSemanticVersionAsync(dependentProjectReference.ProjectId, cancellationToken).ConfigureAwait(false);
Workspace\Solution\SolutionState.cs (6)
164public VersionStamp Version => _solutionAttributes.Version; 280public VersionStamp GetLatestProjectVersion() 283var latestVersion = VersionStamp.Default; 381public Task<VersionStamp> GetDependentVersionAsync(ProjectId projectId, CancellationToken cancellationToken) 384public Task<VersionStamp> GetDependentSemanticVersionAsync(ProjectId projectId, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.GeneratedFileReplacingCompilationTracker.cs (2)
113public Task<VersionStamp> GetDependentVersionAsync(SolutionState solution, CancellationToken cancellationToken) 116public Task<VersionStamp> GetDependentSemanticVersionAsync(SolutionState solution, CancellationToken cancellationToken)
Workspace\Solution\SolutionState.ICompilationTracker.cs (2)
41Task<VersionStamp> GetDependentVersionAsync(SolutionState solution, CancellationToken cancellationToken); 42Task<VersionStamp> GetDependentSemanticVersionAsync(SolutionState solution, CancellationToken cancellationToken);
Workspace\Solution\SolutionState.SkeletonReferenceCache.cs (6)
39/// cref="VersionStamp"/> for a project. As long as the <see cref="Project.GetDependentSemanticVersionAsync"/> for 90private VersionStamp? _version; 103VersionStamp? version, 137var version = await compilationTracker.GetDependentSemanticVersionAsync(solution, cancellationToken).ConfigureAwait(false); 149VersionStamp version, 216private bool TryReadSkeletonReferenceSetAtThisVersion(VersionStamp version, out SkeletonReferenceSet? result)
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
24var textAndVersion = TextAndVersion.Create(generatedSourceText, VersionStamp.Create());
Workspace\Solution\TextAndVersion.cs (4)
23public VersionStamp Version { get; } 36private TextAndVersion(SourceText text, VersionStamp version, string? filePath, Diagnostic? loadDiagnostic) 54public static TextAndVersion Create(SourceText text, VersionStamp version, string? filePath = null) 64internal static TextAndVersion Create(SourceText text, VersionStamp version, Diagnostic? loadDiagnostic)
Workspace\Solution\TextDocument.cs (4)
70public bool TryGetTextVersion(out VersionStamp version) 90public Task<VersionStamp> GetTextVersionAsync(CancellationToken cancellationToken = default) 98internal VersionStamp GetTextVersionSynchronously(CancellationToken cancellationToken) 104internal Task<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken = default)
Workspace\Solution\TextDocumentState.cs (9)
64: CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, encoding: null, loadTextOptions.ChecksumAlgorithm), VersionStamp.Default, info.FilePath)), 115public bool TryGetTextVersion(out VersionStamp version) 158public VersionStamp GetTextVersionSynchronously(CancellationToken cancellationToken) 164public async Task<VersionStamp> GetTextVersionAsync(CancellationToken cancellationToken) 167if (TryGetTextVersion(out var version)) 187var newVersion = GetNewerVersion(); 228private VersionStamp GetNewerVersion() 235return VersionStamp.Create(); 238public virtual async Task<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken)
Workspace\Solution\TextLoader.cs (4)
171VersionStamp.Default, 194public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null) 221private readonly VersionStamp _version; 224internal TextContainerLoader(SourceTextContainer container, VersionStamp version, string? filePath)
Workspace\Solution\TreeAndVersion.cs (2)
23public VersionStamp Version { get; } 25public TreeAndVersion(SyntaxTree tree, VersionStamp version)
Workspace\Solution\VersionStamp.cs (21)
15public readonly struct VersionStamp : IEquatable<VersionStamp>, IObjectWritable 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) 174internal static bool CanReusePersistedVersion(VersionStamp baseVersion, VersionStamp persistedVersion) 202internal static VersionStamp ReadFrom(ObjectReader reader) 211private static int GetGlobalVersion(VersionStamp version) 227var globalVersion = Interlocked.Increment(ref VersionStamp.s_globalVersion); 237private readonly VersionStamp _versionStamp; 239public TestAccessor(in VersionStamp versionStamp) 245internal bool IsNewerThan(in VersionStamp version)
Workspace\Workspace.cs (8)
85var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()); 129=> CreateSolution(SolutionInfo.Create(id, VersionStamp.Create())); 1758project.State.Attributes.With(version: VersionStamp.Create()), 1771=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 1938this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 1982this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2015this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2037this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (3)
374oldDocument.TryGetTextVersion(out var version)) 462private static TextAndVersion GetProperTextAndVersion(SourceText oldText, SourceText newText, VersionStamp version, string? filePath) 546var version = oldDocument.GetTextVersionSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildProjectLoader.Worker.cs (3)
291var version = projectPath is null 292? VersionStamp.Default 293: VersionStamp.Create(FileUtilities.GetFileTimeStamp(projectPath));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
VisualStudioMSBuildWorkspaceTests.cs (8)
374var sversion = solution.Version; 375var latestPV = solution.GetLatestProjectVersion(); 377var pversion = project.Version; 379var dversion = await document.GetTextVersionAsync(); 380var latestDV = await project.GetLatestDocumentVersionAsync(); 385var dversion1 = await document1.GetTextVersionAsync(); 390var latestDV1 = await document1.Project.GetLatestDocumentVersionAsync(); 398var dversion2 = await document2.GetTextVersionAsync();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
SolutionUtilities.cs (1)
111VersionStamp.Default,
TestTextLoader.cs (1)
20_textAndVersion = TextAndVersion.Create(SourceText.From(text, encoding: null, checksumAlgorithm), VersionStamp.Create());
Microsoft.CodeAnalysis.Workspaces.UnitTests (131)
FindReferencesTests.cs (1)
33VersionStamp.Default,
LinkedFileDiffMerging\LinkedFileDiffMergingTests.cs (1)
30var projectInfo = ProjectInfo.Create(projectId, VersionStamp.Create(), "ProjectName" + i, "AssemblyName" + i, languageName);
SerializationTests.cs (4)
49var versionStamp = VersionStamp.Create(); 60var deserializedVersionStamp = VersionStamp.ReadFrom(reader);
SolutionTests\ProjectDependencyGraphTests.cs (2)
248var projectAInfo = ProjectInfo.Create(projectAId, VersionStamp.Create(), "A", "A", LanguageNames.CSharp, 716return solution.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), projectName, projectName, LanguageNames.CSharp, projectName));
SolutionTests\ProjectInfoTests.cs (28)
23Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(id: null, version: VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#")); 24Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: null, assemblyName: "Bar", language: "C#")); 25Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: null, language: "C#")); 26Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: null)); 28Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 39() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", documents: new[] { documentInfo, documentInfo })); 41Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 45() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", additionalDocuments: new[] { documentInfo, documentInfo })); 47Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 52() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", projectReferences: new[] { projectReference, projectReference })); 54Assert.Throws<ArgumentNullException>("analyzerReferences[0]", () => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 59() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", analyzerReferences: new[] { analyzerReference, analyzerReference })); 61Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 66() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", metadataReferences: new[] { metadataReference, metadataReference })); 72var version = VersionStamp.Default; 91var version = VersionStamp.Default; 110var version = VersionStamp.Default; 129var version = VersionStamp.Default; 148var version = VersionStamp.Default; 167var projectInfo = ProjectInfo.Create(name: "Goo", filePath: @"C:\", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 174var projectInfo = ProjectInfo.Create(name: "Goo", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 183var instance = ProjectInfo.Create(name: "Name", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "AssemblyName", language: "C#"); 185SolutionTestHelpers.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 (51)
350var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 354Assert.True(newSolution1.GetDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 415var version1 = await document1.GetTextVersionAsync(); 416var version2 = await document2.GetTextVersionAsync(); 428var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 503var version1 = await document1.GetTextVersionAsync(); 504var version2 = await document2.GetTextVersionAsync(); 516var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 582var version1 = await document1.GetTextVersionAsync(); 583var version2 = await document2.GetTextVersionAsync(); 599var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 668var version1 = await document1.GetTextVersionAsync(); 669var version2 = await document2.GetTextVersionAsync(); 682var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 745var version1 = await document1.GetTextVersionAsync(); 746var version2 = await document2.GetTextVersionAsync(); 758var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 830var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 834Assert.True(newSolution1.GetAdditionalDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 876var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 880Assert.True(newSolution1.GetAnalyzerConfigDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 1481.AddProject(ProjectInfo.Create(submissionId1, VersionStamp.Default, name: "submission1", assemblyName: "submission1.dll", LanguageNames.CSharp, isSubmission: true)) 1482.AddProject(ProjectInfo.Create(submissionId2, VersionStamp.Default, name: "submission2", assemblyName: "submission2.dll", LanguageNames.CSharp, isSubmission: true)) 1483.AddProject(ProjectInfo.Create(submissionId3, VersionStamp.Default, name: "submission3", assemblyName: "submission3.dll", LanguageNames.CSharp, isSubmission: true)) 3380VersionStamp.Create(), 3388VersionStamp.Create(), 3408VersionStamp.Create(), 3418VersionStamp.Create(), 3553VersionStamp.Create(), 3562VersionStamp.Create(), 3812VersionStamp GetVersion() => solution.GetProject(pid).Version; 3841var oldVersion = GetVersion(); 3845var newVersion = GetVersion(); 3870var newSameVersion = GetVersion(); 3935loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 3969loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4011loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4023TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA6789.severity = error"), VersionStamp.Default)), 4059loader: TextLoader.From(TextAndVersion.Create(SourceText.From("is_global = true\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4105loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ngenerated_code = true"), VersionStamp.Default))))); 4171ProjectInfo.Create(projectId, VersionStamp.Default, "Test", "Test", LanguageNames.CSharp) 4196VersionStamp.Create(), 4205VersionStamp.Create(), 4214VersionStamp.Create(), 4224VersionStamp.Create(), 4234VersionStamp.Create(), 4244VersionStamp.Create(), 4293var version = VersionStamp.Create(); 4297version: VersionStamp.Default, 4378VersionStamp.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)
39OnProjectAdded(ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Default, "TestProject", "TestProject", LanguageNames.CSharp));
WorkspaceTests\AdhocWorkspaceTests.cs (25)
33version: VersionStamp.Default, 88version: VersionStamp.Default, 93var sinfo = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Default, projects: new ProjectInfo[] { pinfo }); 115version: VersionStamp.Default, 123version: VersionStamp.Default, 158loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create()))); 162VersionStamp.Create(), 193version: VersionStamp.Default, 217var version = VersionStamp.Create(); 221version: VersionStamp.Default, 236Assert.True(doc.TryGetTextVersion(out var currentVersion)); 251var version = VersionStamp.Create(); 255version: VersionStamp.Default, 270Assert.True(doc.TryGetTextVersion(out var currentVersion)); 285var version = VersionStamp.Create(); 294version: VersionStamp.Default, 310Assert.True(doc.TryGetTextVersion(out var currentVersion)); 345var version = VersionStamp.Create(); 349version: VersionStamp.Default, 359Assert.False(doc.TryGetTextVersion(out var currentVersion)); 381var actualVersion = await newDoc.GetTextVersionAsync();
WorkspaceTests\WorkspaceReferenceTests.cs (8)
23VersionStamp.Create(), 52VersionStamp.Create(), 62VersionStamp.Create(), 92VersionStamp.Create(), 102VersionStamp.Create(), 132VersionStamp.Create(), 142VersionStamp.Create(), 176VersionStamp.Create(),
WorkspaceTests\WorkspaceTests.cs (2)
132var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 168var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()));
Microsoft.VisualStudio.LanguageServices (8)
CodeLens\CodeLensCallbackListener.cs (3)
71var projectVersion = await service.GetProjectCodeLensVersionAsync(solution, project.Id, cancellationToken).ConfigureAwait(false); 93var currentProjectVersion = await service.GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false); 122var projectVersion = await service.GetProjectCodeLensVersionAsync(solution, documentId.ProjectId, cancellationToken).ConfigureAwait(false);
CodeLens\RemoteCodeLensReferencesService.cs (1)
37public ValueTask<VersionStamp> GetProjectCodeLensVersionAsync(Solution solution, ProjectId projectId, CancellationToken cancellationToken)
ExternalAccess\VSTypeScript\Api\VSTypeScriptContainedLanguageWrapper.cs (1)
75workspace.OnProjectAdded(ProjectInfo.Create(projectId, VersionStamp.Default, filePath, string.Empty, InternalLanguageNames.TypeScript));
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (2)
115if (oldDocument.TryGetTextVersion(out var oldTextVersion) 116&& newDocument.TryGetTextVersion(out var newTextVersion)
Preview\PreviewUpdater.PreviewDialogWorkspace.cs (1)
57=> TextAndVersion.Create(_text, VersionStamp.Create());
Microsoft.VisualStudio.LanguageServices.CodeLens (1)
ReferenceCodeLensProvider.cs (1)
130var versionedPoints = _dataPoints.GetOrAdd(dataPoint.Descriptor.ProjectGuid, _ => (version: VersionStamp.Default.ToString(), dataPoints: new HashSet<DataPoint>()));
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (7)
EditorConfigSettings\DataProvider\DataProviderTests.cs (1)
30.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj1", "proj1.dll", LanguageNames.CSharp, filePath: projectFilePath))
PersistentStorage\AbstractPersistentStorageTests.cs (2)
985var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), solutionFile.Path); 993solution = solution.AddProject(ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "Project1", "Project1", LanguageNames.CSharp,
ProjectSystemShim\CPS\SourceFileHandlingTests.cs (4)
68VersionStamp GetVersion() => environment.Workspace.CurrentSolution.Projects.Single().Version; 89var oldVersion = GetVersion(); 93var newVersion = GetVersion(); 97var 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)
339VersionStamp.Create(),
Roslyn.VisualStudio.Next.UnitTests (10)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
51workspace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Default));
Remote\SnapshotSerializationTests.cs (1)
78loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())))));
Services\ServiceHubServicesTests.cs (3)
304SolutionId.CreateNewId(), VersionStamp.Create(), "", 308p1, VersionStamp.Create(), "p1", "p1", LanguageNames.CSharp, outputFilePath: file.Path, 311p2, VersionStamp.Create(), "p2", "p2", LanguageNames.CSharp,
Services\SolutionServiceTests.cs (5)
84ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 113ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 247loader: TextLoader.From(TextAndVersion.Create(SourceText.From("test"), VersionStamp.Create()))); 279loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create(), filePath: configPath)), 311loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A { }"), VersionStamp.Create())));