1 write to TextSpan
Microsoft.CodeAnalysis.Workspaces (1)
Classification\ClassifiedSpan.cs (1)
24this.TextSpan = textSpan;
104 references to TextSpan
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Classification\ClassificationHelpers.cs (1)
526var span = classifiedSpan.TextSpan;
Classification\SyntaxClassification\NameSyntaxClassifier.cs (2)
90TryClassifyStaticSymbol(symbol, classifiedSpan.TextSpan, result); 125result.Add(new ClassifiedSpan(set.First().TextSpan, ClassificationTypeNames.StaticSymbol));
Microsoft.CodeAnalysis.EditorFeatures (3)
Classification\Semantic\ClassificationUtilities.cs (1)
34classifiedSpan.TextSpan.ToSnapshotSpan(snapshot),
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
471var lastSnapshotSpan = lastClassifiedSpan.TextSpan.ToSnapshotSpan(lastProcessedSnapshot);
IntelliSense\QuickInfo\IntellisenseQuickInfoBuilder.cs (1)
119var textRunsOfSpan = spans.Select(s => new ClassifiedTextRun(s.ClassificationType, text.GetSubText(s.TextSpan).ToString(), ClassifiedTextRunStyle.UseClassificationFont)).ToList();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (11)
Classification\AbstractClassifierTests.cs (6)
69var actualOrdered = actual.OrderBy((t1, t2) => t1.TextSpan.Start - t2.TextSpan.Start); 71var actualFormatted = actualOrdered.Select(a => new FormattedClassification(allCode.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)); 302classificationsSpans.AddRange(allClassifications.Select(t => t.TextSpan)); 307where !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.EditorFeatures.Wpf (1)
Preview\PreviewStaticClassificationTaggerProvider.cs (1)
79if (classifiedSpan.TextSpan.IntersectsWith(requestSpan))
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Classification\ClassificationTests.vb (2)
239Dim subText = text.ToString(span.TextSpan) 241subText)}', {span.TextSpan})"
Microsoft.CodeAnalysis.Features (4)
QuickInfo\IndentationHelper.cs (4)
43var span = classifiedSpan.TextSpan; 92var startLineNumber = text.Lines.GetLineFromPosition(span.TextSpan.Start).LineNumber; 93var endLineNumber = text.Lines.GetLineFromPosition(span.TextSpan.End).LineNumber; 110if (startLineFirstNonWhitespace.HasValue && startLineFirstNonWhitespace.Value < span.TextSpan.Start)
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Handler\References\FindUsagesLSPContext.cs (2)
297if (span.TextSpan == documentSpan.SourceSpan) 317span.ClassificationType, docText.ToString(span.TextSpan), ClassifiedTextRunStyle.Plain, markerTagType));
Handler\SemanticTokens\SemanticTokensHelpers.cs (8)
129var nonEmptySpans = spans.Where(s => !s.TextSpan.IsEmpty && s.ClassificationType != ClassificationTypeNames.Text); 152text.GetLinesAndOffsets(span.TextSpan, out var startLine, out var startOffset, out var endLine, out var endOffSet); 225textSpan.Contains(originalClassifiedSpans[spanIndex + 1].TextSpan)) 281var originalTextSpan = classifiedSpan.TextSpan; 310while (classifiedSpans[currentClassifiedSpanIndex].TextSpan == originalTextSpan) 332if (currentClassifiedSpanIndex + 1 >= classifiedSpans.Length || classifiedSpans[currentClassifiedSpanIndex + 1].TextSpan != originalTextSpan) 364public int Compare(ClassifiedSpan x, ClassifiedSpan y) => x.TextSpan.CompareTo(y.TextSpan);
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (3)
89: SerializableClassifiedSpans.Dehydrate(classifiedSpans.WhereAsArray(c => c.TextSpan.IntersectsWith(textSpan))); 188writer.WriteInt32(classifiedSpan.TextSpan.Start); 189writer.WriteCompressedUInt((uint)classifiedSpan.TextSpan.Length);
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Classification\SyntaxClassification\NameSyntaxClassifier.vb (1)
92TryClassifyStaticSymbol(symbol, classifiedSpan.TextSpan, result)
Microsoft.CodeAnalysis.Workspaces (53)
Classification\ClassifiedSpan.cs (3)
28=> Hash.Combine(this.ClassificationType, this.TextSpan.GetHashCode()); 34=> this.ClassificationType == other.ClassificationType && this.TextSpan == other.TextSpan;
Classification\ClassifiedSpanIntervalIntrospector.cs (2)
16=> value.TextSpan.Length; 19=> value.TextSpan.Start;
Classification\Classifier.cs (11)
36/// <see cref="ClassifiedSpan"/>s may have the same <see cref="ClassifiedSpan.TextSpan"/>. This occurs when there are multiple 39/// <see cref="ClassifiedSpan"/>s may also have overlapping <see cref="ClassifiedSpan.TextSpan"/>s. This occurs when there are 82var allClassifications = new List<ClassifiedSpan>(semanticClassifications.Where(s => s.TextSpan.OverlapsWith(textSpan))); 83var semanticSet = semanticClassifications.Select(s => s.TextSpan).ToSet(); 86s => s.TextSpan.OverlapsWith(textSpan) && !semanticSet.Contains(s.TextSpan))); 87allClassifications.Sort((s1, s2) => s1.TextSpan.Start - s2.TextSpan.Start); 110if (startPosition < span.TextSpan.Start) 118parts.Add(new SymbolDisplayPart(kind.Value, null, sourceText.ToString(span.TextSpan))); 120startPosition = span.TextSpan.End;
Classification\ClassifierHelper.cs (35)
119private static readonly Comparison<ClassifiedSpan> s_spanComparison = static (s1, s2) => s1.TextSpan.Start - s2.TextSpan.Start; 138var intersection = span.TextSpan.Intersection(widenedSpan); 144var isAdditiveClassification = previousSpan.TextSpan == span.TextSpan && 148if (!isAdditiveClassification && previousSpan.TextSpan.End > intersection.Value.Start) 166Debug.Assert(!span.TextSpan.IsEmpty); 170if (span.TextSpan.Length == 0) 174if (startPosition < span.TextSpan.Start) 178startPosition, span.TextSpan.Start))); 182startPosition = span.TextSpan.End; 203if (!part.TextSpan.IsEmpty) 215if (syntacticPart.TextSpan.IsEmpty) 220syntacticPart.TextSpan.Start, syntacticPart.TextSpan.Length, ref tempBuffer.AsRef()); 237Debug.Assert(firstSemanticPart.TextSpan.OverlapsWith(syntacticPart.TextSpan)); 238Debug.Assert(lastSemanticPart.TextSpan.OverlapsWith(syntacticPart.TextSpan)); 240if (syntacticPart.TextSpan.Start < firstSemanticPart.TextSpan.Start) 243syntacticPart.TextSpan.Start, 244firstSemanticPart.TextSpan.Start))); 252Debug.Assert(semanticPart1.TextSpan.OverlapsWith(syntacticPart.TextSpan)); 253Debug.Assert(semanticPart1.TextSpan.OverlapsWith(syntacticPart.TextSpan)); 255if (semanticPart1.TextSpan.End < semanticPart2.TextSpan.Start) 258semanticPart1.TextSpan.End, 259semanticPart2.TextSpan.Start))); 263if (lastSemanticPart.TextSpan.End < syntacticPart.TextSpan.End) 266lastSemanticPart.TextSpan.End, 267syntacticPart.TextSpan.End)));
Classification\IRemoteSemanticClassificationService.cs (1)
79var textSpan = classifiedSpan.TextSpan;
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (1)
151AddClassification(classification.TextSpan, classification.ClassificationType);
Microsoft.VisualStudio.LanguageServices (5)
FindReferences\Entries\DocumentSpanEntry.cs (1)
167cs => new ClassifiedText(cs.ClassificationType, _excerptResult.Content.ToString(cs.TextSpan)));
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)
209var mappedSpan = MapRoslynSpanToPrimarySpan(primarySnapshot, roslynSnapshot, classifiedSpan.TextSpan); 242var lastSpan = builder[^1].TextSpan;
Microsoft.VisualStudio.LanguageServices.UnitTests (8)
Venus\DocumentServiceTests.vb (8)
156Dim actualFormatted = result.Value.ClassifiedSpans.Select(Function(a) New FormattedClassification(content.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)) 195Dim actualFormatted = result.Value.ClassifiedSpans.Select(Function(a) New FormattedClassification(content.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)) 250Dim actualFormatted = result.Value.ClassifiedSpans.Select(Function(a) New FormattedClassification(content.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)) 294Dim actualFormatted = result.Value.ClassifiedSpans.Select(Function(a) New FormattedClassification(content.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType))