1 write to SelectedSpans
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestHostDocument.cs (1)
119
this.
SelectedSpans
= textSpans;
52 references to SelectedSpans
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (15)
AddMissingImports\CSharpAddMissingImportsRefactoringProviderTests.cs (1)
40
var pastedTextSpan = hostDocument.
SelectedSpans
.FirstOrDefault();
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (1)
845
var textSpan = workspace.Documents[0].
SelectedSpans
[0];
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (2)
144
var project = workspace.Documents.Single(doc => !doc.
SelectedSpans
.IsEmpty()).Project;
154
var originalDocument = workspace.Documents.Single(doc => !doc.
SelectedSpans
.IsEmpty());
CommentSelection\CSharpCommentSelectionTests.cs (1)
114
SetupSelection(doc.GetTextView(), doc.
SelectedSpans
.Select(s => Span.FromBounds(s.Start, s.End)));
EncapsulateField\EncapsulateFieldTestState.cs (1)
34
_testDocument = Workspace.Documents.Single(d => d.CursorPosition.HasValue || d.
SelectedSpans
.Any());
ExtractMethod\ExtractMethodBase.cs (2)
42
var textSpan = testDocument.
SelectedSpans
.Single();
134
document, testDocument.
SelectedSpans
.Single(), localFunction, options, CancellationToken.None);
ExtractMethod\ExtractMethodMiscellaneousTests.cs (2)
127
view.TextBuffer.CurrentSnapshot, testDocument.
SelectedSpans
[0].Start, testDocument.
SelectedSpans
[0].Length), isReversed: false);
FixInterpolatedVerbatimString\FixInterpolatedVerbatimStringCommandHandlerTests.cs (1)
30
view.SetSelection(document.
SelectedSpans
.Single().ToSnapshotSpan(view.TextBuffer.CurrentSnapshot));
Formatting\FormattingEngineTests.cs (1)
340
var spans = subjectDocument.
SelectedSpans
;
Formatting\Indentation\SmartIndenterTests.cs (1)
3424
provider.TextSpan = subjectDocument.
SelectedSpans
.Single();
MoveToNamespace\MoveToNamespaceTests.cs (1)
1283
testState.TestInvocationDocument.
SelectedSpans
.Single(),
SplitStringLiteral\SplitStringLiteralCommandHandlerTests.cs (1)
76
var originalSelections = document.
SelectedSpans
;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Testing\CSharpTestMethodFinderTests.cs (2)
466
var span = testDocument.CursorPosition != null ? new TextSpan(testDocument.CursorPosition.Value, 0) : testDocument.
SelectedSpans
.Single();
480
var span = testDocument.CursorPosition != null ? new TextSpan(testDocument.CursorPosition.Value, 0) : testDocument.
SelectedSpans
.Single();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (22)
AbstractCommandHandlerTestState.cs (2)
77
var cursorDocument = Workspace.Documents.First(d => d.CursorPosition.HasValue || d.
SelectedSpans
.Any(ss => ss.IsEmpty));
81
var cursorPosition = cursorDocument.CursorPosition ?? cursorDocument.
SelectedSpans
.First(ss => ss.IsEmpty).Start;
CommentSelection\AbstractToggleCommentTestBase.cs (2)
38
SetupSelection(doc.GetTextView(), doc.
SelectedSpans
.Select(s => Span.FromBounds(s.Start, s.End)));
55
SetupSelection(document.GetTextView(), document.
SelectedSpans
.Select(s => Span.FromBounds(s.Start, s.End)));
CompleteStatement\AbstractCompleteStatementTests.cs (4)
103
Assert.True(testDocument.CursorPosition.HasValue || testDocument.
SelectedSpans
.Any(), "No caret position or selected spans are set!");
104
var startCaretPosition = testDocument.CursorPosition ?? testDocument.
SelectedSpans
.Last().End;
108
if (testDocument.
SelectedSpans
.Any())
110
var selectedSpan = testDocument.
SelectedSpans
[0];
Debugging\AbstractDataTipInfoGetterTests.cs (2)
61
var expectedSpan = testHostDocument.
SelectedSpans
.Any()
62
? testHostDocument.
SelectedSpans
.Single()
DocumentationComments\AbstractDocumentationCommentTests.cs (2)
148
if (testDocument.
SelectedSpans
.Any())
150
var selectedSpan = testDocument.
SelectedSpans
[0];
GoToAdjacentMember\AbstractGoToAdjacentMemberTests.cs (1)
50
Assert.Equal(hostDocument.
SelectedSpans
.Single().Start, targetPosition.Value);
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
45
var expectedHighlightSpans = testDocument.
SelectedSpans
.ToList();
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
40
var expectedSpans = workspace.Documents[i].
SelectedSpans
.OrderBy(s => s.Start);
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
39
var expectedSpans = workspace.Documents[i].
SelectedSpans
.OrderBy(s => s.Start);
SignatureHelp\AbstractSignatureHelpProviderTests.cs (2)
360
var selectedSpans = testWorkspace.Documents.First(d => d.Name == "SourceDocument").
SelectedSpans
;
478
var selectedSpans = testWorkspace.Documents.Single(d => d.Name == "SourceDocument").
SelectedSpans
;
TaskList\AbstractTaskListTests.cs (1)
42
var expectedLists = hostDocument.
SelectedSpans
;
Workspaces\EditorTestHostDocument.cs (2)
134
else if (this.
SelectedSpans
.IsSingle())
136
var span = this.
SelectedSpans
.Single();
Workspaces\EditorTestWorkspace.cs (1)
295
foreach (var span in document.
SelectedSpans
)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (10)
CodeGeneration\CodeGenerationTests.cs (3)
902
var destSpan = Workspace.Documents.Single().
SelectedSpans
.Single();
908
var destSpan = Workspace.Documents.Single().
SelectedSpans
.Single();
935
var destSpan = Workspace.Documents.Single().
SelectedSpans
.Single();
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
319
var symbol = semanticModel.GetSymbolInfo(syntaxRoot.FindNode(testDocument.
SelectedSpans
.Single())).Symbol;
RenameTracking\RenameTrackingTaggerProviderTests.cs (5)
380
var textSpan = state.HostDocument.
SelectedSpans
.Single();
394
var textSpan = state.HostDocument.
SelectedSpans
.Single();
408
var textSpan = state.HostDocument.
SelectedSpans
.Single();
428
var textSpan = state.HostDocument.
SelectedSpans
.Single();
843
var textSpan = state.HostDocument.
SelectedSpans
.Single();
StackTraceExplorer\StackTraceExplorerTests.cs (1)
45
var selectedSpan = cursorDoc.
SelectedSpans
.Single();
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
RelatedDocuments\AbstractRelatedDocumentsTests.cs (1)
48
var expectedSortedResults = workspace.Documents.Where(d => d.
SelectedSpans
.Count > 0).Select(d => d.Id).OrderBy(d => d.Id);
SolutionExplorer\AbstractSolutionExplorerSymbolTreeItemProviderTests.cs (1)
43
testDocument.
SelectedSpans
,
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
F1Help\F1HelpTests.cs (1)
30
var actualText = await service.GetHelpTermAsync(workspace.CurrentSolution.Projects.First().Documents.First(), workspace.Documents.First().
SelectedSpans
.First(), CancellationToken.None);