482 references to TextSpan
dotnet (2)
Commands\Run\FileBasedAppSourceEditor.cs (2)
122var span = new TextSpan(start: addAfter.Info.Span.End, length: 0); 226return new TextChange(new TextSpan(start: start, length: 0), newText: prefix + directive.ToString() + suffix);
dotnet-format (3)
Formatters\EndOfLineFormatter.cs (1)
40var lineEndingSpan = new TextSpan(line.End, line.EndIncludingLineBreak - line.End);
Formatters\FinalNewlineFormatter.cs (2)
43var finalNewlineSpan = new TextSpan(lastLine.End, 0); 53var finalNewlineSpan = new TextSpan(lineBeforeLast.End, lineBeforeLast.EndIncludingLineBreak - lineBeforeLast.End);
GenerateDocumentationAndConfigFiles (31)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
126=> ReuseExistingSpeculativeModelAsync(document, new TextSpan(position, 0), cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
107return new TextSpan(start, end - start);
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
107return new TextSpan(start, end - start);
Microsoft.AspNetCore.App.Analyzers (20)
Infrastructure\RoutePattern\RoutePatternLexer.cs (1)
44return CreateToken(GetKind(ch), Text.GetSubSequence(new TextSpan(Position - 1, 1)));
Infrastructure\RoutePattern\RoutePatternParser.cs (2)
620? new TextSpan(_lexer.Text.Last().Span.End, 0) 621: new TextSpan(token.VirtualChars[0].Span.Start, 0);
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (5)
36span = new TextSpan(offset + index, 2); 164result.Add(VirtualChar.Create(new Rune('"'), new TextSpan(offset + index, 2))); 205result.Add(VirtualChar.Create(rune, new TextSpan(offset + index, 1))); 212result.Add(VirtualChar.Create(rune, new TextSpan(offset + index, 2))); 219result.Add(VirtualChar.Create(ch, new TextSpan(offset + index, 1)));
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)));
Infrastructure\VirtualChars\VirtualCharSequence.Chunks.cs (1)
155var span = new TextSpan(_firstVirtualCharPosition + index, length: 1);
Infrastructure\VirtualChars\VirtualCharSequence.cs (2)
50: this(sequence, new TextSpan(0, sequence.Length)) 91=> new(_leafCharacters, new TextSpan(_span.Start + span.Start, span.Length));
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
88new TextChange(new TextSpan(int.Parse(startString, CultureInfo.InvariantCulture), int.Parse(lengthString, CultureInfo.InvariantCulture)), newText),
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
82new TextChange(new TextSpan(int.Parse(startString, CultureInfo.InvariantCulture), int.Parse(lengthString, CultureInfo.InvariantCulture)), newText),
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
297var targetSpan = new TextSpan(
Microsoft.CodeAnalysis (40)
CodeGen\RawSequencePoint.cs (1)
21internal static readonly TextSpan HiddenSequencePointSpan = new TextSpan(0x7FFFFFFF, 0);
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)),
Syntax\SyntaxNode.cs (2)
85public TextSpan FullSpan => new TextSpan(this.Position, this.Green.FullWidth); 109return new TextSpan(start, width);
Syntax\SyntaxNodeOrToken.cs (1)
279return new TextSpan(Position, _token.FullWidth);
Syntax\SyntaxToken.cs (2)
110return Node != null ? new TextSpan(Position + Node.GetLeadingTriviaWidth(), Node.Width) : default(TextSpan); 133public TextSpan FullSpan => new TextSpan(Position, FullWidth);
Syntax\SyntaxTokenList.cs (1)
161return new TextSpan(this.Position, Node.FullWidth);
Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
Syntax\SyntaxTrivia.cs (2)
97? new TextSpan(Position + UnderlyingNode.GetLeadingTriviaWidth(), UnderlyingNode.Width) 124get { return UnderlyingNode != null ? new TextSpan(Position, UnderlyingNode.FullWidth) : default(TextSpan); }
Syntax\SyntaxTriviaList.cs (1)
159return new TextSpan(this.Position, Node.FullWidth);
Text\ChangedText.cs (1)
206return ImmutableArray.Create(new TextChangeRange(new TextSpan(0, oldText.Length), _newText.Length));
Text\CompositeText.cs (4)
102AddSegments(newSegments, segment.GetSubText(new TextSpan(segOffset, copyLength))); 222segments[i - 1] = prevSegment.GetSubText(new TextSpan(0, prevSegment.Length - 1)); 224segments[i + 1] = curSegment.GetSubText(new TextSpan(1, curSegment.Length - 1)); 537var resultLine = TextLine.FromSpanUnsafe(_compositeText, new TextSpan(firstSegmentOffset + firstSegmentTextLine.Start, lineLength), lineBreakLen);
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\SubText.cs (3)
95return new TextSpan(compositeStart, compositeEnd - compositeStart); 145return TextLine.FromSpanUnsafe(_subText, new TextSpan(_subText.UnderlyingSpan.Length, 0), lineBreakLength: 0); 178var resultLine = TextLine.FromSpanUnsafe(_subText, new TextSpan(startInSubText, length), lineBreakLen);
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);
Text\TextLine.cs (1)
77span = new TextSpan(span.Start, span.Length + lineBreakLen);
Text\TextSpan.cs (1)
197return new TextSpan(start, end - start);
Microsoft.CodeAnalysis.Analyzers (34)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
713fileSpan = new TextSpan(spanSpart, spanLength);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (1)
99var span = new TextSpan(indexOfValue, valueLength);
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (1)
434return unshippedText.Replace(new TextSpan(0, unshippedText.Length), builder.ToString());
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
126=> ReuseExistingSpeculativeModelAsync(document, new TextSpan(position, 0), cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.AnalyzerUtilities (29)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
Microsoft.CodeAnalysis.CodeStyle (37)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (2)
102return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, 0)); 105return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, _commentPrefixLength));
src\roslyn\src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (4)
72if (oldText.GetSubText(new TextSpan(change.Span.Start + offset, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText))) 74change = new TextChange(new TextSpan(change.Span.Start, offset), ""); 81if (oldText.GetSubText(new TextSpan(change.Span.Start, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText))) 83change = new TextChange(new TextSpan(change.Span.Start + change.NewText.Length, offset), "");
src\roslyn\src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
79Location.Create(badTrivia.SyntaxTree!, new TextSpan(badTrivia.SpanStart, 0)),
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
354new Text.TextSpan(
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
39document, new TextSpan(typeName.Value.Span.Start, 0), forRefactoring: false, cancellationToken).ConfigureAwait(false);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
126=> ReuseExistingSpeculativeModelAsync(document, new TextSpan(position, 0), cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Microsoft.CodeAnalysis.CSharp (20)
Binder\Binder_Expressions.cs (3)
5533var errorSpan = new TextSpan(start, end - start); 7536diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 1, 1))); 7540diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 2, 1)));
Binder\Binder_Query.cs (1)
737SourceLocation errorLocation = new SourceLocation(let.SyntaxTree, new TextSpan(let.Identifier.SpanStart, let.Expression.Span.End - let.Identifier.SpanStart));
Compilation\SyntaxTreeSemanticModel.cs (1)
774Compilation.IsNullableAnalysisEnabledIn((CSharpSyntaxTree)SyntaxTree, new TextSpan(position, 0));
Compiler\DocumentationCommentCompiler.cs (1)
699Location location = new SourceLocation(trivia.SyntaxTree, new TextSpan(trivia.SpanStart, 0));
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
104_diagnostics.Add(ErrorCode.WRN_UnprocessedXMLComment, new SourceLocation(trivia.SyntaxTree, new TextSpan(start, length)));
DocumentationComments\SourceDocumentationCommentUtils.cs (1)
81diagnostics.Add(ErrorCode.WRN_UnprocessedXMLComment, new SourceLocation(tree, new TextSpan(start, length)));
FlowAnalysis\AbstractFlowPass.cs (1)
205this.RegionSpan = new TextSpan(startLocation, length);
FlowAnalysis\NullableWalker.cs (2)
1685return compilation.SyntaxTrees.Any(static tree => ((CSharpSyntaxTree)tree).IsNullableAnalysisEnabled(new Text.TextSpan(0, tree.Length)) == true); 9712location = Location.Create(lambdaSyntax.SyntaxTree, new Text.TextSpan(start, lambdaSyntax.ArrowToken.Span.End - start));
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
631return new TextSpan(startSpan.Start, originalSpan.Length - (startSpan.Start - originalSpan.Start));
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (1)
78var spanForSwitchBody = new TextSpan(spanStart, spanEnd - spanStart);
Parser\Blender.cs (1)
151var column = oldTree.SyntaxTree.GetLineSpan(new TextSpan(start, 0)).Span.Start.Character;
Parser\SlidingTextWindow.cs (1)
404var span = new TextSpan(position, length);
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
252compilation.SyntaxTrees.Any(static tree => ((CSharpSyntaxTree)tree).IsNullableAnalysisEnabled(new TextSpan(0, tree.Length)) == true);
Syntax\CSharpSyntaxTree.cs (2)
551return this.WithChanges(newText, new[] { new TextChangeRange(new TextSpan(0, this.Length), newText.Length) }); 565if (workingChanges.Count == 1 && workingChanges[0].Span == new TextSpan(0, this.Length) && workingChanges[0].NewLength == newText.Length)
Syntax\SyntaxNodeRemover.cs (1)
80return new TextSpan(start, end - start);
Syntax\SyntaxReplacer.cs (1)
157_totalSpan = new TextSpan(start, end - start);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
67var nodeAtInsertPosition = syntaxRoot.FindNode(new TextSpan(openParenthesisPosition, 0));
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
175new TextSpan(textLine.Start, ComputeCommonIndentationLength(textLine)), 235return new TextChange(new TextSpan(textLine.Start, 0), newText: indentation);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
92edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
94edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (1)
45fixAllSpan = new TextSpan(root.FullSpan.Start, firstTypeOrNamespaceDecl.FullSpan.Start - 1);
Microsoft.CodeAnalysis.CSharp.Features (31)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (2)
129newLineEdit = new TextChange(new TextSpan(annotatedNewline.SpanStart, 0), annotatedNewline.ToString()); 210var newTextChangeText = formattedText.GetSubText(new TextSpan(newRange.Span.Start + amountToShift, newRange.NewLength)).ToString();
BraceMatching\BlockCommentBraceMatcher.cs (2)
50return new BraceMatchingResult(new TextSpan(trivia.SpanStart, "/*".Length), TextSpan.FromBounds(trivia.Span.End - "*/".Length, trivia.Span.End)); 54var startBrace = new TextSpan(trivia.FullSpan.Start, "/**".Length);
BraceMatching\StringLiteralBraceMatcher.cs (4)
65new TextSpan(token.SpanStart, 2), 66new TextSpan(token.Span.End - endTokenLength, endTokenLength)); 71new TextSpan(token.SpanStart, 1), 72new TextSpan(token.Span.End - endTokenLength, endTokenLength));
Completion\CompletionProviders\CompletionUtilities.cs (2)
213return new TextSpan(caretTarget.Span.End, 0); 236return new TextSpan(propertyDeclaration.Span.End, 0);
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (4)
95builder.Add(new TextChange(new TextSpan(expression.SpanStart, 0), castText)); 107builder.Add(new TextChange(new TextSpan(dotToken.SpanStart, 1), ")")); 112builder.Add(new TextChange(new TextSpan(questionToken.Value.SpanStart, 0), ")")); 114builder.Add(new TextChange(new TextSpan(dotToken.SpanStart, 1), ""));
Copilot\CSharpCopilotProposalAdjusterService.cs (1)
49d => new TextChange(new TextSpan(d.Location.SourceSpan.Start, 0), "}"));
ExtractInterface\CSharpExtractInterfaceService.cs (1)
34var span = new TextSpan(position, 0);
GenerateType\CSharpGenerateTypeService.cs (1)
563? semanticModel.SyntaxTree.GetLocation(new TextSpan(lastMember.Span.End, 0))
InlineHints\CSharpInlineTypeHintsService.cs (5)
59: new(type, new TextSpan(variableDesignation.Identifier.SpanStart, 0), textChange: null, trailingSpace: true); 75var span = new TextSpan(parameterNode.Identifier.SpanStart, 0); 94var span = new TextSpan(implicitNew.NewKeyword.Span.End, 0); 107var span = new TextSpan(collectionExpression.OpenBracketToken.SpanStart, 0); 146return new TextSpan(normalSpan.SpanStart, 0);
RawStringLiteral\CSharpRawStringLiteralOnAutoInsertService.cs (3)
71return new TextChange(new TextSpan(position + 1, 0), "\"\"\""); 123return new TextChange(new TextSpan(position + 1, 0), "\""); 175return new TextChange(new TextSpan(token.GetRequiredParent().Span.End, 0), "\"");
Snippets\CSharpSnippetFunctionService.cs (1)
56var typeSpan = new TextSpan(caseGenerationLocation.Start + "case ".Length, fullyQualifiedTypeName.Length);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
67var nodeAtInsertPosition = syntaxRoot.FindNode(new TextSpan(openParenthesisPosition, 0));
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
175new TextSpan(textLine.Start, ComputeCommonIndentationLength(textLine)), 235return new TextChange(new TextSpan(textLine.Start, 0), newText: indentation);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (1)
92edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (1)
94edits.Add(new TextChange(new TextSpan(nextExpression.SpanStart, 0), token.Text + " "));
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);
EmbeddedLanguages\CSharpTestEmbeddedLanguageUtilities.cs (1)
33new TextSpan(0, virtualCharsWithoutMarkup.Count),
Rename\CSharpRenameRewriterLanguageService.cs (2)
109newSpan = new TextSpan(oldSpan.Start, newSpan.Length); 314_renameSpansTracker.AddComplexifiedSpan(_documentId, oldSpan, new TextSpan(oldSpan.Start, newSpan.Length), _modifiedSubSpans);
Simplification\Simplifiers\NameSimplifier.cs (1)
535issueSpan = new TextSpan(identifierToken.Span.End - 9, 9);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (1)
45fixAllSpan = new TextSpan(root.FullSpan.Start, firstTypeOrNamespaceDecl.FullSpan.Start - 1);
Microsoft.CodeAnalysis.Features (55)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (1)
85new TextSpan(position, length: 0));
ClassifiedSpansAndHighlightSpanFactory.cs (1)
59var highlightSpan = new TextSpan(
CodeFixes\Configuration\ConfigurationUpdater.cs (3)
720var textChange = new TextChange(new TextSpan(lastValidSpecificHeaderSpanEnd.Value.Span.End, 0), newEntry); 730var textChange = new TextChange(new TextSpan(lastValidHeaderSpanEnd.Value.Span.End, 0), newEntry); 768var textChange = new TextChange(new TextSpan(result.Length, 0), prefix + newEntry);
CodeFixes\Service\CodeFixService.cs (1)
295textSpan = new TextSpan(0, text.Length);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (2)
161currentSpan = new TextSpan(newStart, currentSpan.Length); 168currentSpan = new TextSpan(currentSpan.Start, newLength);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
46diagnosticSpan = new TextSpan(diagnosticSpan.Start + spanChange, diagnosticSpan.Length); 224var subtreeRoot = root.FindNode(new TextSpan(previousOfStart.FullSpan.Start, spanEnd - previousOfStart.FullSpan.Start));
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
208var spanToCheck = new TextSpan(
CodeLens\CodeLensReferencesService.cs (2)
138var referenceSpan = new TextSpan(spanStart, token.Span.Length); 225var span = new TextSpan(descriptor.SpanStart, descriptor.SpanLength);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
114.Select(changes => new TextSpan(changes.Key.Start, changes.Sum(change => change.NewText!.Length)));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (1)
715[new TextSpan(0, text.Length)],
Common\TaggedText.cs (1)
197yield return new ClassifiedSpan(new TextSpan(index, text.Length), classificationTypeName);
Completion\CompletionChange.cs (1)
59: this(textChange, textChanges, newPosition != null ? new TextSpan(newPosition.Value, 0) : null, includesCommitCharacter, properties)
Completion\Providers\AbstractAwaitCompletionProvider.cs (2)
196var asyncChange = new TextChange(new TextSpan(GetAsyncKeywordInsertionPosition(declaration), 0), syntaxFacts.GetText(syntaxKinds.AsyncKeyword) + " "); 233builder.Add(new TextChange(new TextSpan(expr.SpanStart, 0), _awaitKeyword + " "));
Completion\Utilities.cs (2)
22return new TextChange(new TextSpan(0, 0), ""); 40var totalNewSpan = new TextSpan(totalOldSpan.Start, totalOldSpan.Length + sumOfDeltas);
Copilot\CopilotUtilities.cs (1)
46newSpans.Add(new TextSpan(change.Span.Start + totalDelta, newTextLength));
Debugging\AbstractBreakpointResolver.cs (1)
83var textSpan = new TextSpan(location.SourceSpan.Start, 0);
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (1)
56if (range == new TextSpan(0, text.Length))
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (3)
95new TextSpan(token.Span.Start, spanToReplaceLength), 307replaceSpan = new TextSpan(start, currentLinePosition.Value - start); 348var replaceSpan = new TextSpan(token.Span.Start, 0);
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
227new TextChange(new TextSpan(int.Parse(startString), int.Parse(lengthString)), newText)));
EmbeddedLanguages\Json\JsonParser.cs (2)
591? new TextSpan(_lexer.Text[^1].Span.End, 0) 592: new TextSpan(token.VirtualChars[0].Span.Start, 0);
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
159return new EmbeddedDiagnostic(FeaturesResources.Value_required, new TextSpan(node.ColonToken.VirtualChars[0].Span.End, 0));
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (2)
288new TextChange(new TextSpan(context.Position, 0), name), newPosition: null))); 456new TextChange(new TextSpan(int.Parse(startString), int.Parse(lengthString)), newText),
EmbeddedLanguages\RegularExpressions\RegexParser.cs (2)
732? new TextSpan(_lexer.Text[^1].Span.End, 0) 733: new TextSpan(token.VirtualChars[0].Span.Start, 0);
ExternalAccess\VSTypeScript\VSTypeScriptTaskListService.cs (1)
40var textSpan = new TextSpan(Math.Min(text.Length, Math.Max(0, d.Position)), 0);
Highlighting\Keywords\AbstractKeywordHighlighter.cs (1)
81=> new(position, 0);
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
107var textSpan = new TextSpan(position, 0);
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
82location = Location.Create(tree, new TextSpan(0, 0));
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
247var moveSpan = new TextSpan(container.FullSpan.Start, 0);
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);
SemanticSearch\SemanticSearchDefinitionItemFactory.cs (1)
78=> new(span.Start, Math.Min(span.Length, maxLength));
Snippets\SnippetFunctionService.cs (1)
42var updatedTextSpan = new TextSpan(fieldSpan.Start, fullyQualifiedTypeName.Length);
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (2)
102return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, 0)); 105return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, _commentPrefixLength));
src\roslyn\src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (4)
72if (oldText.GetSubText(new TextSpan(change.Span.Start + offset, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText))) 74change = new TextChange(new TextSpan(change.Span.Start, offset), ""); 81if (oldText.GetSubText(new TextSpan(change.Span.Start, change.NewText.Length)).ContentEquals(SourceText.From(change.NewText))) 83change = new TextChange(new TextSpan(change.Span.Start + change.NewText.Length, offset), "");
src\roslyn\src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
79Location.Create(badTrivia.SyntaxTree!, new TextSpan(badTrivia.SpanStart, 0)),
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
354new Text.TextSpan(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
39document, new TextSpan(typeName.Value.Span.Start, 0), forRefactoring: false, cancellationToken).ConfigureAwait(false);
TaskList\AbstractTaskListService.cs (2)
112var location = document.SyntaxTree.GetLocation(new TextSpan(position, 0)); 158var endMessage = text.ToString(new TextSpan(endLine.Start, length));
Microsoft.CodeAnalysis.Razor.Compiler (10)
CSharp\SourceSpanExtensions.cs (1)
15return new TextSpan(sourceSpan.AbsoluteIndex, sourceSpan.Length);
Language\DefaultTagHelperResolutionPhase.cs (2)
843new Microsoft.CodeAnalysis.Text.TextSpan(exprStart, exprLength)); 892new Microsoft.CodeAnalysis.Text.TextSpan(innerStart, innerLen));
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (4)
593new Microsoft.CodeAnalysis.Text.TextSpan(valueStart, valueLength)); 729new Microsoft.CodeAnalysis.Text.TextSpan(valueStart, valueLength)); 1333new Microsoft.CodeAnalysis.Text.TextSpan(contentStart, contentLength)); 1415var text = sourceDocument.Text.ToString(new Microsoft.CodeAnalysis.Text.TextSpan(vss.AbsoluteIndex, vss.Length));
Language\Syntax\SyntaxNode.cs (1)
29public TextSpan Span => new(Position, Green.Width);
Language\Syntax\SyntaxReplacer.cs (1)
117_totalSpan = new TextSpan(start, end - start);
Language\Syntax\SyntaxToken.cs (1)
67=> Node != null ? new TextSpan(Position, Node.Width) : default;
Microsoft.CodeAnalysis.ResxSourceGenerator (29)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
Microsoft.CodeAnalysis.VisualBasic (12)
Binding\Binder_Utils.vb (1)
72Dim location = Me.SyntaxTree.GetLocation(New TextSpan(startLoc, endLoc - startLoc))
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (1)
550Return New Text.TextSpan(startSpan.Start, originalSpan.Length - (startSpan.Start - originalSpan.Start))
Scanner\Blender.vb (4)
93Dim fullSpan = New TextSpan(0, root.FullWidth) 115Return New TextSpan(position, 0) 389Dim range = New TextSpan(_affectedRange.Span.Start, _affectedRange.NewLength) 435Dim _curNodeSpan = New TextSpan(_curNodeStart, _curNodeLength)
Scanner\Directives.vb (1)
617Return New CodeAnalysis.Syntax.InternalSyntax.SyntaxList(Of VisualBasicSyntaxNode)(Me.GetDisabledTextAt(New TextSpan(startSkipped, lengthSkipped)))
Symbols\Source\SourceMethodSymbol.vb (1)
181Dim location = binder.SyntaxTree.GetLocation(New TextSpan(startLoc, endLoc - startLoc))
Syntax\SyntaxNodeRemover.vb (1)
60Return New TextSpan(start, [end] - start)
Syntax\SyntaxReplacer.vb (1)
128Return New TextSpan(start, [end] - start)
Syntax\VisualBasicSyntaxTree.vb (2)
109Return Me.WithChanges(newText, {New TextChangeRange(New TextSpan(0, Me.Length), newText.Length)}) 121If changes.Length = 1 AndAlso changes(0).Span = New TextSpan(0, Me.Length) AndAlso changes(0).NewLength = newText.Length Then
Microsoft.CodeAnalysis.VisualBasic.Features (12)
BraceMatching\InterpolatedStringBraceMatcher.vb (2)
38New TextSpan(interpolatedString.DollarSignDoubleQuoteToken.SpanStart, 2), 39New TextSpan(interpolatedString.DoubleQuoteToken.Span.End - 1, 1))
BraceMatching\StringLiteralBraceMatcher.vb (2)
31New TextSpan(token.SpanStart, 1), 32New TextSpan(token.Span.End - 1, 1))
ChangeSignature\ChangeSignatureFormattingRule.vb (1)
30New TextSpan(firstToken.SpanStart, lastToken.Span.End - firstToken.SpanStart),
Completion\CompletionProviders\OverrideCompletionProvider.vb (4)
205Return New TextSpan(methodStatement.GetLocation().SourceSpan.End, 0) 212Return New TextSpan(lastStatement.GetLocation().SourceSpan.End, 0) 222Return New TextSpan(lastAccessorStatement.GetLocation().SourceSpan.End, 0) 227Return New TextSpan(0, 0)
Debugging\VisualBasicBreakpointService.vb (1)
52span:=New TextSpan(position, length),
GenerateType\VisualBasicGenerateTypeService.vb (1)
445semanticModel.SyntaxTree.GetLocation(New TextSpan(lastMember.Span.End, 0)))
Snippets\VisualBasicSnippetFunctionService.vb (1)
47Dim typeSpan = New TextSpan(caseGenerationLocation.Start + "Case ".Length, fullyQualifiedTypeName.Length)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
Classification\Worker.vb (1)
146AddClassification(New TextSpan(trivia.SpanStart, 1), ClassificationTypeNames.Punctuation)
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
97newSpan = New TextSpan(oldSpan.Start, newSpan.Length) 237Me._renameSpansTracker.AddComplexifiedSpan(Me._documentId, oldSpan, New TextSpan(oldSpan.Start, newSpan.Length), Me._modifiedSubSpans) 295AddModifiedSpan(annotation.OriginalSpan, New TextSpan(token.Span.Start, newToken.Span.Length))
Simplification\Simplifiers\NameSimplifier.vb (1)
375issueSpan = New TextSpan(name.Span.End - 9, 9)
Microsoft.CodeAnalysis.Workspaces (50)
Classification\ClassifierHelper.cs (1)
97var widenedSpan = new TextSpan(spans[0].Start, spans[^1].End);
Classification\IRemoteSemanticClassificationService.cs (1)
119new TextSpan(
CodeCleanup\CodeCleaner.cs (1)
53return await CleanupAsync(document, new TextSpan(0, text.Length), options, providers, cancellationToken: cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
232var location = Location.Create(root.SyntaxTree, new TextSpan(positionOfReferenceInTree, length));
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
220var location = state.SyntaxTree.GetLocation(new TextSpan(indexerReference.SpanStart, 0));
FindSymbols\SyntaxTree\SyntaxTreeIndex_Persistence.cs (1)
95new TextSpan(reader.ReadInt32(), reader.ReadInt32()));
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
209var span = new TextSpan(spanStart, spanLength);
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (4)
228mergeConflictResolutionSpans.Add(new TextSpan(commentChangesList[commentChangeIndex].Span.Start + currentPositionDelta, commentChangesList[commentChangeIndex].NewText!.Length)); 242var conflictingCommentInsertionLocation = new TextSpan(mergedChange.Span.Start, 0); 246mergeConflictResolutionSpans.Add(new TextSpan(commentChangesList[commentChangeIndex].Span.Start + currentPositionDelta, commentChangesList[commentChangeIndex].NewText!.Length)); 261mergeConflictResolutionSpans.Add(new TextSpan(commentChangesList[commentChangeIndex].Span.Start + currentPositionDelta, commentChangesList[commentChangeIndex].NewText!.Length));
PatternMatching\AllLowerCamelCaseMatcher.cs (1)
192var matchSpanToAdd = new TextSpan(candidateHump.Start, possibleHumpMatchLength);
PatternMatching\PatternMatcher.cs (4)
321=> _includeMatchedSpans ? new TextSpan(start, length) : null; 453=> PartStartsWith(candidate, candidatePart, pattern, new TextSpan(0, pattern.Length), compareOptions); 590matchSpans.Add(new TextSpan(candidateHump.Start, patternChunkCharacterSpan.Length)); 600candidateHump = new TextSpan(candidateHump.Start + patternChunkCharacterSpan.Length, candidateHump.Length - patternChunkCharacterSpan.Length);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
888var subSpan = new TextSpan(offset, length);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
438var matchTextSpan = new TextSpan(start, renameText.Length);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
126=> ReuseExistingSpeculativeModelAsync(document, new TextSpan(position, 0), cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Workspace\Solution\Document.cs (1)
486if (textChanges.Length > 1 || (textChanges.Length == 1 && textChanges[0].Span != new TextSpan(0, oldText.Length)))
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
131return new TextSpan(start, end - start);
Roslyn.Diagnostics.Analyzers (31)
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
29var fullSpan = new TextSpan(0, text.Length);
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (1)
118var sectionSpan = new TextSpan(activeSectionStart, activeSectionEnd);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualChar.cs (1)
96public TextSpan Span => new(TokenStart + Green.Offset, Green.Width);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
53: this(sequence, new TextSpan(0, sequence.Length)) 88=> new(_leafCharacters, new TextSpan(_span.Start + start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
424DebugCheckEmpty(_indentationTree, new TextSpan(position, 0)); 475DebugCheckEmpty(_anchorTree, new TextSpan(span.Start, 0));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (1)
285if (context.IsFormattingDisabled(new TextSpan(context.TokenStream.LastTokenInStream.Token.SpanStart, 0)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (1)
209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
260span = new TextSpan(span.Start + i, span.Length - i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (3)
737return new TextSpan(this.StartPosition, 0); 745return new TextSpan(Math.Min(this.StartPosition + i + 1, this.EndPosition), 0); 751return new TextSpan(this.EndPosition, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (2)
25Current = new TextSpan(nameSpan.Start, 0); 52Current = new TextSpan(Current.End + _wordSeparator.Length, 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
679return Location.Create(syntaxTree, new TextSpan(start, length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (1)
107_wordSpans[i] = new TextSpan(characterIndex, value.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
38new TextSpan(start: reader.ReadInt32(), length: reader.ReadInt32()),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (7)
52return new TextSpan(wordStart, 1); 70return new TextSpan(wordStart, 1); 98return new TextSpan(wordStart, 1); 129return new TextSpan(wordStart, end - wordStart); 135return new TextSpan(wordStart, current - wordStart); 147return new TextSpan(wordStart, 1); 159return new TextSpan(wordStart, current - wordStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
126=> ReuseExistingSpeculativeModelAsync(document, new TextSpan(position, 0), cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\ParsedDocument.cs (1)
79textChanges.Count == 1 && textChanges[0].Span != new TextSpan(0, oldDocument.Text.Length))
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (1)
45fixAllSpan = new TextSpan(root.FullSpan.Start, firstTypeOrNamespaceDecl.FullSpan.Start - 1);