16 types derived from TextLoader
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
40Inherits TextLoader
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
358internal sealed class FailingTextLoader : TextLoader
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Workspaces\SourceTextLoader.cs (1)
11internal sealed class SourceTextLoader : TextLoader
Microsoft.CodeAnalysis.Workspaces (5)
Serialization\SerializableSourceText.cs (1)
212private sealed class SerializableSourceTextLoader : TextLoader
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
632private sealed class SourceTextLoader : TextLoader
Workspace\Solution\FileTextLoader.cs (1)
19public class FileTextLoader : TextLoader
Workspace\Solution\TextLoader.cs (2)
211private sealed class TextDocumentLoader : TextLoader 225private sealed class TextContainerLoader : TextLoader
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
TestTextLoader.cs (1)
14internal class TestTextLoader : TextLoader
Workspaces\TestHostDocument.cs (1)
174private sealed class TestDocumentLoader : TextLoader
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
SolutionTests\TextLoaderTests.cs (5)
16private class LoaderNoOverride1 : TextLoader 20private class LoaderNoOverride2 : TextLoader 26private class LoaderNoOverrideBase : TextLoader 80private class LoaderOverridesObsolete : TextLoader 98private class LoaderOverridesNew : TextLoader
Microsoft.VisualStudio.LanguageServices (1)
Preview\PreviewUpdater.PreviewDialogWorkspace.cs (1)
46private sealed class PreviewTextLoader : TextLoader
122 references to TextLoader
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 (3)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
408var 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.ExternalAccess.Razor (4)
RazorDynamicFileInfo.cs (2)
17public RazorDynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, IRazorDocumentServiceProvider documentServiceProvider) 38public TextLoader TextLoader { get; }
Testing\AbstractRazorLanguageServerFactoryWrapper.cs (1)
25TextLoader? loader = null,
Testing\RazorTestLanguageServerFactory.cs (1)
50TextLoader? loader = null,
Microsoft.CodeAnalysis.Features (6)
EditAndContinue\CommittedSolution.cs (1)
275loader: TextLoader.From(TextAndVersion.Create(sourceText, sourceTextVersion, document.Name)),
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
79loader: TextLoader.From(assemblyInfoSourceText.Container, VersionStamp.Default),
PdbSourceDocument\IPdbSourceDocumentLoaderService.cs (1)
23internal sealed record SourceFileInfo(string FilePath, string SourceDescription, TextLoader Loader, SourceHashAlgorithm ChecksumAlgorithm, bool FromRemoteLocation);
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (2)
201var textLoader = TextLoader.From(textAndVersion);
Workspace\MiscellaneousFileUtilities.cs (1)
21TextLoader textLoader,
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
352loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), path)),
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
349loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "design-time-only.cs")),
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\LanguageServerWorkspace.cs (1)
107TextLoader loader;
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Diagnostics\PullDiagnosticTests.cs (1)
1507document.Id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Microsoft.CodeAnalysis.Workspaces (69)
Serialization\SerializableSourceText.cs (2)
200public TextLoader ToTextLoader(string? filePath) 204/// A <see cref="TextLoader"/> that wraps a <see cref="SerializableSourceText"/> and provides access to the text in
Workspace\AdhocWorkspace.cs (8)
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\Host\SourceFiles\DynamicFileInfo.cs (3)
13internal sealed class DynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, bool designTimeOnly, IDocumentServiceProvider? documentServiceProvider) 27/// return <see cref="TextLoader"/> to load content for the dynamic file 29public TextLoader TextLoader { get; } = textLoader;
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (3)
69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction; 76Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction, 395var documentsToChange = ArrayBuilder<(DocumentId, TextLoader)>.GetInstance(filePaths.Count);
Workspace\Solution\AdditionalDocumentState.cs (1)
50public new AdditionalDocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\AnalyzerConfigDocumentState.cs (1)
60public new AnalyzerConfigDocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\ConstantTextAndVersionSource.cs (1)
24public TextLoader? TextLoader
Workspace\Solution\DocumentInfo.cs (6)
56public TextLoader? TextLoader { get; } 66internal DocumentInfo(DocumentAttributes attributes, TextLoader? loader, IDocumentServiceProvider? documentServiceProvider) 81TextLoader? loader = null, 100Optional<TextLoader?> loader = default, 104var newLoader = loader.HasValue ? loader.Value : TextLoader; 132public DocumentInfo WithTextLoader(TextLoader? loader)
Workspace\Solution\DocumentState.cs (1)
452public new DocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\DocumentState_TreeTextSource.cs (1)
28public TextLoader? TextLoader
Workspace\Solution\Solution.cs (7)
990loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 998public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1104var loader = TextLoader.From(TextAndVersion.Create(text, version, name)); 1419public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1440public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1461public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\SolutionCompilationState.cs (3)
983DocumentId documentId, TextLoader loader, PreservationMode mode) 998DocumentId documentId, TextLoader loader, PreservationMode mode) 1013DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\SolutionState.cs (3)
1071public StateChange UpdateDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1084public StateChange UpdateAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1097public StateChange UpdateAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\TextDocumentState.cs (4)
64public TextDocumentState WithTextLoader(TextLoader? loader, PreservationMode mode) 153public TextDocumentState UpdateText(TextLoader? loader, PreservationMode mode) 161protected static ITextAndVersionSource CreateTextAndVersionSource(SolutionServices solutionServices, TextLoader? loader, string? filePath, LoadTextOptions loadTextOptions, PreservationMode mode = PreservationMode.PreserveValue) 166private static ITextAndVersionSource CreateTextFromLoader(SolutionServices solutionServices, TextLoader loader, PreservationMode mode)
Workspace\Solution\TextLoader.cs (5)
65_ => new StrongBox<bool>(new Func<Workspace, DocumentId, CancellationToken, Task<TextAndVersion>>(LoadTextAndVersionAsync).Method.DeclaringType != typeof(TextLoader))).Value) 183/// Creates a new <see cref="TextLoader"/> from an already existing source text and version. 185public static TextLoader From(TextAndVersion textAndVersion) 196/// Creates a <see cref="TextLoader"/> from a <see cref="SourceTextContainer"/> and version. 201public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null)
Workspace\Solution\VersionSource\ITextAndVersionSource.cs (1)
23TextLoader? TextLoader { get; }
Workspace\Solution\VersionSource\LoadableTextAndVersionSource.cs (1)
13internal sealed class LoadableTextAndVersionSource(TextLoader loader, bool cacheResult) : ITextAndVersionSource
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
48public TextLoader? TextLoader
Workspace\Workspace.cs (9)
1148protected internal void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1154private protected void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader, bool requireDocumentPresent) 1169protected internal void OnAdditionalDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1184protected internal void OnAnalyzerConfigDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 2011=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2178this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2222this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2255this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2277this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (8)
636protected internal void OnDocumentClosed(DocumentId documentId, TextLoader reloader, bool updateActiveContext = false) 642private protected void OnDocumentClosedEx(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 712protected internal void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader) 715private protected void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 726protected internal void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader) 729private protected void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 745TextLoader reloader, 749Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
961var delay = TextLoader.RetryDelay;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
192public TextLoader Loader => _loader;
Microsoft.CodeAnalysis.Workspaces.UnitTests (23)
SolutionTests\DocumentInfoTests.cs (1)
111SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithTextLoader(value), opt => opt.TextLoader, (TextLoader)new TestTextLoader("text"));
SolutionTests\SolutionTests.cs (14)
502TextUpdateType.TextLoader => solution.WithDocumentTextLoader(documentId1, TextLoader.From(textAndVersion), mode), 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"))), 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))))); 5423var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
SolutionTests\TextLoaderTests.cs (1)
108public async Task NoOverride(TextLoader loader)
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 (2)
165var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()));
Roslyn.VisualStudio.Next.UnitTests (4)
Remote\SnapshotSerializationTests.cs (1)
67loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())))]);
Services\SolutionServiceTests.cs (3)
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())));