125 references to GetTextBuffer
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (48)
AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (2)
40pasteTrackingService.RegisterPastedTextSpan(hostDocument.GetTextBuffer(), default); 41pasteTrackingService.RegisterPastedTextSpan(hostDocument.GetTextBuffer(), pastedTextSpan);
Classification\SyntacticTaggerTests.cs (2)
40var subjectBuffer = document.GetTextBuffer(); 92var subjectBuffer = document.GetTextBuffer();
Classification\TotalClassifierTests.cs (2)
3064var buffer = document.GetTextBuffer(); 3168var buffer = document.GetTextBuffer();
CodeActions\PreviewExceptionTests.cs (1)
109textBuffer = workspace.GetTestDocument(document.Id).GetTextBuffer();
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
71var expectedText = workspace.Documents[0].GetTextBuffer().CurrentSnapshot.GetText();
CommentSelection\CSharpCommentSelectionTests.cs (2)
140var textBuffer = doc.GetTextBuffer(); 143Assert.Equal(expected, doc.GetTextBuffer().CurrentSnapshot.GetText());
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3265var textBuffer = workspace.Documents.Single().GetTextBuffer();
Completion\CompletionProviders\SymbolCompletionProviderTests_NoInteractive.cs (1)
383var edit = testDocument.GetTextBuffer().CreateEdit();
Debugging\ProximityExpressionsGetterTests.cs (1)
74var snapshot = testDocument.GetTextBuffer().CurrentSnapshot;
EditAndContinue\ActiveStatementTrackingServiceTests.cs (2)
60var textBuffer1 = testDocument1.GetTextBuffer(); 61var textBuffer2 = testDocument2.GetTextBuffer();
EncapsulateField\EncapsulateFieldTestState.cs (2)
57var args = new EncapsulateFieldCommandArgs(_testDocument.GetTextView(), _testDocument.GetTextBuffer()); 71Assert.Equal(expected, _testDocument.GetTextBuffer().CurrentSnapshot.GetText().ToString());
ExtractMethod\ExtractMethodBase.cs (2)
49var subjectBuffer = testDocument.GetTextBuffer(); 83var subjectBuffer = testDocument.GetTextBuffer();
Formatting\FormattingEngineTests.cs (3)
2920var typedChar = subjectDocument.GetTextBuffer().CurrentSnapshot.GetText(subjectDocument.CursorPosition!.Value - 1, 1); 2926commandHandler.ExecuteCommand(new TypeCharCommandArgs(textView, subjectDocument.GetTextBuffer(), typedChar[0]), () => { }, TestCommandExecutionContext.Create()); 2928var newSnapshot = subjectDocument.GetTextBuffer().CurrentSnapshot;
Formatting\Indentation\CSharpFormatterTestsBase.cs (1)
119var buffer = workspace.Documents.First().GetTextBuffer();
Formatting\Indentation\SmartIndenterEnterOnTokenTests.cs (2)
1402var buffer = hostdoc.GetTextBuffer(); 1441var buffer = hostdoc.GetTextBuffer();
Formatting\Indentation\SmartIndenterTests.cs (2)
3471var indentationLine = projectedDocument.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(projectedDocument.CursorPosition.Value); 3473var buffer = subjectDocument.GetTextBuffer();
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (2)
3375var textBuffer = subjectDocument.GetTextBuffer(); 3409var buffer = testDocument.GetTextBuffer();
Formatting\Indentation\SmartTokenFormatterFormatTokenTests.cs (1)
613var buffer = workspace.Documents.First().GetTextBuffer();
Intents\IntentTestsBase.cs (2)
70var documentBuffer = workspace.GetTestDocument(documentChange.Key)!.GetTextBuffer(); 113var currentTextBuffer = testDocument.GetTextBuffer();
Interactive\BraceMatching\InteractiveBraceHighlightingTests.cs (4)
54var buffer = workspace.Documents.First().GetTextBuffer(); 82var buffer = workspace.Documents.First().GetTextBuffer(); 111var buffer = workspace.Documents.First().GetTextBuffer(); 167var buffer = workspace.Documents.First().GetTextBuffer();
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
55var buffer = testDocument.GetTextBuffer();
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (2)
105var history = undoHistoryRegistry.GetHistory(document.GetTextBuffer()); 108var currentSnapshot = document.GetTextBuffer().CurrentSnapshot;
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (1)
183var textBuffer = document.GetTextBuffer();
TextStructureNavigation\TextStructureNavigatorTests.cs (1)
508var buffer = workspace.Documents.First().GetTextBuffer();
Workspaces\WorkspaceTests_EditorFeatures.cs (7)
506var buffer1 = document1.GetTextBuffer(); 563var buffer1 = document1.GetTextBuffer(); 633var buffer1 = document1.GetTextBuffer(); 699var buffer = document.GetTextBuffer(); 725var buffer = document.GetTextBuffer(); 1118var buffer = additionalDoc.GetTextBuffer(); 1151var buffer = analyzerConfigDoc.GetTextBuffer();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (30)
AbstractCommandHandlerTestState.cs (1)
79_subjectBuffer = cursorDocument.GetTextBuffer();
AutomaticCompletion\AbstractAutomaticBraceCompletionTests.cs (1)
153var openingPoint = new SnapshotPoint(document.GetTextBuffer().CurrentSnapshot, document.CursorPosition.Value);
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (1)
76var buffer = workspace.Documents.Single().GetTextBuffer();
BraceHighlighting\AbstractBraceHighlightingTests.cs (1)
44var buffer = testDocument.GetTextBuffer();
CommentSelection\AbstractToggleCommentTestBase.cs (2)
42var textBuffer = doc.GetTextBuffer(); 47AssertCommentResult(doc.GetTextBuffer(), textView, expectedText[i]);
Completion\AbstractCompletionProviderTests.cs (2)
898var textContainer = testWorkspace.Documents.First().GetTextBuffer().AsTextContainer(); 1046var text = hostDocument.GetTextBuffer().CurrentSnapshot.AsText();
Formatting\CoreFormatterTestsBase.cs (5)
60var snapshot = subjectDocument.GetTextBuffer().CurrentSnapshot; 80var textBuffer = document.GetTextBuffer(); 142var buffer = workspace.Documents.First().GetTextBuffer(); 181var buffer = hostdoc.GetTextBuffer(); 249var buffer = workspace.Documents.First().GetTextBuffer();
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
49var textSnapshot = testDocument.GetTextBuffer().CurrentSnapshot;
SpellCheck\AbstractSpellCheckFixerProviderTests.cs (1)
41var buffer = document.GetTextBuffer();
Squiggles\SquiggleUtilities.cs (1)
39var textBuffer = firstDocument.GetTextBuffer();
Squiggles\TestDiagnosticTagProducer.cs (1)
31var sourceText = document.GetTextBuffer().CurrentSnapshot.AsText();
TaskList\AbstractTaskListTests.cs (1)
35var initialTextSnapshot = hostDocument.GetTextBuffer().CurrentSnapshot;
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (1)
28var buffer = document.GetTextBuffer();
Workspaces\EditorTestHostDocument.cs (5)
127_textView = factory.CreateTextView(this.GetTextBuffer(), roles); 197=> this.GetTextBuffer().AsTextContainer(); 201using var edit = this.GetTextBuffer().CreateEdit(EditOptions.DefaultMinimalChange, reiteratedVersionNumber: null, editTag: null); 202edit.Replace(new Span(0, this.GetTextBuffer().CurrentSnapshot.Length), newText); 217var buffer = GetTextBuffer();
Workspaces\EditorTestWorkspace.cs (3)
268var snapshotSpan = span.ToSnapshotSpan(document.GetTextBuffer().CurrentSnapshot); 283var snapshotSpan = span.ToSnapshotSpan(document.GetTextBuffer().CurrentSnapshot); 370var trackingSpan = documentWithSpan.GetTextBuffer().CurrentSnapshot.CreateTrackingSpan(span, SpanTrackingMode.EdgeExclusive);
Workspaces\TestWorkspaceFixture.cs (3)
45Code = _currentDocument.GetTextBuffer().CurrentSnapshot.GetText(); 85UpdateText(hostDocument.GetTextBuffer(), string.Empty); 89UpdateText(hostDocument.GetTextBuffer(), text);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (19)
RenameTracking\RenameTrackingTaggerProviderTests.cs (11)
640Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 663Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 686Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 709Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 737Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 771Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 804Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 1036Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 1067Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 1106Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText()); 1538Assert.Equal(expectedCode, state.HostDocument.GetTextBuffer().CurrentSnapshot.GetText());
RenameTracking\RenameTrackingTestState.cs (1)
105_tagger = tracker.CreateTagger<RenameTrackingTag>(HostDocument.GetTextBuffer());
Tagging\AsynchronousTaggerTests.cs (5)
79var textBuffer = document.GetTextBuffer(); 108var textBuffer = document.GetTextBuffer(); 134var textBuffer = document.GetTextBuffer(); 186var textBuffer = testDocument.GetTextBuffer(); 233var textBuffer = testDocument.GetTextBuffer();
TextEditor\TryGetDocumentTests.cs (2)
28var buffer = hostDocument.GetTextBuffer(); 56var buffer = hostDocument.GetTextBuffer();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (3)
CodeModel\AbstractFileCodeElementTests.cs (1)
91return (GetWorkspace()).Documents.Single().GetTextBuffer().CurrentSnapshot.GetText();
CodeModel\MockInvisibleEditor.cs (1)
27return _workspace.GetTestDocument(_documentId).GetTextBuffer();
DocumentOutline\DocumentOutlineTestsBase.cs (1)
56TextBuffer = workspace.Documents.Single().GetTextBuffer();
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CodeModel\Mocks\MockVisualStudioWorkspace.vb (1)
112Return Me._workspace.GetTestDocument(Me._documentId).GetTextBuffer()
Microsoft.VisualStudio.LanguageServices.UnitTests (24)
ClassView\SyncClassViewTests.vb (1)
875Dim subjectBuffer = hostDocument.GetTextBuffer()
Snippets\SnippetExpansionClientTestsHelper.vb (10)
20Dim snippetStartLine = surfaceBufferDocument.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(snippetSpanInSurfaceBuffer.Start) 21Dim snippetEndLine = surfaceBufferDocument.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(snippetSpanInSurfaceBuffer.Start) 33Dim endPositionLine = surfaceBufferDocument.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(endPositionInSurfaceBuffer) 46Assert.Equal(expectedSurfaceBuffer.NormalizedValue, surfaceBufferDocument.GetTextBuffer().CurrentSnapshot.GetText) 58Dim cursorLine = document.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(cursorPosition) 71Dim snippetStartLine = document.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(snippetSpan.Start) 72Dim snippetEndLine = document.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(snippetSpan.End) 84Dim endPositionLine = document.GetTextBuffer().CurrentSnapshot.GetLineFromPosition(endPosition) 99Dim formattedEndPositionLine = document.GetTextBuffer().CurrentSnapshot.GetLineFromLineNumber(finalEndSpan(0).iStartLine) 104Assert.Equal(expectedResult.NormalizedValue, document.GetTextBuffer().CurrentSnapshot.GetText)
Venus\DocumentServiceTests.vb (13)
37Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer()) 61Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer()) 93Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer()) 137Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer()) 144Assert.Equal(projectedDocument.GetTextBuffer().CurrentSnapshot.GetText(), content) 175Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer()) 183Assert.Equal(projectedDocument.GetTextBuffer().CurrentSnapshot.GetText(), content) 223Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer()) 233Dim expectedContent = projectedDocument.GetTextBuffer().CurrentSnapshot.GetText(contentSpan.ToSpan()) 236Dim firstText = projectedDocument.GetTextBuffer().CurrentSnapshot.GetText(GetNamedSpan(projectedDocument, "WithoutLeadingWhitespace").ToSpan()) 238Dim lastText = projectedDocument.GetTextBuffer().CurrentSnapshot.GetText(Span.FromBounds(documentSpan.End, projectedDocument.GetTextBuffer().CurrentSnapshot.Length)) 276Dim service = New ContainedDocument.DocumentServiceProvider(projectedDocument.GetTextBuffer())