2 instantiations of TextAndVersion
Microsoft.CodeAnalysis.Workspaces (2)
Workspace\Solution\TextAndVersion.cs (2)
55=> new(text ?? throw new ArgumentNullException(nameof(text)), version, filePath, loadDiagnostic: null); 65=> new(text, version, filePath: null, loadDiagnostic);
224 references to TextAndVersion
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Formatting\RazorLineFormattingOptionsTests.cs (1)
62loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "file.razor.g.cs")),
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SymbolEditorTests.cs (1)
40loader: TextLoader.From(TextAndVersion.Create(SourceText.From(s, encoding: null, SourceHashAlgorithms.Default), VersionStamp.Default)))).ToList();
Microsoft.CodeAnalysis.EditorFeatures (3)
Shared\Preview\PreviewWorkspace.cs (3)
79this.OnDocumentClosed(documentId, TextLoader.From(TextAndVersion.Create(text, version))); 88this.OnAdditionalDocumentClosed(documentId, TextLoader.From(TextAndVersion.Create(text, version))); 97this.OnAnalyzerConfigDocumentClosed(documentId, TextLoader.From(TextAndVersion.Create(text, version)));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
417var loader = TextLoader.From(TextAndVersion.Create(SourceText.From(markup), version, TestSpanMapper.GeneratedFileName));
Rename\RenamerTests.cs (1)
229loader: TextLoader.From(TextAndVersion.Create(startSourceText, VersionStamp.Create(), documentName)),
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
312loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 391loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")),
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
54Public Overrides Function LoadTextAndVersionAsync(workspace As Workspace, documentId As DocumentId, cancellationToken As CancellationToken) As Task(Of TextAndVersion)
Microsoft.CodeAnalysis.Features (3)
EditAndContinue\CommittedSolution.cs (1)
275loader: TextLoader.From(TextAndVersion.Create(sourceText, sourceTextVersion, document.Name)),
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (2)
200var textAndVersion = TextAndVersion.Create(sourceText, VersionStamp.Default, filePath);
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
343loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), path)), 351public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
308loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "design-time-only.cs")),
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Workspaces\SourceTextLoader.cs (2)
26public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 27=> Task.FromResult(TextAndVersion.Create(_sourceText, VersionStamp.Create(), _fileUri));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Diagnostics\PullDiagnosticTests.cs (1)
1506document.Id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Microsoft.CodeAnalysis.Workspaces (128)
Serialization\SerializableSourceText.cs (4)
236public override async Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 237=> TextAndVersion.Create(await this.SerializableSourceText.GetTextAsync(cancellationToken).ConfigureAwait(false), _version); 239internal override TextAndVersion LoadTextAndVersionSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 240=> TextAndVersion.Create(this.SerializableSourceText.GetText(cancellationToken), _version);
Workspace\AdhocWorkspace.cs (4)
126var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())); 169var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath)); 197var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath)); 225var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath));
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
643public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 644=> Task.FromResult(TextAndVersion.Create(_textContainer.CurrentText, VersionStamp.Create(), _filePath));
Workspace\Solution\AdditionalDocumentState.cs (1)
56public new AdditionalDocumentState UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode)
Workspace\Solution\AnalyzerConfigDocumentState.cs (1)
66public new AnalyzerConfigDocumentState UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode)
Workspace\Solution\ConstantTextAndVersionSource.cs (5)
14internal sealed class ConstantTextAndVersionSource(TextAndVersion value) : ITextAndVersionSource 16private readonly TextAndVersion _value = value; 27public TextAndVersion GetValue(LoadTextOptions options, CancellationToken cancellationToken) 30public Task<TextAndVersion> GetValueAsync(LoadTextOptions options, CancellationToken cancellationToken) 33public bool TryGetValue(LoadTextOptions options, [MaybeNullWhen(false)] out TextAndVersion value)
Workspace\Solution\DocumentState.cs (8)
140var textAndVersion = await newTextSource.GetValueAsync(loadTextOptions, cancellationToken).ConfigureAwait(false); 156var textAndVersion = newTextSource.GetValue(loadTextOptions, cancellationToken); 165TextAndVersion textAndVersion, 202var newTextAndVersion = await newTextSource.GetValueAsync(loadTextOptions, cancellationToken).ConfigureAwait(false); 224var newTextAndVersion = newTextSource.GetValue(loadTextOptions, cancellationToken); 237TextAndVersion newTextAndVersion, 449public new DocumentState UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode) 584if (TextAndVersionSource.TryGetValue(LoadTextOptions, out var textAndVersion))
Workspace\Solution\DocumentState_TreeTextSource.cs (7)
16/// A source for <see cref="TextAndVersion"/> constructed from an syntax tree. 31public async Task<TextAndVersion> GetValueAsync(LoadTextOptions options, CancellationToken cancellationToken) 34return TextAndVersion.Create(text, _version); 37public TextAndVersion GetValue(LoadTextOptions options, CancellationToken cancellationToken) 40return TextAndVersion.Create(text, _version); 43public bool TryGetValue(LoadTextOptions options, [NotNullWhen(true)] out TextAndVersion? value) 47value = TextAndVersion.Create(text, _version);
Workspace\Solution\FileTextLoader.cs (9)
90public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 101public override async Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 174var textAndVersion = await FileUtilities.RethrowExceptionsAsIOExceptionAsync( 184return TextAndVersion.Create(text, version, t.self.Path); 195internal override TextAndVersion LoadTextAndVersionSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 201var textAndVersion = FileUtilities.RethrowExceptionsAsIOException( 208return TextAndVersion.Create(text, version, t.self.Path); 214private TextAndVersion CheckForConcurrentFileWrites(DateTime prevLastWriteTime, TextAndVersion textAndVersion)
Workspace\Solution\Solution.cs (5)
969loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 1083var loader = TextLoader.From(TextAndVersion.Create(text, version, name)); 1282public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1303public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1324public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue)
Workspace\Solution\SolutionCompilationState.cs (6)
936/// <inheritdoc cref="SolutionState.WithDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 938DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 944/// <inheritdoc cref="SolutionState.WithAdditionalDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 946DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode) 952/// <inheritdoc cref="SolutionState.WithAnalyzerConfigDocumentText(DocumentId, TextAndVersion, PreservationMode)"/> 954DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode)
Workspace\Solution\SolutionState.cs (6)
1028public StateChange WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1031if (oldDocument.TryGetTextAndVersion(out var oldTextAndVersion) && textAndVersion == oldTextAndVersion) 1044public StateChange WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1047if (oldDocument.TryGetTextAndVersion(out var oldTextAndVersion) && textAndVersion == oldTextAndVersion) 1060public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.PreserveValue) 1063if (oldDocument.TryGetTextAndVersion(out var oldTextAndVersion) && textAndVersion == oldTextAndVersion)
Workspace\Solution\SourceGeneratedDocumentState.cs (2)
70var textAndVersion = TextAndVersion.Create(generatedSourceText, VersionStamp.Create());
Workspace\Solution\TextAndVersion.cs (4)
48/// Create a new <see cref="TextAndVersion"/> instance. 54public static TextAndVersion Create(SourceText text, VersionStamp version, string? filePath = null) 58/// Create a new <see cref="TextAndVersion"/> instance. 64internal static TextAndVersion Create(SourceText text, VersionStamp version, Diagnostic? loadDiagnostic)
Workspace\Solution\TextDocumentState.cs (16)
71private static ConstantTextAndVersionSource CreateStrongText(TextAndVersion text) 74private static RecoverableTextAndVersion CreateRecoverableText(TextAndVersion text, SolutionServices services) 82if (this.TextAndVersionSource.TryGetValue(LoadTextOptions, out var textAndVersion)) 97public bool TryGetTextAndVersion([NotNullWhen(true)] out TextAndVersion? textAndVersion) 116var textAndVersion = this.TextAndVersionSource.GetValue(LoadTextOptions, cancellationToken); 122var textAndVersion = this.TextAndVersionSource.GetValue(LoadTextOptions, cancellationToken); 134var textAndVersion = await GetTextAndVersionAsync(cancellationToken).ConfigureAwait(false); 138public TextDocumentState UpdateText(TextAndVersion newTextAndVersion, PreservationMode mode) 148var newTextAndVersion = TextAndVersion.Create(newText, newVersion, FilePath); 164: CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, encoding: null, loadTextOptions.ChecksumAlgorithm), VersionStamp.Default, filePath)); 186private ValueTask<TextAndVersion> GetTextAndVersionAsync(CancellationToken cancellationToken) 188if (this.TextAndVersionSource.TryGetValue(LoadTextOptions, out var textAndVersion)) 190return new ValueTask<TextAndVersion>(textAndVersion); 194return new ValueTask<TextAndVersion>(TextAndVersionSource.GetValueAsync(LoadTextOptions, cancellationToken)); 203if (this.TextAndVersionSource.TryGetValue(LoadTextOptions, out var textAndVersion))
Workspace\Solution\TextLoader.cs (16)
60public virtual Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 65_ => new StrongBox<bool>(new Func<Workspace, DocumentId, CancellationToken, Task<TextAndVersion>>(LoadTextAndVersionAsync).Method.DeclaringType != typeof(TextLoader))).Value) 83public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 92internal virtual TextAndVersion LoadTextAndVersionSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 98internal async Task<TextAndVersion> LoadTextAsync(LoadTextOptions options, CancellationToken cancellationToken) 127internal TextAndVersion LoadTextSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 158private TextAndVersion CreateFailedText(string message) 176return TextAndVersion.Create( 185public static TextLoader From(TextAndVersion textAndVersion) 213private readonly TextAndVersion _textAndVersion; 215internal TextDocumentLoader(TextAndVersion textAndVersion) 218public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 221internal override TextAndVersion LoadTextAndVersionSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 241public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 244internal override TextAndVersion LoadTextAndVersionSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 245=> TextAndVersion.Create(_container.CurrentText, _version, _filePath);
Workspace\Solution\VersionSource\ITextAndVersionSource.cs (3)
25bool TryGetValue(LoadTextOptions options, [MaybeNullWhen(false)] out TextAndVersion value); 26TextAndVersion GetValue(LoadTextOptions options, CancellationToken cancellationToken); 27Task<TextAndVersion> GetValueAsync(LoadTextOptions options, CancellationToken cancellationToken);
Workspace\Solution\VersionSource\LoadableTextAndVersionSource.cs (9)
28private TextAndVersion? _instance; 35private WeakReference<TextAndVersion>? _weakInstance; 37private Task<TextAndVersion> LoadAsync(CancellationToken cancellationToken) 40private TextAndVersion LoadSynchronously(CancellationToken cancellationToken) 43public bool TryGetValue([MaybeNullWhen(false)] out TextAndVersion value) 52public TextAndVersion GetValue(CancellationToken cancellationToken) 69public async Task<TextAndVersion> GetValueAsync(CancellationToken cancellationToken) 86private void UpdateWeakAndStrongReferences_NoLock(TextAndVersion textAndVersion) 99_weakInstance ??= new WeakReference<TextAndVersion>(textAndVersion);
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (8)
54public bool TryGetValue(LoadTextOptions options, [MaybeNullWhen(false)] out TextAndVersion value) 61value = TextAndVersion.Create(text, recoverableText.Version, recoverableText.LoadDiagnostic); 90var textAndVersion = useAsync 116public TextAndVersion GetValue(LoadTextOptions options, CancellationToken cancellationToken) 126public async Task<TextAndVersion> GetValueAsync(LoadTextOptions options, CancellationToken cancellationToken) 148public RecoverableText(ITextAndVersionSource source, TextAndVersion textAndVersion, LoadTextOptions options, SolutionServices services) 166public TextAndVersion ToTextAndVersion(SourceText text) 167=> TextAndVersion.Create(text, Version, LoadDiagnostic);
Workspace\Workspace.cs (5)
2009=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2176this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2220this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2253this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2275this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (7)
400var newTextAndVersion = GetProperTextAndVersion(oldText, newText, version, oldDocumentState.FilePath); 485private static TextAndVersion GetProperTextAndVersion(SourceText oldText, SourceText newText, VersionStamp version, string? filePath) 490? TextAndVersion.Create(newText, version, filePath) 491: TextAndVersion.Create(newText, version.GetNewerVersion(), filePath); 556Func<Solution, DocumentId, TextAndVersion, PreservationMode, Solution> withDocumentTextAndVersion, 596var newTextAndVersion = TextAndVersion.Create(newText, version, oldDocument.FilePath);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
TestTextLoader.cs (3)
16private readonly TextAndVersion _textAndVersion; 20_textAndVersion = TextAndVersion.Create(SourceText.From(text, encoding: null, checksumAlgorithm), VersionStamp.Create()); 23public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
Workspaces\TestHostDocument.cs (2)
187public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 188=> Task.FromResult(TextAndVersion.Create(SourceText.From(_text, encoding: null, options.ChecksumAlgorithm), VersionStamp.Create(), _hostDocument.FilePath));
Microsoft.CodeAnalysis.Workspaces.UnitTests (63)
SolutionTests\SolutionTests.cs (31)
374var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 452var textAndVersion = TextAndVersion.Create(text, VersionStamp.Create()); 496private static Solution UpdateSolution(PreservationMode mode, TextUpdateType updateType, Solution solution, DocumentId documentId1, SourceText text, TextAndVersion textAndVersion) 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()); 854var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 900var textAndVersion = TextAndVersion.Create(SourceText.From("new text"), VersionStamp.Default); 1020loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD1;", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1029loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1039loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1048loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1058loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1067loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 4388var unused = loader.LoadTextAndVersionSynchronously(new LoadTextOptions(SourceHashAlgorithms.Default), CancellationToken.None); 4545loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4578loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4619loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4631TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA6789.severity = error"), VersionStamp.Default)), 4667loader: TextLoader.From(TextAndVersion.Create(SourceText.From("is_global = true\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4713loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ngenerated_code = true"), VersionStamp.Default))))); 5280var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
SolutionTests\TextLoaderTests.cs (26)
22public new virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 23=> Task.FromResult((TextAndVersion?)null!); 29public new virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 30=> Task.FromResult((TextAndVersion?)null!); 33public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId) 34=> Task.FromResult((TextAndVersion?)null!); 37public virtual Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, ref DocumentId? documentId, CancellationToken cancellationToken) 38=> Task.FromResult((TextAndVersion?)null!); 41public virtual Task<TextAndVersion> LoadTextAndVersionAsync<T>(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 42=> Task.FromResult((TextAndVersion?)null!); 47public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 48=> Task.FromResult((TextAndVersion?)null!); 53public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId) 59public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, ref DocumentId? documentId, CancellationToken cancellationToken) 60=> Task.FromResult((TextAndVersion?)null!); 65public override Task<TextAndVersion> LoadTextAndVersionAsync<T>(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 66=> Task.FromResult((TextAndVersion?)null!); 82public static readonly TextAndVersion Value = TextAndVersion.Create(SourceText.From(""), VersionStamp.Default); 85public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 91public static new readonly TextAndVersion Value = TextAndVersion.Create(SourceText.From(""), VersionStamp.Default); 94public override Task<TextAndVersion> LoadTextAndVersionAsync(Workspace? workspace, DocumentId? documentId, CancellationToken cancellationToken) 100public static readonly TextAndVersion Value = TextAndVersion.Create(SourceText.From(""), VersionStamp.Default); 102public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken)
WorkspaceTests\AdhocWorkspaceTests.cs (5)
155loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create()))); 215var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 249var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 287loader: TextLoader.From(TextAndVersion.Create(text, version, analyzerConfigDocFilePath)), 322var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
WorkspaceTests\WorkspaceTests.cs (1)
165var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()));
Microsoft.VisualStudio.LanguageServices (3)
Preview\PreviewUpdater.PreviewDialogWorkspace.cs (3)
53public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 56internal override TextAndVersion LoadTextAndVersionSynchronously(LoadTextOptions options, CancellationToken cancellationToken) 57=> TextAndVersion.Create(_text, VersionStamp.Create());
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Client\Projects\WorkspaceFileTextLoaderNoException.cs (2)
28public override Task<TextAndVersion> LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) 32return Task.FromResult(TextAndVersion.Create(SourceText.From("", encoding: null, options.ChecksumAlgorithm), VersionStamp.Create()));
Roslyn.VisualStudio.Next.UnitTests (4)
Remote\SnapshotSerializationTests.cs (1)
73loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())))));
Services\SolutionServiceTests.cs (3)
332loader: TextLoader.From(TextAndVersion.Create(SourceText.From("test"), VersionStamp.Create()))); 364loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create(), filePath: configPath)), 396loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A { }"), VersionStamp.Create())));