3 types derived from SourceTextContainer
Microsoft.CodeAnalysis (1)
Text\SourceText.cs (1)
1260private class StaticContainer : SourceTextContainer
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.TextBufferContainer.cs (1)
19internal class TextBufferContainer : SourceTextContainer
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EditAndContinue\EditAndContinueLanguageServiceTests.cs (1)
75private class TestSourceTextContainer : SourceTextContainer
121 references to SourceTextContainer
Microsoft.CodeAnalysis (3)
Text\SourceText.cs (3)
37private SourceTextContainer? _lazyContainer; 50protected SourceText(ImmutableArray<byte> checksum = default, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1, SourceTextContainer? container = null) 473public virtual SourceTextContainer Container
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
345protected class StaticSourceTextContainer(SourceText sourceText) : SourceTextContainer
PdbSourceDocument\NullResultMetadataAsSourceFileProvider.cs (1)
51public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, Text.SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
Microsoft.CodeAnalysis.EditorFeatures (7)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
111var sourceTextContainer = args.SubjectBuffer.AsTextContainer();
Interactive\InteractiveWorkspace.cs (2)
14private SourceTextContainer? _openTextContainer; 28public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer)
NavigationBar\NavigationBarController.cs (1)
241var textContainer = _subjectBuffer.AsTextContainer();
PasteTracking\PasteTrackingService.cs (1)
26public bool TryGetPastedTextSpan(SourceTextContainer sourceTextContainer, out TextSpan textSpan)
Shared\Preview\PreviewWorkspace.cs (1)
48public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer)
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
458var container = snapshot.TextBuffer.AsTextContainer();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Completion\AbstractCompletionProviderTests.cs (1)
1043var textContainer = testWorkspace.Documents.First().GetTextBuffer().AsTextContainer();
Workspaces\EditorTestHostDocument.cs (1)
196public SourceTextContainer GetOpenTextContainer()
Microsoft.CodeAnalysis.EditorFeatures.Text (6)
Extensions.cs (4)
14public static SourceTextContainer AsTextContainer(this ITextBuffer buffer) 17public static ITextBuffer GetTextBuffer(this SourceTextContainer textContainer) 20public static ITextBuffer? TryGetTextBuffer(this SourceTextContainer? textContainer) 53var container = buffer.AsTextContainer();
Extensions.SnapshotSourceText.cs (1)
114public override SourceTextContainer Container
ExternalAccess\VSTypeScript\Api\VSTypeScriptTextBufferExtensions.cs (1)
12public static SourceTextContainer AsTextContainer(this ITextBuffer buffer)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (5)
Extensions\SourceTextContainerExtensionsTests.cs (1)
19var containerMock = new Mock<SourceTextContainer>(MockBehavior.Strict);
Preview\PreviewWorkspaceTests.cs (1)
100var sourceTextContainer = SourceText.From("Text").Container;
TextEditor\OpenDocumentTests.cs (1)
34var sourceTextContainer = buffer.AsTextContainer();
TextEditor\TryGetDocumentTests.cs (2)
29var container = buffer.AsTextContainer(); 59var container = buffer.AsTextContainer();
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
InlineRename\UI\InlineRenameAdornmentManager.cs (1)
182private static Workspace? GetWorkspace(SourceTextContainer textContainer)
Microsoft.CodeAnalysis.Features (6)
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
283public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
MetadataAsSource\IMetadataAsSourceFileProvider.cs (1)
40bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId);
MetadataAsSource\IMetadataAsSourceFileService.cs (1)
39bool TryAddDocumentToWorkspace(string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId);
MetadataAsSource\MetadataAsSourceFileService.cs (1)
166public bool TryAddDocumentToWorkspace(string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
PasteTracking\IPasteTrackingService.cs (1)
13bool TryGetPastedTextSpan(SourceTextContainer sourceTextContainer, out TextSpan textSpan);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
387public bool TryAddDocumentToWorkspace(MetadataAsSourceWorkspace workspace, string filePath, SourceTextContainer sourceTextContainer, [NotNullWhen(true)] out DocumentId? documentId)
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\LanguageServerWorkspace.cs (1)
81internal override ValueTask TryOnDocumentOpenedAsync(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
110private class StaticSourceTextContainer(SourceText text) : SourceTextContainer
Microsoft.CodeAnalysis.Workspaces (60)
ExternalAccess\VSTypeScript\Api\VSTypeScriptTextExtensions.cs (1)
12public static IEnumerable<Document> GetRelatedDocuments(this SourceTextContainer container)
Workspace\DocumentActiveContextChangedEventArgs.cs (2)
16public SourceTextContainer SourceTextContainer { get; } 20public DocumentActiveContextChangedEventArgs(Solution solution, SourceTextContainer sourceTextContainer, DocumentId oldActiveContextDocumentId, DocumentId newActiveContextDocumentId)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (12)
41/// A map of explicitly-added "always open" <see cref="SourceTextContainer"/> and their associated <see cref="DocumentId"/>. This does not contain 44private IBidirectionalMap<SourceTextContainer, DocumentId> _sourceTextContainersToDocumentIds = BidirectionalMap<SourceTextContainer, DocumentId>.Empty; 132SourceTextContainer textContainer, 310public void RemoveTextContainer(SourceTextContainer textContainer) 538internal ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> UpdateSolutionForBatch( 553static ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> UpdateSolutionForBatch( 564Func<DocumentId, SourceTextContainer?> getContainer) 566using var _ = ArrayBuilder<(DocumentId documentId, SourceTextContainer textContainer)>.GetInstance(out var documentsToOpen); 579var textContainer = getContainer(documentInfo.Id); 634private readonly SourceTextContainer _textContainer; 637public SourceTextLoader(SourceTextContainer textContainer, string? filePath)
Workspace\ProjectSystem\ProjectSystemProject.cs (5)
571ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> documentsToOpen = []; 572ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> additionalDocumentsToOpen = []; 573ImmutableArray<(DocumentId documentId, SourceTextContainer textContainer)> analyzerConfigDocumentsToOpen = []; 843SourceTextContainer textContainer, 859public void RemoveSourceTextContainer(SourceTextContainer textContainer)
Workspace\Solution\Document.cs (1)
461var container = text.Container;
Workspace\Solution\TextLoader.cs (4)
196/// Creates a <see cref="TextLoader"/> from a <see cref="SourceTextContainer"/> and version. 201public static TextLoader From(SourceTextContainer container, VersionStamp version, string? filePath = null) 227private readonly SourceTextContainer _container; 231internal TextContainerLoader(SourceTextContainer container, VersionStamp version, string? filePath)
Workspace\TextExtensions.cs (2)
106public static ImmutableArray<Document> GetRelatedDocuments(this SourceTextContainer container) 126public static Document? GetOpenDocumentInCurrentContext(this SourceTextContainer container)
Workspace\Workspace.TextTracker.cs (2)
22internal readonly SourceTextContainer TextContainer; 29SourceTextContainer textContainer,
Workspace\Workspace_Editor.cs (25)
30private readonly Dictionary<SourceTextContainer, DocumentId> _bufferToDocumentInCurrentContextMap = []; 35private readonly Dictionary<SourceTextContainer, OneOrMany<DocumentId>> _bufferToAssociatedDocumentsMap = []; 38private readonly Dictionary<DocumentId, SourceTextContainer> _documentToAssociatedBufferMap = []; 91if (_documentToAssociatedBufferMap.TryGetValue(documentId, out var textContainer)) 215public virtual IEnumerable<DocumentId> GetRelatedDocumentIds(SourceTextContainer container) 235public virtual DocumentId? GetDocumentIdInCurrentContext(SourceTextContainer container) 248private DocumentId? GetDocumentIdInCurrentContext_NoLock(SourceTextContainer container) 255/// <see cref="GetDocumentIdInCurrentContext(SourceTextContainer)"/> would return for the 256/// <see cref="SourceTextContainer"/>. 267var container = GetOpenDocumentSourceTextContainer_NoLock(documentId); 279private SourceTextContainer? GetOpenDocumentSourceTextContainer_NoLock(DocumentId documentId) 306SourceTextContainer? container; 351protected internal void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 354internal virtual ValueTask TryOnDocumentOpenedAsync(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, CancellationToken cancellationToken) 360internal void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, bool requireDocumentPresentAndClosed) 436/// cref="OnDocumentOpened(DocumentId, SourceTextContainer, bool)" />, this doesn't result in the workspace 442SourceTextContainer textContainer, 494private void SignupForTextChanges(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, Action<Workspace, DocumentId, SourceText, PreservationMode> onChangedHandler) 511protected internal void OnAdditionalDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 514private protected void OnAdditionalDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, bool requireDocumentPresentAndClosed) 528protected internal void OnAnalyzerConfigDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) 531private protected void OnAnalyzerConfigDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext, bool requireDocumentPresentAndClosed) 550SourceTextContainer textContainer, 796private void UpdateCurrentContextMapping_NoLock(SourceTextContainer textContainer, DocumentId id, bool isCurrentContext) 821private DocumentId? RemoveDocumentFromCurrentContextMapping_NoLock(SourceTextContainer textContainer, DocumentId closedDocumentId)
Workspace\Workspace_Events.cs (1)
225protected Task RaiseDocumentActiveContextChangedEventAsync(SourceTextContainer sourceTextContainer, DocumentId oldActiveContextDocumentId, DocumentId newActiveContextDocumentId)
Workspace\Workspace_Registration.cs (5)
15private static readonly ConditionalWeakTable<SourceTextContainer, WorkspaceRegistration> s_bufferToWorkspaceRegistrationMap = new(); 20public static bool TryGetWorkspace(SourceTextContainer textContainer, [NotNullWhen(true)] out Workspace? workspace) 36protected void RegisterText(SourceTextContainer textContainer) 51protected void UnregisterText(SourceTextContainer textContainer) 69public static WorkspaceRegistration GetWorkspaceRegistration(SourceTextContainer textContainer)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
Workspaces\TestWorkspace`1.cs (2)
245public new void RegisterText(SourceTextContainer text) 285public new void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true)
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
SolutionTests\SolutionWithSourceGeneratorTests.cs (5)
595var differentOpenTextContainer = SourceText.From("// Open Text").Container; 619var differentOpenTextContainer = SourceText.From("// StaticContent", Encoding.UTF8).Container; 639var differentOpenTextContainer = SourceText.From("// Open Text").Container; 670var differentOpenTextContainer = SourceText.From("// Open Text").Container; 697var differentOpenTextContainer = SourceText.From("// Open Text").Container;
Microsoft.VisualStudio.LanguageServices (17)
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
20public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer)
ExternalAccess\VSTypeScript\Api\VSTypeScriptVisualStudioProjectWrapper.cs (2)
27public DocumentId AddSourceTextContainer(SourceTextContainer sourceTextContainer, string fullPath, bool isLspContainedDocument = false) 36public void RemoveSourceTextContainer(SourceTextContainer sourceTextContainer)
Implementation\VisualStudioSupportsFeatureService.cs (2)
55var sourceTextContainer = textBuffer.AsTextContainer(); 70var sourceTextContainer = textBuffer.AsTextContainer();
Preview\PreviewUpdater.cs (2)
76ApplyDocumentToBuffer(document, out var container); 80private void ApplyDocumentToBuffer(TextDocument document, out SourceTextContainer container)
ProjectSystem\MiscellaneousFilesWorkspace.cs (4)
48/// The mapping of all monikers in the RDT and the <see cref="ProjectId"/> of the project and <see cref="SourceTextContainer"/> of the open 51private readonly Dictionary<string, (ProjectId projectId, SourceTextContainer textContainer)> _monikersToProjectIdAndContainer = new Dictionary<string, (ProjectId, SourceTextContainer)>(); 279var sourceTextContainer = textBuffer.AsTextContainer();
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (1)
156var textContainer = textBuffer.AsTextContainer();
Snippets\AbstractSnippetCommandHandler.cs (1)
311var textContainer = args.SubjectBuffer.AsTextContainer();
ValueTracking\ValueTrackingCommandHandler.cs (1)
93var sourceTextContainer = args.SubjectBuffer.AsTextContainer();
Venus\ContainedDocument.cs (1)
163public SourceTextContainer GetOpenTextContainer()
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
74var container = document.GetTextSynchronously(CancellationToken.None).Container;
Workspace\VisualStudioActiveDocumentTracker.cs (1)
243var textContainer = TextBuffer.AsTextContainer();
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Client\RemoteLanguageServiceWorkspace.cs (2)
219var textContainer = textBuffer.AsTextContainer(); 482var textContainer = sourceText.Container;
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\XamlProjectService.cs (1)
175var textContainer = textBuffer?.AsTextContainer();