15 types derived from TextLoader
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
202private sealed class TestDocumentLoader : TextLoader
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
407internal sealed class FailingTextLoader : TextLoader
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (1)
Diagnostics\DiagnosticServiceTests.vb (1)
41Inherits TextLoader
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
97private sealed class SourceTextLoader : TextLoader
Microsoft.CodeAnalysis.Workspaces (4)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
598private sealed class SourceTextLoader : TextLoader
Workspace\Solution\FileTextLoader.cs (1)
21public class FileTextLoader : TextLoader
Workspace\Solution\TextLoader.cs (2)
204private sealed class TextDocumentLoader : TextLoader 218private sealed class TextContainerLoader : TextLoader
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
TestTextLoader.cs (1)
14internal class TestTextLoader : 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
105 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)
85this.OnDocumentClosed(documentId, TextLoader.From(TextAndVersion.Create(text, version))); 94this.OnAdditionalDocumentClosed(documentId, TextLoader.From(TextAndVersion.Create(text, version))); 103this.OnAnalyzerConfigDocumentClosed(documentId, TextLoader.From(TextAndVersion.Create(text, version)));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
403var loader = TextLoader.From(TextAndVersion.Create(SourceText.From(markup), version, TestSpanMapper.GeneratedFileName));
Rename\RenamerTests.cs (1)
229loader: TextLoader.From(TextAndVersion.Create(startSourceText, VersionStamp.Create(), documentName)),
Workspaces\TestHostDocument.cs (1)
220public TextLoader Loader => _loader;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (3)
365loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create(), filePath)), 488loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")), 586loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A {}"), VersionStamp.Create(), filePath: "test.cs")),
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (3)
401loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), path)), 756loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), "design-time-only.cs")), 3718loader: TextLoader.From(TextAndVersion.Create(sourceText, VersionStamp.Create(), filePath)),
Microsoft.CodeAnalysis.ExternalAccess.Razor (4)
IRazorLanguageServerFactory.cs (1)
21TextLoader? loader = null,
RazorDynamicFileInfo.cs (2)
17public RazorDynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, IRazorDocumentServiceProvider documentServiceProvider) 38public TextLoader TextLoader { get; }
RazorLanguageServerFactoryWrapper.cs (1)
52TextLoader? loader = null,
Microsoft.CodeAnalysis.Features (6)
EditAndContinue\CommittedSolution.cs (1)
276loader: TextLoader.From(TextAndVersion.Create(sourceText, sourceTextVersion, document.Name)),
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
80loader: 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)
207var textLoader = TextLoader.From(textAndVersion);
Workspace\MiscellaneousFileUtilities.cs (1)
21TextLoader textLoader,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Diagnostics\PullDiagnosticTests.cs (1)
1214document.Id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Microsoft.CodeAnalysis.Remote.Workspaces (2)
AbstractAssetProvider.cs (2)
92var textLoader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), attributes.FilePath));
Microsoft.CodeAnalysis.Workspaces (55)
Workspace\AdhocWorkspace.cs (8)
131var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())); 174var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath)); 202var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath)); 230var loader = TextLoader.From(TextAndVersion.Create(text, version, doc.FilePath));
Workspace\Host\SourceFiles\DynamicFileInfo.cs (2)
15public DynamicFileInfo(string filePath, SourceCodeKind sourceCodeKind, TextLoader textLoader, bool designTimeOnly, IDocumentServiceProvider? documentServiceProvider) 37public TextLoader TextLoader { get; }
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)
38public new AdditionalDocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\AnalyzerConfigDocumentState.cs (1)
50public new AnalyzerConfigDocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\DocumentInfo.cs (6)
58public TextLoader? TextLoader { get; } 68internal DocumentInfo(DocumentAttributes attributes, TextLoader? loader, IDocumentServiceProvider? documentServiceProvider) 83TextLoader? loader = null, 102Optional<TextLoader?> loader = default, 106var newLoader = loader.HasValue ? loader.Value : TextLoader; 134public DocumentInfo WithTextLoader(TextLoader? loader)
Workspace\Solution\DocumentState.cs (1)
455public new DocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\LoadableTextAndVersionSource.cs (2)
36public readonly TextLoader Loader; 41public LoadableTextAndVersionSource(TextLoader loader, bool cacheResult)
Workspace\Solution\Solution.cs (7)
1057loader: TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create(), name)), 1065public Solution AddDocument(DocumentId documentId, string name, TextLoader loader, IEnumerable<string>? folders = null) 1187var loader = TextLoader.From(TextAndVersion.Create(text, version, name)); 1594public Solution WithDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1621public Solution WithAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1648public Solution WithAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\SolutionState.cs (3)
1405public SolutionState UpdateDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1418public SolutionState UpdateAdditionalDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode) 1431public SolutionState UpdateAnalyzerConfigDocumentTextLoader(DocumentId documentId, TextLoader loader, PreservationMode mode)
Workspace\Solution\TextDocumentState.cs (3)
77private static ITextAndVersionSource CreateStrongText(TextLoader loader) 95private static ITextAndVersionSource CreateRecoverableText(TextLoader loader, SolutionServices services) 193public TextDocumentState UpdateText(TextLoader loader, PreservationMode mode)
Workspace\Solution\TextLoader.cs (5)
58_ => new StrongBox<bool>(new Func<Workspace, DocumentId, CancellationToken, Task<TextAndVersion>>(LoadTextAndVersionAsync).Method.DeclaringType != typeof(TextLoader))).Value) 176/// Creates a new <see cref="TextLoader"/> from an already existing source text and version. 178public static TextLoader From(TextAndVersion textAndVersion) 189/// Creates a <see cref="TextLoader"/> from a <see cref="SourceTextContainer"/> and version. 194public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null)
Workspace\Workspace.cs (8)
964protected internal void OnDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 978protected internal void OnAdditionalDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 992protected internal void OnAnalyzerConfigDocumentTextLoaderChanged(DocumentId documentId, TextLoader loader) 1771=> CreateDocumentInfoWithoutText(doc).WithTextLoader(TextLoader.From(TextAndVersion.Create(doc.GetTextSynchronously(CancellationToken.None), VersionStamp.Create(), doc.FilePath))); 1938this.OnDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 1982this.OnAdditionalDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2015this.OnAnalyzerConfigDocumentAdded(info.WithTextLoader(TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())))); 2037this.OnAnalyzerConfigDocumentTextLoaderChanged(id, TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create())));
Workspace\Workspace_Editor.cs (5)
575protected internal void OnDocumentClosed(DocumentId documentId, TextLoader reloader, bool updateActiveContext = false) 624protected internal void OnAdditionalDocumentClosed(DocumentId documentId, TextLoader reloader) 634protected internal void OnAnalyzerConfigDocumentClosed(DocumentId documentId, TextLoader reloader) 649TextLoader reloader, 652Func<Solution, DocumentId, TextLoader, PreservationMode, Solution> withTextDocumentTextLoader)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
949var delay = TextLoader.RetryDelay;
Microsoft.CodeAnalysis.Workspaces.UnitTests (17)
SolutionTests\DocumentInfoTests.cs (1)
113SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithTextLoader(value), opt => opt.TextLoader, (TextLoader)new TestTextLoader("text"));
SolutionTests\SolutionTests.cs (8)
478TextUpdateType.TextLoader => solution.WithDocumentTextLoader(documentId1, TextLoader.From(textAndVersion), mode), 3935loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 3969loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4011loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4023TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ndotnet_diagnostic.CA6789.severity = error"), VersionStamp.Default)), 4059loader: TextLoader.From(TextAndVersion.Create(SourceText.From("is_global = true\r\n\r\ndotnet_diagnostic.CA1234.severity = error"), VersionStamp.Default))))); 4105loader: TextLoader.From(TextAndVersion.Create(SourceText.From("[*.*]\r\n\r\ngenerated_code = true"), VersionStamp.Default))))); 4294var 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)
158loader: TextLoader.From(TextAndVersion.Create(SourceText.From(""), VersionStamp.Create()))); 218var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 252var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version))); 290loader: TextLoader.From(TextAndVersion.Create(text, version, analyzerConfigDocFilePath)), 346var docInfo = DocumentInfo.Create(DocumentId.CreateNewId(pid), "c.cs", loader: TextLoader.From(TextAndVersion.Create(text, version)));
WorkspaceTests\WorkspaceTests.cs (2)
168var loader = TextLoader.From(TextAndVersion.Create(text, VersionStamp.Create()));
Roslyn.VisualStudio.Next.UnitTests (4)
Remote\SnapshotSerializationTests.cs (1)
78loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create())))));
Services\SolutionServiceTests.cs (3)
247loader: TextLoader.From(TextAndVersion.Create(SourceText.From("test"), VersionStamp.Create()))); 279loader: TextLoader.From(TextAndVersion.Create(SourceText.From("root = true"), VersionStamp.Create(), filePath: configPath)), 311loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class A { }"), VersionStamp.Create())));