1 write to SelectedSpans
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
143this.SelectedSpans = spans[string.Empty];
129 references to SelectedSpans
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (8)
AbstractCodeActionOrUserDiagnosticTest.cs (2)
902var hostDocument = workspace.Documents.FirstOrDefault(d => d.SelectedSpans.Any()); 920span = hostDocument.SelectedSpans.Single();
AbstractDiagnosticProviderBasedUserDiagnosticTest.cs (2)
218var hostDocument = workspace.Documents.Single(d => d.SelectedSpans.Any()); 219var expected = hostDocument.SelectedSpans.Single();
AbstractUserDiagnosticTest.cs (4)
55var hostDocumentsWithAnnotations = workspace.Documents.Where(d => d.SelectedSpans.Any()); 58var expectedSpan = hostDocumentsWithAnnotations.Single().SelectedSpans.Single(); 112var hostDocument = workspace.Documents.Single(d => d.SelectedSpans.Any()); 113span = hostDocument.SelectedSpans.Single();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (18)
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
919var textSpan = workspace.Documents[0].SelectedSpans[0];
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (2)
144var project = workspace.Documents.Single(doc => !doc.SelectedSpans.IsEmpty()).Project; 154var originalDocument = workspace.Documents.Single(doc => !doc.SelectedSpans.IsEmpty());
CodeRefactorings\AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (1)
37var pastedTextSpan = hostDocument.SelectedSpans.FirstOrDefault();
CommentSelection\CSharpCommentSelectionTests.cs (1)
119SetupSelection(doc.GetTextView(), doc.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End)));
Debugging\DataTipInfoGetterTests.cs (2)
51var expectedSpan = testHostDocument.SelectedSpans.Any() 52? testHostDocument.SelectedSpans.Single()
EncapsulateField\EncapsulateFieldTestState.cs (1)
34_testDocument = Workspace.Documents.Single(d => d.CursorPosition.HasValue || d.SelectedSpans.Any());
ExtractMethod\ExtractMethodBase.cs (2)
42var textSpan = testDocument.SelectedSpans.Single(); 141var validator = new CSharpSelectionValidator(semanticDocument, testDocument.SelectedSpans.Single(), options.ExtractOptions, localFunction: false);
ExtractMethod\MiscTests.cs (2)
133view.TextBuffer.CurrentSnapshot, testDocument.SelectedSpans[0].Start, testDocument.SelectedSpans[0].Length), isReversed: false);
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandlerTests.cs (1)
33view.SetSelection(document.SelectedSpans.Single().ToSnapshotSpan(view.TextBuffer.CurrentSnapshot));
Formatting\FormattingEngineTests.cs (1)
416var spans = subjectDocument.SelectedSpans;
Formatting\Indentation\SmartIndenterTests.cs (1)
3489provider.TextSpan = subjectDocument.SelectedSpans.Single();
MoveToNamespace\MoveToNamespaceTests.cs (1)
1175testState.TestInvocationDocument.SelectedSpans.Single(),
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (1)
82var originalSelections = document.SelectedSpans;
SuggestionTags\SuggestionTagProducerTests.cs (1)
55return (spans, workspace.Documents.Single().SelectedSpans.Single());
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (12)
CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs (2)
902var hostDocument = workspace.Documents.FirstOrDefault(d => d.SelectedSpans.Any()); 920span = hostDocument.SelectedSpans.Single();
Diagnostics\AbstractDiagnosticProviderBasedUserDiagnosticTest.cs (2)
218var hostDocument = workspace.Documents.Single(d => d.SelectedSpans.Any()); 219var expected = hostDocument.SelectedSpans.Single();
Diagnostics\AbstractUserDiagnosticTest.cs (4)
55var hostDocumentsWithAnnotations = workspace.Documents.Where(d => d.SelectedSpans.Any()); 58var expectedSpan = hostDocumentsWithAnnotations.Single().SelectedSpans.Single(); 112var hostDocument = workspace.Documents.Single(d => d.SelectedSpans.Any()); 113span = hostDocument.SelectedSpans.Single();
MoveToNamespace\AbstractMoveToNamespaceTests.cs (2)
52testState.TestInvocationDocument.SelectedSpans.Single(), 110testState.TestInvocationDocument.SelectedSpans.Single().Start,
MoveType\AbstractMoveTypeTest.cs (1)
99var spans = workspace.Documents[0].SelectedSpans;
SplitComments\AbstractSplitCommentCommandHandlerTests.cs (1)
65var originalSelections = document.SelectedSpans;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (19)
AbstractCommandHandlerTestState.cs (2)
80var cursorDocument = Workspace.Documents.First(d => d.CursorPosition.HasValue || d.SelectedSpans.Any(ss => ss.IsEmpty)); 84var cursorPosition = cursorDocument.CursorPosition ?? cursorDocument.SelectedSpans.First(ss => ss.IsEmpty).Start;
CommentSelection\AbstractToggleCommentTestBase.cs (2)
41SetupSelection(doc.GetTextView(), doc.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End))); 60SetupSelection(document.GetTextView(), document.SelectedSpans.Select(s => Span.FromBounds(s.Start, s.End)));
CompleteStatement\AbstractCompleteStatementTests.cs (4)
86Assert.True(testDocument.CursorPosition.HasValue || testDocument.SelectedSpans.Any(), "No caret position or selected spans are set!"); 87var startCaretPosition = testDocument.CursorPosition ?? testDocument.SelectedSpans.Last().End; 91if (testDocument.SelectedSpans.Any()) 93var selectedSpan = testDocument.SelectedSpans[0];
DocumentationComments\AbstractDocumentationCommentTests.cs (2)
153if (testDocument.SelectedSpans.Any()) 155var selectedSpan = testDocument.SelectedSpans[0];
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (1)
53Assert.Equal(hostDocument.SelectedSpans.Single().Start, targetPosition.Value);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
46var expectedHighlightSpans = testDocument.SelectedSpans.ToList();
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
34var expectedSpans = workspace.Documents.Single().SelectedSpans.OrderBy(s => s.Start);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
361var selectedSpans = testWorkspace.Documents.First(d => d.Name == "SourceDocument").SelectedSpans; 478var selectedSpans = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").SelectedSpans;
TaskList\AbstractTaskListTests.cs (1)
44var expectedLists = hostDocument.SelectedSpans;
Workspaces\TestHostDocument.cs (2)
241else if (this.SelectedSpans.IsSingle()) 243var span = this.SelectedSpans.Single();
Workspaces\TestWorkspace.cs (1)
483foreach (var span in document.SelectedSpans)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
CodeGeneration\CodeGenerationTests.cs (3)
899var destSpan = Workspace.Documents.Single().SelectedSpans.Single(); 905var destSpan = Workspace.Documents.Single().SelectedSpans.Single(); 932var destSpan = Workspace.Documents.Single().SelectedSpans.Single();
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
328var symbol = semanticModel.GetSymbolInfo(syntaxRoot.FindNode(testDocument.SelectedSpans.Single())).Symbol;
RenameTracking\RenameTrackingTaggerProviderTests.cs (5)
358var textSpan = state.HostDocument.SelectedSpans.Single(); 371var textSpan = state.HostDocument.SelectedSpans.Single(); 384var textSpan = state.HostDocument.SelectedSpans.Single(); 403var textSpan = state.HostDocument.SelectedSpans.Single(); 809var textSpan = state.HostDocument.SelectedSpans.Single();
StackTraceExplorer\StackTraceExplorerTests.cs (1)
47var selectedSpan = cursorDoc.SelectedSpans.Single();
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (26)
Classification\ClassificationTests.vb (2)
45Dim referenceSpan = workspace.Documents.Single().SelectedSpans.Single() 218Dim referenceSpan = workspace.Documents.Single().SelectedSpans.Single()
Classification\SyntacticChangeRangeComputerTests.vb (1)
21Dim spans = testDocument.SelectedSpans
CodeDefinitionWindow\AbstractCodeDefinitionWindowTests.vb (2)
89Dim expectedHostDocument = workspace.Documents.Single(Function(d) d.SelectedSpans.Any()) 91Dim expectedSpan = (Await expectedDocument.GetSyntaxTreeAsync()).GetLocation(expectedHostDocument.SelectedSpans.Single()).GetLineSpan()
FindReferences\FindReferencesTests.vb (4)
94workspace.Documents.Where(Function(d) d.SelectedSpans.Any()). 97d.Name, d.SelectedSpans.ToList())).ToList() 326Dim expectedDocuments = workspace.Documents.Where(Function(d) d.SelectedSpans.Any()) 330Dim expectedSpans = doc.SelectedSpans.Order()
GoToDefinition\GoToDefinitionTestsBase.vb (5)
59For Each selectedSpan In testDocument.SelectedSpans 78Assert.Single(definitionDocument.SelectedSpans) 79Assert.Equal(definitionDocument.SelectedSpans.Single(), mockDocumentNavigationService._span) 85Assert.Single(definitionDocument.SelectedSpans) 86Dim expected = definitionDocument.SelectedSpans.Single()
GoToHelpers\GoToHelpers.vb (1)
44Function(d) d.SelectedSpans.Select(Function(ss) New FilePathAndSpan(d.FilePath, ss))).ToList()
KeywordHighlighting\AbstractKeywordHighlightingTests.vb (1)
53For Each span In hostDocument.SelectedSpans
Rename\RenameCommandHandlerTests.vb (4)
97Dim selectedSpan = workspace.Documents.Single(Function(d) d.SelectedSpans.Any()).SelectedSpans.Single().ToSnapshotSpan(document.GetTextBuffer().CurrentSnapshot) 123Dim selectedSpan = workspace.Documents.Single(Function(d) d.SelectedSpans.Any()).SelectedSpans.Single().ToSnapshotSpan(document.GetTextBuffer().CurrentSnapshot)
Rename\RenameEngineResult.vb (1)
155For Each span In documentWithSpans.SelectedSpans
Rename\RenameTagProducerTests.vb (4)
33Dim expectedSpans = actualWorkspace.Documents.Single(Function(d) d.SelectedSpans.Any()).SelectedSpans.Select(Function(ts) ts.ToSpan()) 38Dim expectedSpans = expectedTaggedWorkspace.Documents.Single(Function(d) d.SelectedSpans.Any()).SelectedSpans.Select(Function(ts) ts.ToSpan())
UnitTesting\UnitTestingSearchHelpersTests.vb (1)
21Dim expectedLocations = workspace.Documents.Single().SelectedSpans
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests (1)
Utilities\TestLsifOutput.vb (1)
116Return GetRangesAsync(Function(testDocument) testDocument.SelectedSpans)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (15)
AutomaticEndConstructCorrection\AutomaticEndConstructCorrectorTests.vb (5)
340Dim spanToRemove = document.SelectedSpans.Single(Function(s) s.Contains(caretPosition.GetPosition(initialTextSnapshot))) 349For Each span In document.SelectedSpans.Skip(1) 356Dim beginSpan = document.SelectedSpans.First() 380Dim selectedSpans = document.SelectedSpans 393Dim selectedSpans = document.SelectedSpans
CodeRefactorings\AddMissingImports\VisualBasicAddMissingImportsRefactoringProviderTests.vb (1)
29Dim pastedTextSpan = hostDocument.SelectedSpans.FirstOrDefault()
EncapsulateField\EncapsulateFieldTestState.vb (1)
24_testDocument = workspace.Documents.Single(Function(d) d.CursorPosition.HasValue OrElse d.SelectedSpans.Any())
ExtractMethod\ExtractMethodTests.vb (1)
62Dim textSpan = document.SelectedSpans.First()
Formatting\Indentation\SmartIndenterTests.vb (1)
2991factory.TextSpan = subjectDocument.SelectedSpans.Single()
Formatting\VisualBasicFormatterTestBase.vb (2)
66workspace.Documents.First(Function(d) d.SelectedSpans.Any()).SelectedSpans,
LineCommit\CommitTestData.vb (3)
143If _testWorkspace.Documents.Any(Function(d) d.SelectedSpans.Any()) Then 144Dim expectedSpan = _testWorkspace.Documents.Single(Function(d) d.SelectedSpans.Any()).SelectedSpans.Single()
LineCommit\CommitWithViewTests.vb (1)
789Dim onlyTextSpan = document.SelectedSpans.First()
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
F1Help\F1HelpTests.cs (1)
32var actualText = await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None);
Microsoft.VisualStudio.LanguageServices.UnitTests (19)
AbstractTextViewFilterTests.vb (7)
47Dim matchingSpan = projected.SelectedSpans.Single() 77Dim span = doc.SelectedSpans.Single() 107Dim span = doc.SelectedSpans.Single() 139Dim span = doc.SelectedSpans.Single() 169Dim span = doc.SelectedSpans.Single() 204Dim span = doc.SelectedSpans.Single() 235Dim span = doc.SelectedSpans.Single()
DebuggerIntelliSense\TestState.vb (2)
40Dim spanDocument = Workspace.Documents.First(Function(x) x.SelectedSpans.Any()) 41Dim statementSpan = spanDocument.SelectedSpans.First()
Help\HelpTests.vb (1)
21Assert.Equal(expected, Await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().Documents.First(), workspace.Documents.First().SelectedSpans.First(), CancellationToken.None))
LanguageBlockTests.vb (1)
278Assert.Equal(hostDocument.SelectedSpans.Single(), tuple.Value.span)
Snippets\SnippetExpansionClientTestsHelper.vb (2)
19Dim snippetSpanInSurfaceBuffer = surfaceBufferDocument.SelectedSpans(0) 70Dim snippetSpan = document.SelectedSpans(0)
Venus\DocumentService_IntegrationTests.vb (6)
87Dim referenceSpan = definitionDocument.SelectedSpans.First() 153Dim referenceSpan = definitionDocument.SelectedSpans.First() 284ElseIf testDocument.SelectedSpans.First() = span Then 285Dim mappedSpan = mappedTestDocument.SelectedSpans.First() 319ElseIf testDocument.SelectedSpans.First() = span Then 320mappedSpan = mappedTestDocument.SelectedSpans.First()