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