482 references to TextSpan
dotnet (2)
dotnet-format (3)
GenerateDocumentationAndConfigFiles (31)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.Analyzers.Extra.Tests (1)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.AspNetCore.App.Analyzers (20)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (6)
295charResults.Add((ch, new TextSpan(offset + index, 1)));
389result.Add((ch, new TextSpan(offset + index, 2)));
456result.Add(((char)uintChar, new TextSpan(startIndex + offset, 2 + 8)));
467result.Add(((char)highSurrogate, new TextSpan(pos, 0)));
468result.Add(((char)lowSurrogate, new TextSpan(pos, 2 + 8)));
496result.Add((character, new TextSpan(startIndex + offset, 2 + 4)));
Microsoft.CodeAnalysis (40)
Syntax\SyntaxDiffer.cs (7)
46return new[] { new TextChange(new TextSpan(0, 0), after.GetText().ToString()) };
82return new[] { new TextSpan(0, after!.GetText().Length) };
113newSpans.Add(new TextSpan(start, change.Range.NewLength));
570RecordChange(new ChangeRecord(new TextChangeRange(new TextSpan(start, 0), newSpan.Length), null, insertedNodes));
582new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + change.Range.Span.Length), last.Range.NewLength + change.Range.NewLength),
605new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.Length + textChangeRange.Span.Length), last.Range.NewLength + textChangeRange.NewLength),
764new TextSpan(range.Span.Start + commonLeadingCount, range.Span.Length - (commonLeadingCount + commonTrailingCount)),
Text\SourceText.cs (8)
536return this.GetSubText(new TextSpan(start, this.Length - start));
545this.Write(textWriter, new TextSpan(0, this.Length), cancellationToken);
714return ToString(new TextSpan(0, this.Length));
817var subText = this.GetSubText(new TextSpan(position, change.Span.Start - position));
840var subText = this.GetSubText(new TextSpan(position, this.Length - position));
888return this.Replace(new TextSpan(start, length), newText);
909return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldText.Length), this.Length));
933var span = new TextSpan(newPos, range.NewLength);
Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.Analyzers (34)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.AnalyzerUtilities (29)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.CodeStyle (37)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
354new Text.TextSpan(
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (20)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
Microsoft.CodeAnalysis.CSharp.Features (31)
Microsoft.CodeAnalysis.CSharp.Workspaces (12)
Classification\Worker_Preprocesser.cs (7)
356AddClassification(new TextSpan(node.Content.SpanStart, firstWhitespaceIndex), ClassificationTypeNames.PreprocessorKeyword);
385AddClassification(new TextSpan(node.Content.SpanStart + nameStart, contentText.Length - nameStart), ClassificationTypeNames.StringLiteral);
411AddClassification(new TextSpan(contentStart + separatorIndex, 1), ClassificationTypeNames.Punctuation);
418AddClassification(new TextSpan(contentStart + valueIndex, contentText.Length - valueIndex), ClassificationTypeNames.StringLiteral);
436AddClassification(new TextSpan(contentStart + segmentStart, index - segmentStart), ClassificationTypeNames.Identifier);
441AddClassification(new TextSpan(contentStart + index, 1), ClassificationTypeNames.Punctuation);
449AddClassification(new TextSpan(contentStart + segmentStart, end - segmentStart), ClassificationTypeNames.Identifier);
Microsoft.CodeAnalysis.Features (55)
Navigation\IDocumentNavigationService.cs (2)
37=> CanNavigateToSpanAsync(workspace, documentId, new TextSpan(position, 0), allowInvalidSpan: allowInvalidPosition, cancellationToken);
43=> GetLocationForSpanAsync(workspace, documentId, new TextSpan(position, 0), allowInvalidSpan: allowInvalidPosition, cancellationToken);
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
354new Text.TextSpan(
Microsoft.CodeAnalysis.Razor.Compiler (10)
Microsoft.CodeAnalysis.ResxSourceGenerator (29)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.CodeAnalysis.VisualBasic (12)
Microsoft.CodeAnalysis.VisualBasic.Features (12)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
Microsoft.CodeAnalysis.Workspaces (50)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
Microsoft.Gen.Metrics.Unit.Tests (1)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
Roslyn.Diagnostics.Analyzers (31)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (4)
225addAndAdjustOldDelta(builder, ref oldDelta, new TextChangeRange(new TextSpan(oldChange.Span.Start, oldChangeLeadingDeletion), oldChangeLeadingInsertion));
226oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.Length - oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
380add(builder, new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, newChange.SpanLength), newChange.NewLength));
391builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.Length + change.Span.Length), last.NewLength + change.NewLength);
Roslyn.Diagnostics.CSharp.Analyzers (1)