5 types derived from TextLoader
Microsoft.CodeAnalysis.Workspaces (5)
Serialization\SerializableSourceText.cs (1)
210private sealed class SerializableSourceTextLoader : TextLoader
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
656private sealed class SourceTextLoader : TextLoader
Workspace\Solution\FileTextLoader.cs (1)
19public class FileTextLoader : TextLoader
Workspace\Solution\TextLoader.cs (2)
196private sealed class TextDocumentLoader : TextLoader 210private sealed class TextContainerLoader : TextLoader
76 references to TextLoader
Microsoft.CodeAnalysis.Features (7)
EditAndContinue\CommittedSolution.cs (1)
291loader: TextLoader.From(TextAndVersion.Create(sourceText, sourceTextVersion, document.Name)),
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
358loader: TextLoader.From(assemblyInfoSourceText.Container, VersionStamp.Default), 369loader: TextLoader.From(emptySourceText.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)
197var textLoader = TextLoader.From(textAndVersion);
Workspace\MiscellaneousFileUtilities.cs (1)
28TextLoader textLoader,
Microsoft.CodeAnalysis.Workspaces (69)
Serialization\SerializableSourceText.cs (2)
198public TextLoader ToTextLoader(string? filePath) 202/// 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 (2)
13internal sealed class DynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, bool designTimeOnly, IDocumentServiceProvider? documentServiceProvider) 29public TextLoader TextLoader { get; } = textLoader;
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (3)
69private readonly Func<Solution, DocumentId, TextLoader, Solution> _documentTextLoaderChangedAction; 88Func<Solution, DocumentId, TextLoader, Solution> documentTextLoaderChangedAction, 407var 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)
450public new DocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\DocumentState_TreeTextSource.cs (1)
26public TextLoader? TextLoader
Workspace\Solution\Solution.cs (7)
1040loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 1048public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1154var loader = TextLoader.From(TextAndVersion.Create(text, version, name)); 1473public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1494public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1515public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\SolutionCompilationState.cs (3)
1069DocumentId documentId, TextLoader loader, PreservationMode mode) 1084DocumentId documentId, TextLoader loader, PreservationMode mode) 1099DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\SolutionState.cs (3)
1111public StateChange UpdateDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1124public StateChange UpdateAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1137public StateChange UpdateAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\TextDocumentState.cs (4)
64public TextDocumentState WithTextLoader(TextLoader? loader, PreservationMode mode) 148public TextDocumentState UpdateText(TextLoader? loader, PreservationMode mode) 156protected static ITextAndVersionSource CreateTextAndVersionSource(SolutionServices solutionServices, TextLoader? loader, string? filePath, LoadTextOptions loadTextOptions, PreservationMode mode = PreservationMode.PreserveValue) 161private 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) 168/// Creates a new <see cref="TextLoader"/> from an already existing source text and version. 170public static TextLoader From(TextAndVersion textAndVersion) 181/// Creates a <see cref="TextLoader"/> from a <see cref="SourceTextContainer"/> and version. 186public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null)
Workspace\Solution\VersionSource\ITextAndVersionSource.cs (1)
23TextLoader? TextLoader { get; }
Workspace\Solution\VersionSource\LoadableTextAndVersionSource.cs (2)
13internal sealed class LoadableTextAndVersionSource(TextLoader loader, bool cacheResult) : ITextAndVersionSource 105public TextLoader TextLoader { get; } = loader;
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
48public TextLoader? TextLoader
Workspace\Workspace.cs (9)
1186protected internal void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1192private protected void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader, bool requireDocumentPresent) 1207protected internal void OnAdditionalDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1222protected internal void OnAnalyzerConfigDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 2038=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 2205this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2249this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2282this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2304this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (8)
637protected internal void OnDocumentClosed(DocumentId documentId, TextLoader reloader, bool updateActiveContext = false) 643private protected void OnDocumentClosedEx(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 713protected internal void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader) 716private protected void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 727protected internal void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader) 730private protected void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader, bool requireDocumentPresentAndOpen) 746TextLoader reloader, 750Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader)