86 references to TextSpan
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\RoutePatternClassifierTests.cs (3)
32var actualOrdered = actual.OrderBy(t1 => t1.TextSpan.Start).ToList(); 33var actualFormatted = actualOrdered.Select(a => new FormattedClassification(rewrittenCode.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)).ToArray();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (10)
Classification\SemanticClassifierTests_TestMarkup.cs (10)
87var nonTestCodeSpans = actual.Where(s => s.ClassificationType != ClassificationTypeNames.TestCode).OrderBy((t1, t2) => t1.TextSpan.Start - t2.TextSpan.Start).ToImmutableArray(); 88var testCodeSpans = actual.Where(s => s.ClassificationType == ClassificationTypeNames.TestCode).OrderBy((t1, t2) => t1.TextSpan.Start - t2.TextSpan.Start).ToImmutableArray(); 92var normalizedNonTestCodeSpans = new NormalizedTextSpanCollection(nonTestCodeSpans.Select(c => c.TextSpan)); 96var remainder = NormalizedTextSpanCollection.Difference(new NormalizedTextSpanCollection(testCodeSpan.TextSpan), normalizedNonTestCodeSpans); 104var actualOrdered = totalSpans.OrderBy(static (t1, t2) => t1.TextSpan.Start - t2.TextSpan.Start).ToImmutableArray(); 105var actualFormatted = actualOrdered.SelectAsArray(a => new FormattedClassification(allCode.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType));
Microsoft.CodeAnalysis.CSharp.Features (3)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (3)
236if (classifiedSpan.TextSpan.IsEmpty) 245var startIndexInclusive = classifiedSpan.TextSpan.Start; 246var endIndexExclusive = classifiedSpan.TextSpan.End;
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Classification\ClassificationHelpers.cs (1)
527var span = classifiedSpan.TextSpan;
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
81TryClassifyStaticSymbol(symbol, classifiedSpan.TextSpan, result); 114result.Add(new ClassifiedSpan(set.First().TextSpan, ClassificationTypeNames.StaticSymbol));
Microsoft.CodeAnalysis.EditorFeatures (3)
Classification\Semantic\ClassificationUtilities.cs (1)
17classifiedSpan.TextSpan.ToSnapshotSpan(snapshot),
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
426var lastSnapshotSpan = lastClassifiedSpan.TextSpan.ToSnapshotSpan(lastProcessedSnapshot);
Preview\PreviewStaticClassificationTaggerProvider.cs (1)
81if (classifiedSpan.TextSpan.IntersectsWith(requestSpan))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (11)
Classification\AbstractClassifierTests.cs (6)
66var actualOrdered = actual.OrderBy((t1, t2) => t1.TextSpan.Start - t2.TextSpan.Start); 68var actualFormatted = actualOrdered.SelectAsArray(a => new FormattedClassification(allCode.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)); 291classificationsSpans.AddRange(allClassifications.Select(t => t.TextSpan)); 296where !classificationsSpans.Contains(t.TextSpan)
Classification\ClassificationTestHelper.cs (5)
22=> $"({tuple.TextSpan}, {tuple.ClassificationType})"; 37actualClassificationList.Sort((t1, t2) => t1.TextSpan.Start - t2.TextSpan.Start); 54var text = actualText.Substring(actual.TextSpan.Start, actual.TextSpan.Length);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Classification\ClassificationTests.vb (2)
239Dim subText = text.ToString(span.TextSpan) 241subText)}', {span.TextSpan})"
Microsoft.CodeAnalysis.Features (5)
QuickInfo\IndentationHelper.cs (4)
47var span = classifiedSpan.TextSpan; 93var startLineNumber = lines.GetLineFromPosition(span.TextSpan.Start).LineNumber; 94var endLineNumber = lines.GetLineFromPosition(span.TextSpan.End).LineNumber; 111if (startLineFirstNonWhitespace is int value && value < span.TextSpan.Start)
QuickInfo\Presentation\QuickInfoContentBuilder.cs (1)
159text.ToString(span.TextSpan),
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Handler\References\FindUsagesLSPContext.cs (2)
345if (span.TextSpan == documentSpan.SourceSpan) 365span.ClassificationType, docText.ToString(span.TextSpan), ClassifiedTextRunStyle.Plain, markerTagType));
Handler\SemanticTokens\SemanticTokensHelpers.cs (7)
139if (s.TextSpan.IsEmpty) 167text.GetLinesAndOffsets(span.TextSpan, out var startLine, out var startOffset, out var endLine, out var endOffSet); 291var originalTextSpan = classifiedSpan.TextSpan; 318while (classifiedSpans[currentClassifiedSpanIndex].TextSpan == originalTextSpan) 335if (currentClassifiedSpanIndex + 1 >= classifiedSpans.Count || classifiedSpans[currentClassifiedSpanIndex + 1].TextSpan != originalTextSpan) 367public int Compare(ClassifiedSpan x, ClassifiedSpan y) => x.TextSpan.CompareTo(y.TextSpan);
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (3)
97if (textSpanIntervalTree.HasIntervalThatIntersectsWith(span.TextSpan)) 214writer.WriteInt32(classifiedSpan.TextSpan.Start); 215writer.WriteCompressedUInt((uint)classifiedSpan.TextSpan.Length);
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
92TryClassifyStaticSymbol(symbol, classifiedSpan.TextSpan, result)
Microsoft.CodeAnalysis.Workspaces (29)
Classification\ClassifiedSpan.cs (3)
22=> Hash.Combine(this.ClassificationType, this.TextSpan.GetHashCode()); 28=> this.ClassificationType == other.ClassificationType && this.TextSpan == other.TextSpan;
Classification\ClassifiedSpanIntervalIntrospector.cs (1)
17=> value.TextSpan;
Classification\Classifier.cs (11)
40/// <see cref="ClassifiedSpan"/>s may have the same <see cref="ClassifiedSpan.TextSpan"/>. This occurs when there are multiple 43/// <see cref="ClassifiedSpan"/>s may also have overlapping <see cref="ClassifiedSpan.TextSpan"/>s. This occurs when there are 103var allClassifications = new List<ClassifiedSpan>(semanticClassifications.Where(s => s.TextSpan.OverlapsWith(textSpan))); 104var semanticSet = semanticClassifications.Select(s => s.TextSpan).ToSet(); 107s => s.TextSpan.OverlapsWith(textSpan) && !semanticSet.Contains(s.TextSpan))); 108allClassifications.Sort((s1, s2) => s1.TextSpan.Start - s2.TextSpan.Start); 131if (startPosition < span.TextSpan.Start) 139parts.Add(new SymbolDisplayPart(kind.Value, null, sourceText.ToString(span.TextSpan))); 141startPosition = span.TextSpan.End;
Classification\ClassifierHelper.cs (12)
145private static readonly Comparison<ClassifiedSpan> s_spanComparison = static (s1, s2) => s1.TextSpan.Start - s2.TextSpan.Start; 164var intersection = span.TextSpan.Intersection(widenedSpan); 170var isAdditiveClassification = previousSpan.TextSpan == span.TextSpan && 174if (!isAdditiveClassification && previousSpan.TextSpan.End > intersection.Value.Start) 192Debug.Assert(!span.TextSpan.IsEmpty); 196if (span.TextSpan.Length == 0) 200if (startPosition < span.TextSpan.Start) 204startPosition, span.TextSpan.Start))); 208startPosition = span.TextSpan.End; 224static span => span.TextSpan,
Classification\IRemoteSemanticClassificationService.cs (1)
88var textSpan = classifiedSpan.TextSpan;
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (1)
147AddClassification(classification.TextSpan, classification.ClassificationType);
Microsoft.VisualStudio.LanguageServices (4)
ValueTracking\TreeItemViewModel.cs (2)
112return new ClassifiedText(cs.ClassificationType, _sourceText.ToString(cs.TextSpan)); 115var spanStartPosition = TextSpan.Start - ClassifiedSpans[0].TextSpan.Start;
Venus\ContainedDocument.DocumentServiceProvider.cs (2)
208var mappedSpan = MapRoslynSpanToPrimarySpan(primarySnapshot, roslynSnapshot, classifiedSpan.TextSpan); 241var lastSpan = builder[^1].TextSpan;