117 references to AnnotatedSpans
Microsoft.CodeAnalysis.CodeStyle.LegacyTestFramework.UnitTestUtilities (2)
AbstractCodeActionOrUserDiagnosticTest.cs (2)
927var annotatedDocuments = workspace.Documents.Where(d => d.AnnotatedSpans.Any()); 929var annotatedSpan = hostDocument.AnnotatedSpans.Single();
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2884var expectedSpans = workspace.Documents.First().AnnotatedSpans;
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (5)
ExtractMethod\ExtractMethodBase.cs (1)
170var namedSpans = testDocument.AnnotatedSpans;
Intents\IntentTestsBase.cs (1)
113var priorSelection = testDocument.AnnotatedSpans["priorSelection"].Single();
RemoveUnnecessaryExpressionParenthesesTests.cs (1)
2884var expectedSpans = workspace.Documents.First().AnnotatedSpans;
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (2)
94var copyDocument = this.Workspace.Documents.FirstOrDefault(d => d.AnnotatedSpans.ContainsKey("Copy")); 98var copySpans = copyDocument.AnnotatedSpans["Copy"];
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (2)
CodeActions\AbstractCodeActionOrUserDiagnosticTest.cs (2)
927var annotatedDocuments = workspace.Documents.Where(d => d.AnnotatedSpans.Any()); 929var annotatedSpan = hostDocument.AnnotatedSpans.Single();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (20)
AbstractCommandHandlerTestState.cs (1)
88if (cursorDocument.AnnotatedSpans.TryGetValue("Selection", out var selectionSpanList))
BracePairs\AbstractBracePairsTests.cs (1)
39var expected = workspace.Documents.Single().AnnotatedSpans;
CodeLens\AbstractCodeLensTest.cs (8)
25foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 29foreach (var annotatedSpan in annotatedDocument.AnnotatedSpans) 55foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 59foreach (var annotatedSpan in annotatedDocument.AnnotatedSpans) 83foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 87foreach (var annotatedSpan in annotatedDocument.AnnotatedSpans) 111foreach (var annotatedDocument in workspace.Documents.Where(d => d.AnnotatedSpans.Any())) 115foreach (var annotatedSpan in annotatedDocument.AnnotatedSpans)
KeywordHighlighting\AbstractKeywordHighlighterTests.cs (1)
49var cursorSpan = testDocument.AnnotatedSpans["Cursor"].Single();
LanguageServer\AbstractLanguageServerProtocolTests.cs (1)
423foreach (var (name, spans) in testDocument.AnnotatedSpans)
SpellCheck\AbstractSpellCheckFixerProviderTests.cs (1)
42var (replacement, span) = document.AnnotatedSpans.Single();
SpellCheck\AbstractSpellCheckSpanTests.cs (1)
27var annotations = workspace.Projects.Single().Documents.Single().AnnotatedSpans;
Structure\AbstractSyntaxStructureProviderTests.cs (1)
50var expectedRegions = expectedRegionData.Select(data => CreateBlockSpan(data, hostDocument.AnnotatedSpans)).ToArray();
TextStructureNavigation\AbstractTextStructureNavigationTests.cs (1)
38var annotatedSpans = document.AnnotatedSpans;
Workspaces\TestHostDocument.cs (1)
148this.AnnotatedSpans.Add(namedSpanList);
Workspaces\TestWorkspace.cs (3)
494foreach (var (key, spans) in document.AnnotatedSpans) 579var documentWithSpan = baseDocuments.FirstOrDefault(d => d.AnnotatedSpans.ContainsKey(spanName)); 587var matchingSpan = documentWithSpan.AnnotatedSpans[spanName].Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (1)
911var annotatedSpans = Workspace.Documents.Single().AnnotatedSpans[key];
InheritanceMargin\InheritanceMarginTests.cs (2)
102if (testHostDocument.AnnotatedSpans.TryGetValue(SearchAreaTag, out var spans) && spans.IsSingle()) 329var annotatedSpans = testHostDocument.AnnotatedSpans;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (58)
Classification\SyntacticChangeRangeComputerTests.vb (1)
24Dim annotatedSpans = testDocument.AnnotatedSpans
Expansion\AbstractExpansionTest.vb (5)
23If hostDocument.AnnotatedSpans.Count <> 1 Then 33If hostDocument.AnnotatedSpans.ContainsKey("Expand") Then 34For Each span In hostDocument.AnnotatedSpans("Expand") 38ElseIf hostDocument.AnnotatedSpans.ContainsKey("ExpandAndSimplify") Then 39For Each span In hostDocument.AnnotatedSpans("ExpandAndSimplify")
FindReferences\FindReferencesCommandHandlerTests.vb (4)
37testDocument.AnnotatedSpans("Selection").Single().ToSnapshotSpan(snapshot), isReversed:=False) 55Assert.Equal(testDocument.AnnotatedSpans("Definition").Single(), 57Assert.Equal(testDocument.AnnotatedSpans("Reference").Count, 60AssertEx.SetEqual(testDocument.AnnotatedSpans("Reference"),
FindReferences\FindReferencesTests.vb (26)
82workspace.Documents.Where(Function(d) d.AnnotatedSpans.ContainsKey(DefinitionKey) AndAlso d.AnnotatedSpans(DefinitionKey).Any()). 85d.Name, d.AnnotatedSpans(DefinitionKey).ToList())).ToList() 104Dim valueUsageInfoKeys = workspace.Documents.SelectMany(Function(d) d.AnnotatedSpans.Keys.Where(Function(key) key.StartsWith(ValueUsageInfoKey))) 107workspace.Documents.Where(Function(d) d.AnnotatedSpans.ContainsKey(key) AndAlso d.AnnotatedSpans(key).Any()). 110d.Name, d.AnnotatedSpans(key).ToList())).ToList() 118Dim typeOrNamespaceUsageInfoKeys = workspace.Documents.SelectMany(Function(d) d.AnnotatedSpans.Keys.Where(Function(key) key.StartsWith(TypeOrNamespaceUsageInfoKey))) 121workspace.Documents.Where(Function(d) d.AnnotatedSpans.ContainsKey(key) AndAlso d.AnnotatedSpans(key).Any()). 124d.Name, d.AnnotatedSpans(key).ToList())).ToList() 141workspace.Documents.Where(Function(d) d.AnnotatedSpans.ContainsKey(annotationKey) AndAlso d.AnnotatedSpans(annotationKey).Any()). 144d.Name, d.AnnotatedSpans(annotationKey).ToList())).ToList() 163Dim additionalPropertyKeys = workspace.Documents.SelectMany(Function(d) d.AnnotatedSpans.Keys.Where(Function(key) key.StartsWith(AdditionalPropertyKey)).Select(Function(key) key.Substring(AdditionalPropertyKey.Length))) 312Dim documentsWithAnnotatedSpans = workspace.Documents.Where(Function(d) d.AnnotatedSpans.Any()) 316Dim expected = If(doc.AnnotatedSpans.ContainsKey(DefinitionKey), doc.AnnotatedSpans(DefinitionKey), ImmutableArray(Of TextSpan).Empty).Order() 341Dim valueUsageInfoKeys = workspace.Documents.SelectMany(Function(d) d.AnnotatedSpans.Keys.Where(Function(key) key.StartsWith(ValueUsageInfoKey))) 343For Each doc In documentsWithAnnotatedSpans.Where(Function(d) d.AnnotatedSpans.ContainsKey(key)) 345Dim expectedSpans = doc.AnnotatedSpans(key).Order() 357Dim typeOrNamespaceUsageInfoKeys = workspace.Documents.SelectMany(Function(d) d.AnnotatedSpans.Keys.Where(Function(key) key.StartsWith(TypeOrNamespaceUsageInfoKey))) 359For Each doc In documentsWithAnnotatedSpans.Where(Function(d) d.AnnotatedSpans.ContainsKey(key)) 361Dim expectedSpans = doc.AnnotatedSpans(key).Order() 381For Each doc In documentsWithAnnotatedSpans.Where(Function(d) d.AnnotatedSpans.ContainsKey(annotationKey)) 383Dim expectedSpans = doc.AnnotatedSpans(annotationKey).Order()
InlineHints\AbstractInlineHintsTests.vb (1)
49Dim nameAndSpansList = hostDocument.AnnotatedSpans.SelectMany(
LanguageServices\SyntaxFactsServiceTests.vb (2)
215Dim expected = If(cursorDocument.AnnotatedSpans.ContainsKey("MemberBodySpan"), cursorDocument.AnnotatedSpans!MemberBodySpan.Single(), Nothing)
Peek\PeekTests.vb (1)
456Dim expectedPosition = New SnapshotPoint(snapshot, document.AnnotatedSpans(name).Single().Start)
ReferenceHighlighting\AbstractReferenceHighlightingTests.vb (1)
57Dim nameAndSpansList = hostDocument.AnnotatedSpans.SelectMany(
Rename\InlineRenameTests.vb (2)
1282workspace.Documents.Single().AnnotatedSpans()("introducelocal").Single(), 1286workspace.Documents.Single().AnnotatedSpans.Clear()
Rename\RenameEngineResult.vb (1)
198Dim annotatedSpans = document.AnnotatedSpans
Rename\RenameTagProducerTests.vb (10)
43Dim annotatedDocument = expectedTaggedWorkspace.Documents.SingleOrDefault(Function(d) d.AnnotatedSpans.Any()) 56Return annotatedDocument.AnnotatedSpans.SelectMany(Function(kvp) 1608Dim validExpectedSpans = workspace.Documents.Single(Function(d) d.AnnotatedSpans.Count > 0).AnnotatedSpans("valid").Select(Function(ts) ts.ToSpan()) 1611Dim conflictExpectedSpans = workspace.Documents.Single(Function(d) d.AnnotatedSpans.Count > 0).AnnotatedSpans("conflict").Select(Function(ts) ts.ToSpan()) 1641Dim validExpectedSpans = workspace.Documents.Single(Function(d) d.AnnotatedSpans.Count > 0).AnnotatedSpans("valid").Select(Function(ts) ts.ToSpan()) 1644Dim conflictExpectedSpans = workspace.Documents.Single(Function(d) d.AnnotatedSpans.Count > 0).AnnotatedSpans("conflict").Select(Function(ts) ts.ToSpan())
Rename\RenameTestHelpers.vb (1)
74For Each annotations In document.AnnotatedSpans
Simplification\AbstractSimplificationTests.vb (2)
46Dim spansToAddSimplifierAnnotation = hostDocument.AnnotatedSpans.Where(Function(kvp) kvp.Key.StartsWith("Simplify", StringComparison.Ordinal)) 48Dim explicitSpanToSimplifyAnnotatedSpans = hostDocument.AnnotatedSpans.Where(Function(kvp) Not spansToAddSimplifierAnnotation.Contains(kvp))
Simplification\TypeNameSimplifierTest.vb (1)
4252For Each span In hostDocument.AnnotatedSpans("Expand")
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (13)
SpellCheck\SpellCheckTests.cs (13)
67Ranges = GetRanges(sourceText, testDocument.AnnotatedSpans), 98Ranges = GetRanges(sourceText, workspace.Documents.Single().AnnotatedSpans), 134Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.Single().AnnotatedSpans), 170Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.Single().AnnotatedSpans), 217Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.Single().AnnotatedSpans), 231Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.Single().AnnotatedSpans), 259Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.Single().AnnotatedSpans), 286Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.Single().AnnotatedSpans), 314Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.First().AnnotatedSpans), 387Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.First().AnnotatedSpans), 425Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.First().AnnotatedSpans), 461Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.First().AnnotatedSpans), 514Ranges = GetRanges(sourceText, testLspServer.TestWorkspace.Documents.First().AnnotatedSpans),
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests (1)
Utilities\TestLsifOutput.vb (1)
124Return GetRangesAsync(Function(testDocument) testDocument.AnnotatedSpans.GetValueOrDefault(annotation))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (1)
RemoveUnnecessaryParenthesesTests.vb (1)
643Dim expectedSpans = workspace.Documents.First().AnnotatedSpans
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (1)
RemoveUnnecessaryParenthesesTests.vb (1)
643Dim expectedSpans = workspace.Documents.First().AnnotatedSpans
Microsoft.VisualStudio.LanguageServices.UnitTests (10)
Venus\DocumentService_IntegrationTests.vb (9)
83Dim definitionDocument = workspace.Documents.First(Function(d) d.AnnotatedSpans.ContainsKey("Definition")) 86Dim definitionSpan = definitionDocument.AnnotatedSpans("Definition").Single() 140Dim originalDocument = workspace.Documents.First(Function(d) d.AnnotatedSpans.ContainsKey("Original")) 146Dim node = root.FindNode(originalDocument.AnnotatedSpans("Original").First()).AncestorsAndSelf().OfType(Of ClassDeclarationSyntax).First() 150Dim definitionDocument = workspace.Documents.First(Function(d) d.AnnotatedSpans.ContainsKey("Definition")) 280If testDocument.AnnotatedSpans("Original").First() = span Then 281Dim mappedSpan = mappedTestDocument.AnnotatedSpans("Definition").First() 317If testDocument.AnnotatedSpans("Original").First() = span Then 318mappedSpan = mappedTestDocument.AnnotatedSpans("Definition").First()
Venus\DocumentServiceTests.vb (1)
300Return document.AnnotatedSpans(spanName).First()