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)
841workspace.AddSolution(SolutionInfo.Create(SolutionId.CreateNewId(), new VersionStamp(), @"D:\git\PCLCrypto\PCLCrypto.sln"));
587 references to VersionStamp
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.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)
62loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "file.razor.g.cs")),
Workspaces\WorkspaceTests_EditorFeatures.cs (13)
578var newVersion = await cs.GetProject(project1.Id).GetDependentSemanticVersionAsync(); 579var newVersionX = await doc1Z.Project.GetDependentSemanticVersionAsync(); 580Assert.NotEqual(VersionStamp.Default, newVersion); 1110var oldVersion = await project.GetSemanticVersionAsync(); 1143var oldVersion = await project.GetSemanticVersionAsync(); 1441Assert.Throws<ArgumentException>(() => VersionStamp.Create(DateTime.Now)); 1447var version1 = VersionStamp.Create(default); 1448var version2 = VersionStamp.Create(default); 1450var version3 = version1.GetNewerVersion(version2); 1453var version4 = version1.GetNewerVersion(); 1454var version5 = version4.GetNewerVersion(version3);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
44AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj", "proj", LanguageNames.CSharp)).GetProject(projectId). 463AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), "proj", "proj", LanguageNames.CSharp)).GetProject(projectId).
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\AddAttributesTests.cs (1)
30VersionStamp.Default,
CodeGeneration\AddImportsTests.cs (2)
34VersionStamp.Default, 780VersionStamp.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 (4)
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (3)
145VersionStamp currentSemanticVersion, 157var (lastSemanticVersion, lastTextImageVersion) = ((VersionStamp, ITextImageVersion))context.State; 223VersionStamp currentSemanticVersion,
Interactive\InteractiveSession.cs (1)
308version: VersionStamp.Create(),
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
416var 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)),
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (8)
159VersionStamp.Create(), 260VersionStamp.Create(), 304VersionStamp.Create(), 312loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 382VersionStamp.Create(), 391loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 424var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), "CSharpProject", "CSharpProject", LanguageNames.CSharp); 886VersionStamp.Create(),
SymbolFinder\DependentTypeFinderTests.cs (1)
34VersionStamp.Default,
Microsoft.CodeAnalysis.Features (24)
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 (5)
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);
Diagnostics\DiagnosticAnalyzerExtensions.cs (4)
34public static (string analyzerId, VersionStamp version) GetAnalyzerIdAndVersion(this DiagnosticAnalyzer analyzer) 42private static VersionStamp GetAnalyzerVersion(string path) 46return VersionStamp.Default; 49return VersionStamp.Create(File.GetLastWriteTimeUtc(path));
EditAndContinue\CommittedSolution.cs (1)
224var 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)
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)
327version: 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.Features.Test.Utilities (3)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
439version: VersionStamp.Create(),
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
373loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), path)),
EditAndContinue\Extensions.cs (1)
89VersionStamp.Create(),
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\CompileTimeSolutionProviderTests.cs (2)
42AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj", "proj", LanguageNames.CSharp, filePath: projectFilePath)). 112.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj", "proj", LanguageNames.CSharp))
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
350loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "design-time-only.cs")),
Microsoft.CodeAnalysis.LanguageServer (4)
HostWorkspace\Razor\RazorDynamicFileInfoProvider.cs (1)
144return Task.FromResult(TextAndVersion.Create(SourceText.From(""), VersionStamp.Default));
HostWorkspace\Razor\RazorDynamicFileInfoProvider.TextChangesTextLoader.cs (3)
41return TextAndVersion.Create(text, VersionStamp.Default.GetNewerVersion()); 49var version = await _document.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 98return TextAndVersion.Create(text, VersionStamp.Default.GetNewerVersion());
Microsoft.CodeAnalysis.LanguageServer.Protocol (71)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ActiveFileState.cs (2)
45_syntax = new DocumentAnalysisData(VersionStamp.Default, _syntax.LineCount, _syntax.Items); 46_semantic = new DocumentAnalysisData(VersionStamp.Default, _semantic.LineCount, _semantic.Items);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (11)
22public static readonly DocumentAnalysisData Empty = new(VersionStamp.Default, lineCount: 0, []); 27public readonly VersionStamp Version; 44public DocumentAnalysisData(VersionStamp version, int lineCount, ImmutableArray<DiagnosticData> items) 54public DocumentAnalysisData(VersionStamp version, int lineCount, ImmutableArray<DiagnosticData> oldItems, ImmutableArray<DiagnosticData> newItems) 75public readonly VersionStamp Version; 87public ProjectAnalysisData(ProjectId projectId, VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 98VersionStamp version, 114VersionStamp? version = null; 127else if (version.Value != VersionStamp.Default && version.Value != result.Version) 132version = VersionStamp.Default; 141return new ProjectAnalysisData(project.Id, VersionStamp.Default, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult>.Empty);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (2)
69public static Task<VersionStamp> GetDiagnosticVersionAsync(Project project, CancellationToken cancellationToken) 72private static DiagnosticAnalysisResult GetResultOrEmpty(ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> map, DiagnosticAnalyzer analyzer, ProjectId projectId, VersionStamp version)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (6)
34var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 131var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 165VersionStamp version, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> existing, ImmutableDictionary<DiagnosticAnalyzer, DiagnosticAnalysisResult> result) 187CompilationWithAnalyzersPair compilationWithAnalyzers, VersionStamp version, 245var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 299VersionStamp version,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
49VersionStamp version,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer_MemberSpans.cs (4)
23private readonly record struct MemberSpans(DocumentId DocumentId, VersionStamp Version, ImmutableArray<TextSpan> Spans); 28private async Task<ImmutableArray<TextSpan>> GetOrCreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 45static async Task<ImmutableArray<TextSpan>> CreateMemberSpansAsync(Document document, VersionStamp version, CancellationToken cancellationToken) 57private void SaveMemberSpans(DocumentId documentId, VersionStamp version, ImmutableArray<TextSpan> memberSpans)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InMemoryStorage.cs (2)
68public readonly VersionStamp Version; 71public CacheEntry(VersionStamp version, ImmutableArray<DiagnosticData> diagnostics)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (2)
123var version = await DiagnosticIncrementalAnalyzer.GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 243var version = await DiagnosticIncrementalAnalyzer.GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (28)
72var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 85var serializerVersion = lastResult.Version; 98Debug.Assert(lastResult.Version == VersionStamp.Default); 129var version = await GetDiagnosticVersionAsync(document.Project, cancellationToken).ConfigureAwait(false); 142var serializerVersion = lastResult.Version; 147Debug.Assert(lastResult.Version == VersionStamp.Default); 170var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 183var serializerVersion = lastResult.Version; 210var serializerVersion = result.Version; 272syntax.Version != VersionStamp.Default && 281var version = VersionStamp.Default; 284var serializerVersion = version; 309var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 310var serializerVersion = version; 322return DiagnosticAnalysisResult.CreateEmpty(project.Id, VersionStamp.Default); 332var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 333var serializerVersion = version; 338return DiagnosticAnalysisResult.CreateEmpty(project.Id, VersionStamp.Default); 347var version = await GetDiagnosticVersionAsync(project, cancellationToken).ConfigureAwait(false); 348var serializerVersion = version; 352return DiagnosticAnalysisResult.CreateEmpty(project.Id, VersionStamp.Default); 358VersionStamp serializerVersion, Project project, TextDocument? document, object key, string stateKey, ImmutableArray<DiagnosticData> diagnostics) 366private async ValueTask<bool> TryGetDiagnosticsFromInMemoryStorageAsync(VersionStamp serializerVersion, TextDocument document, Builder builder, CancellationToken cancellationToken) 405private async ValueTask<bool> TryGetProjectDiagnosticsFromInMemoryStorageAsync(VersionStamp serializerVersion, Project project, Builder builder, CancellationToken cancellationToken) 418VersionStamp serializerVersion, Project project, TextDocument? document, object key, string stateKey, CancellationToken _) 456private readonly VersionStamp _version; 464public Builder(Project project, VersionStamp version, ImmutableHashSet<DocumentId>? documentIds = null)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (2)
333var version = await GetDiagnosticVersionAsync(_document.Project, cancellationToken).ConfigureAwait(false); 384var version = await GetDiagnosticVersionAsync(_document.Project, cancellationToken).ConfigureAwait(false);
Handler\CodeLens\CodeLensHandler.cs (1)
90var syntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
Handler\CodeLens\CodeLensResolveHandler.cs (1)
40var currentDocumentSyntaxVersion = await document.GetSyntaxVersionAsync(cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticsPullCache.cs (3)
22/// changed. The <see cref="VersionStamp"/> is produced by <see cref="Project.GetDependentVersionAsync(CancellationToken)"/> while the 27private sealed class DiagnosticsPullCache(string uniqueKey) : VersionedPullCache<(int globalStateVersion, VersionStamp? dependentVersion), (int globalStateVersion, Checksum dependentChecksum), DiagnosticsRequestState, ImmutableArray<DiagnosticData>>(uniqueKey) 29public 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)
50var 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 (1)
Diagnostics\PullDiagnosticTests.cs (1)
1507document.Id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (1)
409_project, VersionStamp.Default,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
29AddProject(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 (196)
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, 266public DiagnosticAnalysisResult UpdateAggregatedResult(VersionStamp version, DocumentId documentId, bool fromBuild) 270=> new(ProjectId, VersionStamp.Default, DocumentIds, IsEmpty, FromBuild);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (2)
19internal struct DiagnosticAnalysisResultBuilder(Project project, VersionStamp version) 22public readonly VersionStamp Version = version;
Diagnostics\Extensions.cs (1)
106VersionStamp version,
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (2)
29private readonly ConcurrentDictionary<ProjectId, (VersionStamp semanticVersion, SymbolTreeInfo info)> _projectIdToInfo = []; 165var semanticVersion = await project.GetSemanticVersionAsync(cancellationToken).ConfigureAwait(false);
SemanticModelReuse\SemanticModelWorkspaceServiceFactory.SemanticModelWorkspaceService.cs (2)
15internal readonly struct SemanticModelReuseInfo(SemanticModel previousNonSpeculativeSemanticModel, SemanticModel currentSemanticModel, SyntaxNode bodyNode, VersionStamp topLevelSementicVersion) 37public readonly VersionStamp TopLevelSemanticVersion = topLevelSementicVersion;
Serialization\SerializableSourceText.cs (2)
220private readonly VersionStamp _version = VersionStamp.Create();
Workspace\AdhocWorkspace.cs (2)
65var info = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(), name, name, language); 126var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()));
Workspace\CommandLineProject.cs (1)
120version: VersionStamp.Create(),
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
644=> 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)
108public bool TryGetSyntaxVersion(out VersionStamp version) 111if (!this.TryGetTextVersion(out var textVersion)) 116var projectVersion = this.Project.Version; 124internal bool TryGetTopLevelChangeTextVersion(out VersionStamp version) 130public async Task<VersionStamp> GetSyntaxVersionAsync(CancellationToken cancellationToken = default) 132var textVersion = await this.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 133var projectVersion = this.Project.Version;
Workspace\Solution\DocumentState.cs (13)
252private static TreeAndVersion MakeNewTreeAndVersion(SyntaxTree oldTree, SourceText oldText, VersionStamp oldVersion, SyntaxTree newTree, SourceText newText, VersionStamp newVersion) 255var version = topLevelChanged ? newVersion : oldVersion; 495var newTextVersion = GetNewerVersion(); 496var newTreeVersion = GetNewTreeVersionForUpdatedTree(newRoot, newTextVersion, mode); 518VersionStamp textVersion, 519VersionStamp treeVersion, 540private VersionStamp GetNewTreeVersionForUpdatedTree(SyntaxNode newRoot, VersionStamp newTextVersion, PreservationMode mode) 567private VersionStamp GetNewerVersion() 579return VersionStamp.Create(); 620public bool TryGetTopLevelChangeTextVersion(out VersionStamp version) 634public override async ValueTask<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
133VersionStamp siblingVersion,
Workspace\Solution\DocumentState_TreeTextSource.cs (4)
18private sealed class TreeTextSource(AsyncLazy<SourceText> textSource, VersionStamp version) : ITextAndVersionSource 20private readonly VersionStamp _version = version; 57public bool TryGetVersion(LoadTextOptions options, out VersionStamp version) 63public 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)
519public VersionStamp Version => State.Version; 524public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken = default) 530public Task<VersionStamp> GetDependentVersionAsync(CancellationToken cancellationToken = default) 537public Task<VersionStamp> GetDependentSemanticVersionAsync(CancellationToken cancellationToken = default) 544public Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default)
Workspace\Solution\ProjectInfo.cs (8)
31public VersionStamp Version => Attributes.Version; 186VersionStamp version, 214VersionStamp version, 337public ProjectInfo WithVersion(VersionStamp version) 413VersionStamp version, 442public VersionStamp Version { get; } = version; 534VersionStamp? version = null, 651VersionStamp.Create(),
Workspace\Solution\ProjectState.cs (29)
47private readonly AsyncLazy<VersionStamp> _lazyLatestDocumentVersion; 48private readonly AsyncLazy<VersionStamp> _lazyLatestDocumentTopLevelChangeVersion; 73AsyncLazy<VersionStamp> lazyLatestDocumentVersion, 74AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion, 223private static async Task<VersionStamp> ComputeLatestDocumentVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 226var latestVersion = VersionStamp.Default; 233var version = await state.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 242var version = await state.GetTextVersionAsync(cancellationToken).ConfigureAwait(false); 249private AsyncLazy<VersionStamp> CreateLazyLatestDocumentTopLevelChangeVersion( 254if (_lazyLatestDocumentTopLevelChangeVersion.TryGetValue(out var oldVersion)) 268private static async Task<VersionStamp> ComputeTopLevelChangeTextVersionAsync( 269VersionStamp oldVersion, ImmutableArray<TextDocumentState> newDocuments, CancellationToken cancellationToken) 271var finalVersion = oldVersion; 274var newVersion = await newDocument.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false); 281private static async Task<VersionStamp> ComputeLatestDocumentTopLevelChangeVersionAsync(TextDocumentStates<DocumentState> documentStates, TextDocumentStates<AdditionalDocumentState> additionalDocumentStates, CancellationToken cancellationToken) 284var latestVersion = VersionStamp.Default; 289var version = await state.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false); 297var version = await state.GetTopLevelChangeTextVersionAsync(cancellationToken).ConfigureAwait(false); 618public Task<VersionStamp> GetLatestDocumentVersionAsync(CancellationToken cancellationToken) 621public async Task<VersionStamp> GetSemanticVersionAsync(CancellationToken cancellationToken = default) 674public VersionStamp Version => this.ProjectInfo.Version; 711AsyncLazy<VersionStamp>? latestDocumentVersion = null, 712AsyncLazy<VersionStamp>? latestDocumentTopLevelChangeVersion = null, 1063out AsyncLazy<VersionStamp> dependentDocumentVersion, 1064out AsyncLazy<VersionStamp> dependentSemanticVersion) 1077if (oldDocument.TryGetTextVersion(out var oldVersion)) 1102var finalVersion = await newDocuments[0].GetTextVersionAsync(cancellationToken).ConfigureAwait(false);
Workspace\Solution\Solution.cs (6)
115public VersionStamp Version => this.SolutionState.Version; 130public VersionStamp GetLatestProjectVersion() => this.SolutionState.GetLatestProjectVersion(); 357=> this.AddProject(ProjectInfo.Create(projectId, VersionStamp.Create(), name, assemblyName, language)); 990loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 1103var version = VersionStamp.Create();
Workspace\Solution\SolutionCompilationState.cs (2)
1106public Task<VersionStamp> GetDependentVersionAsync(ProjectId projectId, CancellationToken cancellationToken) 1109public 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 (6)
1008private AsyncLazy<VersionStamp>? _lazyDependentVersion; 1009private AsyncLazy<VersionStamp>? _lazyDependentSemanticVersion; 1012public Task<VersionStamp> GetDependentVersionAsync( 1029private async Task<VersionStamp> ComputeDependentVersionAsync( 1051public Task<VersionStamp> GetDependentSemanticVersionAsync( 1068private async Task<VersionStamp> ComputeDependentSemanticVersionAsync(
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)
142public Task<VersionStamp> GetDependentVersionAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken) 145public Task<VersionStamp> GetDependentSemanticVersionAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken)
Workspace\Solution\SolutionInfo.cs (8)
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, 180return new SolutionAttributes(solutionId, VersionStamp.Create(), filePath, telemetryId);
Workspace\Solution\SolutionState.cs (4)
144public VersionStamp Version => SolutionAttributes.Version; 250public VersionStamp GetLatestProjectVersion() 253var latestVersion = VersionStamp.Default;
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
70var 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) 93public Task<VersionStamp> GetTextVersionAsync(CancellationToken cancellationToken = default) 101internal VersionStamp GetTextVersionSynchronously(CancellationToken cancellationToken) 107internal ValueTask<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken = default)
Workspace\Solution\TextDocumentState.cs (9)
94public bool TryGetTextVersion(out VersionStamp version) 120public VersionStamp GetTextVersionSynchronously(CancellationToken cancellationToken) 126public async Task<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)); 201private VersionStamp GetNewerVersion() 208return VersionStamp.Create(); 211public virtual ValueTask<VersionStamp> GetTopLevelChangeTextVersionAsync(CancellationToken cancellationToken)
Workspace\Solution\TextLoader.cs (4)
178VersionStamp.Default, 201public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null) 228private readonly VersionStamp _version; 231internal 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\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)
93SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()), 144=> CreateSolution(SolutionInfo.Create(id, VersionStamp.Create())); 2031project.State.Attributes.With(version: VersionStamp.Create()), 2044=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2211this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2255this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2288this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2310this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (3)
397oldDocument.TryGetTextVersion(out var version)) 485private static TextAndVersion GetProperTextAndVersion(SourceText oldText, SourceText newText, VersionStamp version, string? filePath) 595var version = oldDocument.GetTextVersionSynchronously(CancellationToken.None);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildProjectLoader.Worker.cs (2)
285? VersionStamp.Default 286: VersionStamp.Create(FileUtilities.GetFileTimeStamp(projectPath));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
VisualStudioMSBuildWorkspaceTests.cs (8)
389var sversion = solution.Version; 390var latestPV = solution.GetLatestProjectVersion(); 392var pversion = project.Version; 394var dversion = await document.GetTextVersionAsync(); 395var latestDV = await project.GetLatestDocumentVersionAsync(); 400var dversion1 = await document1.GetTextVersionAsync(); 405var latestDV1 = await document1.Project.GetLatestDocumentVersionAsync(); 413var dversion2 = await document2.GetTextVersionAsync();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (9)
SolutionUtilities.cs (1)
111VersionStamp.Default,
TestTextLoader.cs (1)
20_textAndVersion = TextAndVersion.Create(SourceText.From(text, encoding: null, checksumAlgorithm), VersionStamp.Create());
Workspaces\TestHostDocument.cs (1)
189=> Task.FromResult(TextAndVersion.Create(SourceText.From(_text, encoding: null, options.ChecksumAlgorithm), VersionStamp.Create(), _hostDocument.FilePath));
Workspaces\TestHostProject`1.cs (3)
77public VersionStamp Version { get; } 119Version = VersionStamp.Create(); 155Version = VersionStamp.Create();
Workspaces\TestHostSolution`1.cs (2)
15public readonly VersionStamp Version; 22this.Version = VersionStamp.Create();
Workspaces\TestWorkspace`1.cs (1)
84SetCurrentSolutionEx(CreateSolution(SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create()).WithTelemetryId(solutionTelemetryId)));
Microsoft.CodeAnalysis.Workspaces.UnitTests (164)
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)
25Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(id: null, version: VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#")); 26Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: null, assemblyName: "Bar", language: "C#")); 27Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: null, language: "C#")); 28Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: null)); 30Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 41() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", documents: [documentInfo, documentInfo])); 43Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 47() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", additionalDocuments: [documentInfo, documentInfo])); 49Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 54() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", projectReferences: [projectReference, projectReference])); 56Assert.Throws<ArgumentNullException>("analyzerReferences[0]", () => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 61() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", analyzerReferences: [analyzerReference, analyzerReference])); 63Assert.Throws<ArgumentNullException>(() => ProjectInfo.Create(pid, VersionStamp.Default, name: "Goo", assemblyName: "Bar", language: "C#", 68() => ProjectInfo.Create(pid, VersionStamp.Default, "proj", "assembly", "C#", metadataReferences: [metadataReference, metadataReference])); 74var version = VersionStamp.Default; 93var version = VersionStamp.Default; 112var version = VersionStamp.Default; 131var version = VersionStamp.Default; 150var version = VersionStamp.Default; 169var projectInfo = ProjectInfo.Create(name: "Goo", filePath: @"C:\", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 176var projectInfo = ProjectInfo.Create(name: "Goo", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "Bar", language: "C#"); 185var instance = ProjectInfo.Create(name: "Name", id: ProjectId.CreateNewId(), version: VersionStamp.Default, assemblyName: "AssemblyName", language: "C#"); 188SolutionTestHelpers.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 (87)
59.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))) 374var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 378Assert.True(newSolution1.GetDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 452var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 540var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 623var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 706var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 782var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 869var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 942var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 946Assert.True(newSolution1.GetAdditionalDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 988var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 992Assert.True(newSolution1.GetAnalyzerConfigDocument(documentId)!.TryGetTextVersion(out var actualVersion)); 1091.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))) 1092.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, "proj2", "proj2", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj2.dll"))) 1108loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD1;", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1117loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1127loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1136loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1146loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1155loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1168VersionStamp.Create(), 1300.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1307VersionStamp.Create(), 1335.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1342VersionStamp.Create(), 1370.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1377VersionStamp.Create(), 1405.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1412VersionStamp.Create(), 2048.AddProject(ProjectInfo.Create(submissionId1, VersionStamp.Default, name: "submission1", assemblyName: "submission1.dll", LanguageNames.CSharp, isSubmission: true)) 2049.AddProject(ProjectInfo.Create(submissionId2, VersionStamp.Default, name: "submission2", assemblyName: "submission2.dll", LanguageNames.CSharp, isSubmission: true)) 2050.AddProject(ProjectInfo.Create(submissionId3, VersionStamp.Default, name: "submission3", assemblyName: "submission3.dll", LanguageNames.CSharp, isSubmission: true)) 4019VersionStamp.Create(), 4027VersionStamp.Create(), 4047VersionStamp.Create(), 4057VersionStamp.Create(), 4220VersionStamp.Create(), 4229VersionStamp.Create(), 4566VersionStamp GetVersion() => solution.GetProject(pid).Version; 4595var oldVersion = GetVersion(); 4599var newVersion = GetVersion(); 4624var newSameVersion = GetVersion(); 4688loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4721loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4762loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4774TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA6789.severity = error"), VersionStamp.Default)), 4810loader: TextLoader.From(TextAndVersion.Create(SourceText.From("is_global = true\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4856loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ngenerated_code = true"), VersionStamp.Default))))); 4942ProjectInfo.Create(projectId, VersionStamp.Default, "Test", "Test", LanguageNames.CSharp) 4964projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 4965projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 4988projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId2)])); 4989projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5016projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 5017projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId1)])); 5042solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 5047projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5048projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5072solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, projectReferences: [new ProjectReference(projectId2)])); 5078projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5079projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5103solution = solution.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, 5110projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5111projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5141projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5142projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5160projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp, 5162projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5163projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5206projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test1", "Test1", LanguageNames.CSharp)); 5207projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5208projects.Add(ProjectInfo.Create(projectId3, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5249projects.Add(ProjectInfo.Create(projectId1, VersionStamp.Default, "Test2", "Test2", LanguageNames.CSharp)); 5250projects.Add(ProjectInfo.Create(projectId2, VersionStamp.Default, "Test3", "Test3", LanguageNames.CSharp)); 5272ProjectInfo.Create(csProjectId, VersionStamp.Default, "CS1", "CS1", LanguageNames.CSharp), 5273ProjectInfo.Create(vbProjectId, VersionStamp.Default, "VB1", "VB1", LanguageNames.VisualBasic) 5325VersionStamp.Create(), 5334VersionStamp.Create(), 5343VersionStamp.Create(), 5353VersionStamp.Create(), 5363VersionStamp.Create(), 5373VersionStamp.Create(), 5422var version = VersionStamp.Create(); 5426version: VersionStamp.Default, 5507VersionStamp.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)
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)
23VersionStamp.Create(), 52VersionStamp.Create(), 62VersionStamp.Create(), 92VersionStamp.Create(), 102VersionStamp.Create(), 132VersionStamp.Create(), 142VersionStamp.Create(), 176VersionStamp.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.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 (5)
CodeLens\RemoteCodeLensReferencesService.cs (1)
36public 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)
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)
132var 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)
980var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), solutionFile.Path); 988solution = 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.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)
354SolutionId.CreateNewId(), VersionStamp.Create(), "", 357p1, VersionStamp.Create(), "p1", "p1", LanguageNames.CSharp, outputFilePath: file.Path, 360p2, VersionStamp.Create(), "p2", "p2", LanguageNames.CSharp, 430.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 769.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 911.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 920.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 962.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 971.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1003.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1012.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1046.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1055.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1098.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1107.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1151.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1160.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1204.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1213.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1249.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1258.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1294.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1303.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1337.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1346.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp)) 1543.AddProject(ProjectInfo.Create(projectId1, VersionStamp.Default, name: "Test", assemblyName: "Test", language: LanguageNames.CSharp))
Services\SolutionServiceTests.cs (5)
88ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 117ProjectId.CreateNewId(), VersionStamp.Create(), "test", "test.dll", LanguageNames.CSharp, 335loader: TextLoader.From(TextAndVersion.Create(SourceText.From("test"), VersionStamp.Create()))); 367loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create(), filePath: configPath)), 399loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A { }"), VersionStamp.Create())));