1 write to Length
Microsoft.CodeAnalysis (1)
Text\TextSpan.cs (1)
35
Length
= length;
739 references to Length
dotnet (1)
Commands\Run\FileBasedAppSourceEditor.cs (1)
233
var length = span.
Length
;
dotnet-format (3)
Formatters\DocumentFormatter.cs (3)
188
var isAdd = change.Span.
Length
== 0;
197
? string.Format(Resources.Delete_0_characters, change.Span.
Length
)
200
: string.Format(Resources.Replace_0_characters_with_1, change.Span.
Length
, textChange);
GenerateDocumentationAndConfigFiles (60)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
70
bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
398
if (p.
Length
> 0 && char.IsLetter(name[p.Start]))
399
return name.Substring(p.Start, p.
Length
).ToCamelCase();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
147
=> !spansTree.HasIntervalThatOverlapsWith(nodeOrToken.FullSpan.Start, nodeOrToken.FullSpan.
Length
);
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
471
var text = source.Substring(location.SourceSpan.Start, location.SourceSpan.
Length
);
Microsoft.AspNetCore.App.Analyzers (11)
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (1)
176
index += result[result.Count - 1].Span.
Length
;
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (3)
225
lineStart = lineSpan.
Length
> indentationLength
281
index += charResults.Last().span.
Length
;
291
index += charResults.Last().span.
Length
;
Infrastructure\VirtualChars\VirtualCharSequence.cs (2)
73
public int Length => _span.
Length
;
91
=> new(_leafCharacters, new TextSpan(_span.Start + span.Start, span.
Length
));
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
260
properties.Add(LengthKey, textChange.Span.
Length
.ToString(CultureInfo.InvariantCulture));
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (2)
104
if (token.Span.
Length
== 0)
138
if (token.Span.
Length
> 0 && token.SpanStart <= position)
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
139
properties.Add(LengthKey, textChange.Span.
Length
.ToString(CultureInfo.InvariantCulture));
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
294
var fullSyntaxLength = location.SourceSpan.
Length
;
Microsoft.CodeAnalysis (68)
Diagnostic\SourceLocation.cs (1)
130
return base.GetDebuggerDisplay() + "\"" + _syntaxTree.ToString().Substring(_span.Start, _span.
Length
) + "\"";
DiagnosticAnalyzer\AnalysisScope.cs (1)
169
if (filterSpan.GetValueOrDefault().Start == 0 && filterSpan.GetValueOrDefault().
Length
== filterFile.GetValueOrDefault().SourceTree!.Length)
Syntax\SyntaxDiffer.cs (21)
116
delta += change.Range.NewLength - change.Range.Span.
Length
;
311
if (sim >= Math.Max(_oldNodes.Peek().FullSpan.
Length
, _newNodes.Peek().FullSpan.
Length
))
329
if (child.FullSpan.
Length
> 0)
359
var sim = node.FullSpan.
Length
;
373
if (sim == node.FullSpan.
Length
&& node.IsToken)
405
similarity = node.FullSpan.
Length
;
460
w += tr.FullSpan.
Length
;
469
w += tr.FullSpan.
Length
;
491
w += n2.FullSpan.
Length
;
550
RecordChange(new TextChangeRange(oldSpan, newSpan.
Length
), removedNode, insertedNode);
560
RecordChange(new ChangeRecord(new TextChangeRange(oldSpan, newSpan.
Length
), removedNodes, insertedNodes));
570
RecordChange(new ChangeRecord(new TextChangeRange(new TextSpan(start, 0), newSpan.
Length
), null, insertedNodes));
582
new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.
Length
+ change.Range.Span.
Length
), last.Range.NewLength + change.Range.NewLength),
605
new TextChangeRange(new TextSpan(last.Range.Span.Start, last.Range.Span.
Length
+ textChangeRange.Span.
Length
), last.Range.NewLength + textChangeRange.NewLength),
749
if (cr.Range.Span.
Length
> 0 && cr.Range.NewLength > 0)
764
new TextSpan(range.Span.Start + commonLeadingCount, range.Span.
Length
- (commonLeadingCount + commonTrailingCount)),
779
if (range.Span.
Length
> 0 || range.NewLength > 0)
828
var builder = new StringBuilder(span.
Length
);
Syntax\SyntaxNode.Iterators.cs (1)
55
|| (childSpan.
Length
== 0 && span.IntersectsWith(childSpan));
Text\ChangedText.cs (1)
38
deltaLength += change.NewLength - change.Span.
Length
;
Text\CompositeText.cs (4)
88
var count = span.
Length
;
504
var lineLength = firstSegmentTextLine.SpanIncludingLineBreak.
Length
;
517
lineLength += nextSegment.Lines[0].SpanIncludingLineBreak.
Length
;
529
lineLength += lastSegmentLine.SpanIncludingLineBreak.
Length
;
Text\LargeText.cs (1)
190
int count = span.
Length
;
Text\SourceText.cs (3)
505
int spanLength = span.
Length
;
811
if (change.Span.
Length
== 0 && newTextLength == 0)
943
newPosDelta += range.NewLength - range.Span.
Length
;
Text\StringBuilderText.cs (1)
85
return _builder.ToString(span.Start, span.
Length
);
Text\StringText.cs (2)
78
if (span.Start == 0 && span.
Length
== this.Length)
83
return this.Source.Substring(span.Start, span.
Length
);
Text\SubText.cs (6)
43
public override int Length => UnderlyingSpan.
Length
;
75
return UnderlyingText.ToString(GetCompositeSpan(span.Start, span.
Length
));
82
return new SubText(UnderlyingText, GetCompositeSpan(span.Start, span.
Length
));
88
UnderlyingText.CopyTo(span.Start, destination, destinationIndex, span.
Length
);
145
return TextLine.FromSpanUnsafe(_subText, new TextSpan(_subText.UnderlyingSpan.
Length
, 0), lineBreakLength: 0);
202
if (position < 0 || position > _subText.UnderlyingSpan.
Length
)
Text\TextChange.cs (1)
108
return $"new TextChange(new TextSpan({Span.Start}, {Span.
Length
}), {newTextDisplay})";
Text\TextChangeRange.cs (3)
108
diff += change.NewLength - change.Span.
Length
;
128
var newLen = combined.
Length
+ diff;
135
return $"new TextChangeRange(new TextSpan({Span.Start}, {Span.
Length
}), {NewLength})";
Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
Text\TextLine.cs (3)
77
span = new TextSpan(span.Start, span.
Length
+ lineBreakLen);
87
return new TextLine(text, Pack(span.Start, span.
Length
, lineBreakLen));
103
return new TextLine(text, Pack(span.Start, span.
Length
, lineBreakLength));
Text\TextSpan.cs (9)
47
public int End => Start +
Length
;
58
public bool IsEmpty => this.
Length
== 0;
72
return unchecked((uint)(position - Start) < (uint)
Length
);
156
return unchecked((uint)(position - Start) <= (uint)
Length
);
221
return Start == other.Start &&
Length
== other.
Length
;
235
return Hash.Combine(Start,
Length
);
259
return
Length
- other.
Length
;
Microsoft.CodeAnalysis.Analyzers (61)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (1)
683
properties = properties.Add(DefineDescriptorArgumentCorrectlyFixAdditionalDocumentLocationInfo, $"{span.Start}{AdditionalDocumentLocationInfoSeparator}{span.
Length
}{AdditionalDocumentLocationInfoSeparator}{fixLocation.GetLineSpan().Path}");
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
70
bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
398
if (p.
Length
> 0 && char.IsLetter(name[p.Start]))
399
return name.Substring(p.Start, p.
Length
).ToCamelCase();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
147
=> !spansTree.HasIntervalThatOverlapsWith(nodeOrToken.FullSpan.Start, nodeOrToken.FullSpan.
Length
);
Microsoft.CodeAnalysis.AnalyzerUtilities (56)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
Microsoft.CodeAnalysis.CodeStyle (57)
src\roslyn\src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
69
var offset = change.Span.
Length
- change.NewText.Length;
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
166
if (condition.Span.
Length
+ trueSyntax.Span.
Length
+ falseSyntax.Span.
Length
> formattingOptions.ConditionalExpressionWrappingLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
70
bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
398
if (p.
Length
> 0 && char.IsLetter(name[p.Start]))
399
return name.Substring(p.Start, p.
Length
).ToCamelCase();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
147
=> !spansTree.HasIntervalThatOverlapsWith(nodeOrToken.FullSpan.Start, nodeOrToken.FullSpan.
Length
);
Microsoft.CodeAnalysis.CSharp (14)
Compiler\UnprocessedDocumentationCommentFinder.cs (1)
56
if (node.Span.
Length
> 0)
FlowAnalysis\AbstractFlowPass.cs (2)
299
Debug.Assert(span.
Length
> 0);
300
if (span.
Length
== 0)
FlowAnalysis\ControlFlowPass.cs (1)
265
statement.Syntax.Span.
Length
!= 0)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
631
return new TextSpan(startSpan.Start, originalSpan.
Length
- (startSpan.Start - originalSpan.Start));
Parser\Blender.Reader.cs (1)
134
_changeDelta += change.NewLength - change.Span.
Length
;
Parser\LexerCache.cs (1)
192
Debug.Assert(span.
Length
> 0);
Parser\SlidingTextWindow.cs (1)
207
textSpan = _characterWindow.AsSpan(span.Start - _characterWindowStartPositionInText, span.
Length
);
Symbols\Source\SourceConstructorSymbolBase.cs (1)
208
ctorInitializerLength = span.
Length
;
Symbols\Source\SourceMemberContainerSymbol.cs (2)
1223
aggregateLength += syntaxRef.Span.
Length
;
1353
return initializer.Syntax.Span.
Length
;
Symbols\Symbol.cs (1)
509
if (location.SourceSpan.
Length
!= 0)
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (1)
85
get { return _root.FullSpan.
Length
; }
Syntax\SyntaxTreeDiagnosticEnumerator.cs (1)
42
var fullTreeLength = syntaxTree.GetRoot().FullSpan.
Length
;
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
52
if (_ignoredSpans.HasIntervalThatContains(node.SpanStart, node.Span.
Length
))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
212
lineStart = lineSpan.
Length
> indentationLength
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (4)
370
return token.Span.
Length
== startDelimiterLength ||
371
(token.Span.
Length
> startDelimiterLength && endDelimiterLength < startDelimiterLength);
376
return token.Span.
Length
== startDelimiterLength ||
377
(token.Span.
Length
> startDelimiterLength && token.Text[^1] != lastChar);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (1)
125
var initialColumn = (token1.RawKind == 0) ? 0 : this.TreeInfo.GetOriginalColumn(Options.TabSize, token1) + token1.Span.
Length
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
182
while (commonIndentation < indentation.Length && commonIndentation < textLine.Span.
Length
)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
802
totalLength += expression.Span.
Length
;
831
totalLength += component.Span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
121
stack += token.Span.
Length
;
Microsoft.CodeAnalysis.CSharp.Features (36)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (1)
211
amountToShift += (newRange.NewLength - newRange.Span.
Length
);
BraceCompletion\ParenthesisBraceCompletionService.cs (1)
44
if (closeParen.Kind() != SyntaxKind.CloseParenToken || closeParen.Span.
Length
== 0)
BraceCompletion\StringLiteralBraceCompletionService.cs (1)
75
token.Span.
Length
> 1 &&
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
52
if (textSpan.
Length
> 0)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (2)
194
if (type.Span.
Length
!= subSpan.
Length
)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (1)
85
var text = baseName.Substring(@break.Start, @break.
Length
);
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
179
if (ch.Span.
Length
== 2 && ch != 0)
ConvertToRawString\ConvertToRawStringHelpers.cs (2)
52
if (ch.Span.
Length
> 1)
99
if (ch.Span.
Length
> 1)
Debugging\CSharpBreakpointResolutionService.cs (1)
41
if (span.
Length
== 0)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (6)
144
if (_ignoredSpans?.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) ?? false)
161
if (_ignoredSpans?.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) ?? false)
178
if (_ignoredSpans?.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) ?? false)
195
if (_ignoredSpans?.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) ?? false)
233
if (_ignoredSpans?.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) ?? false)
250
if (_ignoredSpans?.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) ?? false)
EditAndContinue\BreakpointSpans.cs (1)
94
if (breakpointSpan.Value.
Length
>= minLength)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (6)
577
=> BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent!, token.SpanStart, minLength: token.Span.
Length
, out span);
1822
(commonForEachStatement.AwaitKeyword.Span.
Length
> 0) ? commonForEachStatement.AwaitKeyword.SpanStart : commonForEachStatement.ForEachKeyword.SpanStart,
1938
=> (first.
Length
> 0 && second.
Length
> 0) ? TextSpan.FromBounds(first.Start, second.End) : (first.
Length
> 0) ? first : (second.
Length
> 0) ? second : defaultSpan;
InlineHints\CSharpInlineTypeHintsService.cs (1)
133
var trailingSpace = span.
Length
== 0;
RawStringLiteral\CSharpRawStringLiteralOnAutoInsertService.cs (1)
159
if (token.Span.
Length
< (2 * quoteCount))
SplitOrMergeIfStatements\CSharpMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
36
if (span.
Length
== 0 ||
51
if (span.
Length
== 0 ||
SplitOrMergeIfStatements\CSharpMergeNestedIfStatementsCodeRefactoringProvider.cs (2)
36
if (span.
Length
== 0 ||
51
if (span.
Length
== 0 ||
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
52
if (_ignoredSpans.HasIntervalThatContains(node.SpanStart, node.Span.
Length
))
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
182
while (commonIndentation < indentation.Length && commonIndentation < textLine.Span.
Length
)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
802
totalLength += expression.Span.
Length
;
831
totalLength += component.Span.
Length
;
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
208
info.TotalLength += trivia.FullSpan.
Length
;
214
info.TotalLength += trivia.FullSpan.
Length
;
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
Classification\ClassificationHelpers.cs (2)
540
if (token.Span.
Length
== span.
Length
)
Classification\Worker.cs (1)
59
=> span.
Length
> 0 && _textSpan.OverlapsWith(span);
Rename\CSharpRenameRewriterLanguageService.cs (2)
109
newSpan = new TextSpan(oldSpan.Start, newSpan.
Length
);
314
_renameSpansTracker.AddComplexifiedSpan(_documentId, oldSpan, new TextSpan(oldSpan.Start, newSpan.
Length
), _modifiedSubSpans);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
212
lineStart = lineSpan.
Length
> indentationLength
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (4)
370
return token.Span.
Length
== startDelimiterLength ||
371
(token.Span.
Length
> startDelimiterLength && endDelimiterLength < startDelimiterLength);
376
return token.Span.
Length
== startDelimiterLength ||
377
(token.Span.
Length
> startDelimiterLength && token.Text[^1] != lastChar);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (1)
125
var initialColumn = (token1.RawKind == 0) ? 0 : this.TreeInfo.GetOriginalColumn(Options.TabSize, token1) + token1.Span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
121
stack += token.Span.
Length
;
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (1)
62
=> _root.FullSpan.
Length
;
Microsoft.CodeAnalysis.Features (52)
BraceMatching\AbstractBraceMatcher.cs (1)
35
where tok.Span.
Length
> 0
ClassifiedSpansAndHighlightSpanFactory.cs (1)
61
length: narrowSpan.
Length
);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (3)
154
var delta = textChange.NewText.Length - textChange.Span.
Length
;
161
currentSpan = new TextSpan(newStart, currentSpan.
Length
);
167
var newLength = currentSpan.
Length
+ delta;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (3)
45
var spanChange = newStartToken.LeadingTrivia.FullSpan.
Length
- startToken.LeadingTrivia.FullSpan.
Length
;
46
diagnosticSpan = new TextSpan(diagnosticSpan.Start + spanChange, diagnosticSpan.
Length
);
CodeLens\CodeLensReferencesService.cs (5)
138
var referenceSpan = new TextSpan(spanStart, token.Span.
Length
);
151
token.Span.
Length
,
157
referenceSpan.
Length
,
271
result.Span.
Length
,
293
reference.Value.MappedSpan.
Length
);
Completion\Utilities.cs (2)
39
var sumOfDeltas = changes.Sum(c => c.NewText!.Length - c.Span.
Length
);
40
var totalNewSpan = new TextSpan(totalOldSpan.Start, totalOldSpan.
Length
+ sumOfDeltas);
Copilot\CopilotUtilities.cs (1)
47
totalDelta += newTextLength - change.Span.
Length
;
Copilot\ICopilotChangeAnalysisService.cs (1)
309
codeFixCollection.TextSpan.
Length
,
Copilot\IProposalAdjusterService.cs (3)
286
if (editSpan.
Length
== 0 && editSpan.Start == protectedSpan.End)
321
if (beforeSpan.
Length
> 0 || beforeText.Length > 0)
326
if (afterSpan.
Length
> 0 || afterText.Length > 0)
Debugging\DebugDataTipInfo.cs (1)
24
=> Span.
Length
== 0 && Span.Start == 0 && Text == null;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (4)
168
=> oldToken.RawKind == newToken.RawKind && oldToken.Span.
Length
== newToken.Span.
Length
&& AreEquivalentImpl(oldToken, newToken);
1819
if (TryGetActiveSpan(statement, statementPart, minLength: statement.Span.
Length
, out var span))
6845
Debug.Assert(otherNode.FullSpan.
Length
> 0);
EmbeddedLanguages\Classification\AbstractFallbackEmbeddedLanguageClassifier.cs (1)
49
if (vc.Span.
Length
> 1)
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
114
properties.Add(new(LengthKey, textChange.Span.
Length
.ToString()));
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (1)
101
properties.Add(KeyValuePair.Create(LengthKey, textChange.Span.
Length
.ToString()));
QuickInfo\IndentationHelper.cs (2)
62
if (spanBeforeDeletion.
Length
> 0)
74
if (span.
Length
> 0)
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
168
if (span.
Length
!= 0)
SemanticSearch\SemanticSearchDefinitionItemFactory.cs (3)
71
displayParts: displaySpan.
Length
== span.
Length
? [displayText] : [displayText, new TaggedText(TextTags.Punctuation, "…")],
78
=> new(span.Start, Math.Min(span.
Length
, maxLength));
Snippets\RoslynLSPSnippetConverter.cs (1)
46
for (var i = 0; i < textChange.Span.
Length
+ 1;)
SolutionCrawler\AbstractDocumentDifferenceService.cs (3)
176
var lengthDelta = range.NewLength - range.Span.
Length
;
178
return (oldMember.Span.
Length
+ lengthDelta) == newMember.Span.
Length
? newMember : null;
SpellCheck\AbstractSpellCheckSpanService.cs (3)
60
if (span.TextSpan.
Length
> 0)
172
seenEscape = seenEscape || endChar.Span.
Length
> 1;
176
else if (endChar == ' ' && endChar.Span.
Length
== 1)
SplitOrMergeIfStatements\AbstractSplitIfStatementCodeRefactoringProvider.cs (1)
38
if (textSpan.
Length
> 0 &&
src\roslyn\src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
69
var offset = change.Span.
Length
- change.NewText.Length;
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
166
if (condition.Span.
Length
+ trueSyntax.Span.
Length
+ falseSyntax.Span.
Length
> formattingOptions.ConditionalExpressionWrappingLength)
TaskList\AbstractTaskListService.cs (1)
137
var message = postfixLength == 0 ? fullString : fullString[..(fullSpan.
Length
- postfixLength)];
Wrapping\ChainedExpression\ChainedExpressionCodeActionComputer.cs (2)
142
var position = _firstPeriodIndentationTrivia.FullSpan.
Length
+ NormalizedWidth(firstChunk);
155
position = indentationTrivia.FullSpan.
Length
;
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (3)
314
currentOffset += item.Span.
Length
;
331
currentOffset = indentationTrivia.FullWidth() + item.Span.
Length
;
341
currentOffset += comma.Span.
Length
;
Microsoft.CodeAnalysis.Razor.Compiler (10)
CSharp\TextSpanExtensions.cs (1)
15
return new SourceSpan(filePath: null, absoluteIndex: textSpan.Start, lineIndex: -1, characterIndex: -1, length: textSpan.
Length
);
Language\Legacy\RoslynCSharpTokenizer.cs (7)
316
Debug.Assert(nextResult.Token.FullSpan.
Length
== 0);
375
for (var finalPosition = Source.Position + csharpToken.Span.
Length
; Source.Position < finalPosition;)
528
new SourceSpan(CurrentStart, contentLength: trivia.FullSpan.
Length
)));
546
new SourceSpan(CurrentStart, contentLength: trivia.FullSpan.
Length
)));
556
new SourceSpan(CurrentStart, contentLength: directiveTrivia.FullSpan.
Length
)));
695
var finalPosition = Source.Position + span.
Length
;
737
Debug.Assert(_resultCache[^1].result is { Token.FullSpan.
Length
: 0 });
Language\Legacy\SeekableTextReader.cs (1)
127
_location = new SourceLocation(_filePath, Length, lineNumber, SourceText.Lines[lineNumber].Span.
Length
);
Language\Syntax\SyntaxNode.Iterators.cs (1)
68
|| (childSpan.
Length
== 0 && span.IntersectsWith(childSpan));
Microsoft.CodeAnalysis.ResxSourceGenerator (56)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
Microsoft.CodeAnalysis.VisualBasic (13)
Analysis\FlowAnalysis\AbstractFlowPass.Regions.vb (1)
55
If span.
Length
= 0 Then
GlobalImport.vb (1)
119
Dim length = unmappedSpan.
Length
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (1)
550
Return New Text.TextSpan(startSpan.Start, originalSpan.
Length
- (startSpan.Start - originalSpan.Start))
Scanner\Blender.vb (6)
96
If span.
Length
= 0 Then
222
_affectedRange = New TextChangeRange(span, span.
Length
- _change.Span.
Length
+ _change.NewLength)
231
Return position - _change.NewLength + _change.Span.
Length
438
Debug.Assert(_curNodeSpan.
Length
> 0)
439
If _affectedRange.Span.
Length
= 0 Then
Scanner\Directives.vb (1)
546
lengthSkipped += skippedSpan.
Length
Scanner\Scanner.vb (1)
349
Return SyntaxFactory.DisabledTextTrivia(GetTextNotInterned(span.Start, span.
Length
))
Symbols\Source\SourceMemberContainerTypeSymbol.vb (1)
3253
aggregateLength += syntaxRef.Span.
Length
Syntax\VisualBasicSyntaxTree.ParsedSyntaxTree.vb (1)
97
Return _root.FullSpan.
Length
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (2)
233
(token.Span.
Length
= startLength OrElse
234
(token.Span.
Length
> startLength AndAlso Not token.ToString().EndsWith(lastChar, StringComparison.Ordinal)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (1)
79
Dim leading = SyntaxFactory.ParseLeadingTrivia(text.Substring(trailing.FullSpan.
Length
))
Microsoft.CodeAnalysis.VisualBasic.Features (14)
Debugging\VisualBasicBreakpointService.vb (2)
66
If span.
Length
= 0 Then
77
Return GetBreakpointAsync(document, textSpan.Start, textSpan.
Length
, cancellationToken)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (4)
120
If _ignoredSpans IsNot Nothing AndAlso _ignoredSpans.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) Then
132
If _ignoredSpans IsNot Nothing AndAlso _ignoredSpans.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) Then
144
If _ignoredSpans IsNot Nothing AndAlso _ignoredSpans.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) Then
176
If _ignoredSpans IsNot Nothing AndAlso _ignoredSpans.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) Then
EditAndContinue\BreakpointSpans.vb (1)
76
If breakpointSpan.Value.
Length
>= minLength Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (3)
128
While node.Span.
Length
< span.
Length
AndAlso node.Parent.SpanStart = position
303
Return BreakpointSpans.TryGetClosestBreakpointSpan(token.Parent, token.SpanStart, minLength:=token.Span.
Length
, span)
SplitOrMergeIfStatements\VisualBasicMergeConsecutiveIfStatementsCodeRefactoringProvider.vb (2)
29
If span.
Length
= 0 OrElse
51
If span.
Length
= 0 OrElse
SplitOrMergeIfStatements\VisualBasicMergeNestedIfStatementsCodeRefactoringProvider.vb (2)
29
If span.
Length
= 0 OrElse
59
If span.
Length
= 0 OrElse
Microsoft.CodeAnalysis.VisualBasic.Workspaces (18)
CaseCorrection\VisualBasicCaseCorrectionService.vb (1)
49
If span.
Length
<= s_threshold Then
Classification\Worker.vb (1)
85
If span.
Length
<> 0 AndAlso _textSpan.OverlapsWith(span) Then
CodeCleanup\Providers\AbstractTokensCodeCleanupProvider.vb (1)
57
_spans.GetIntervalsThatOverlapWith(node.FullSpan.Start, node.FullSpan.
Length
).Any()
CodeCleanup\Providers\AddMissingTokensCodeCleanupProvider.vb (3)
336
_spans.HasIntervalThatContains(span.Start, span.
Length
) AndAlso
453
If Not _spans.HasIntervalThatContains(span.Start, span.
Length
) Then
568
Return node IsNot Nothing AndAlso node.Span.
Length
> 0
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (5)
93
Not _spans.HasIntervalThatOverlapsWith(node.FullSpan.Start, node.FullSpan.
Length
) Then
203
If Not _spans.HasIntervalThatContains(span.Start, span.
Length
) Then
243
If Not _spans.HasIntervalThatContains(span.Start, span.
Length
) Then
272
If Not _spans.HasIntervalThatContains(span.Start, span.
Length
) Then
455
If Not _spans.HasIntervalThatContains(span.Start, span.
Length
) Then
Rename\VisualBasicRenameRewriterLanguageService.vb (3)
97
newSpan = New TextSpan(oldSpan.Start, newSpan.
Length
)
237
Me._renameSpansTracker.AddComplexifiedSpan(Me._documentId, oldSpan, New TextSpan(oldSpan.Start, newSpan.
Length
), Me._modifiedSubSpans)
295
AddModifiedSpan(annotation.OriginalSpan, New TextSpan(token.Span.Start, newToken.Span.
Length
))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (2)
233
(token.Span.
Length
= startLength OrElse
234
(token.Span.
Length
> startLength AndAlso Not token.ToString().EndsWith(lastChar, StringComparison.Ordinal)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Formatting\Engine\Trivia\TriviaDataFactory.TriviaRewriter.vb (1)
79
Dim leading = SyntaxFactory.ParseLeadingTrivia(text.Substring(trailing.FullSpan.
Length
))
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.ParsedSyntaxTree.vb (1)
57
Return _root.FullSpan.
Length
Microsoft.CodeAnalysis.Workspaces (103)
Classification\ClassifierHelper.cs (2)
199
if (span.TextSpan.
Length
== 0)
271
syntacticPartSpan.Start, syntacticPartSpan.
Length
, ref tempBuffer.AsRef(),
Classification\IRemoteSemanticClassificationService.cs (1)
91
classificationTriples.Add(textSpan.
Length
);
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (1)
87
if (textSpan.
Length
> 0 && textSpan.OverlapsWith(_textSpan))
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (4)
161
return newRoot.FullSpan.
Length
;
165
return oldRoot.FullSpan.
Length
;
229
return newRoot.FullSpan.
Length
;
233
return oldRoot.FullSpan.
Length
;
CodeCleanup\AbstractCodeCleanerService.cs (2)
338
var start = intervalTree.HasIntervalThatOverlapsWith(previousToken.SpanStart, previousToken.Span.
Length
)
343
var end = intervalTree.HasIntervalThatOverlapsWith(nextToken.SpanStart, nextToken.Span.
Length
)
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (2)
106
change.Span.Start, change.Span.
Length
, ref overlappingSpans);
109
change.Span.Start, change.Span.
Length
, ref intersectingSpans);
FindSymbols\FindReferences\FindReferenceCache.cs (1)
203
if (span.Start == index && span.
Length
== text.Length && isMatch(text, token, args))
FindSymbols\SyntaxTree\SyntaxTreeIndex_Persistence.cs (1)
51
writer.WriteInt32(span.
Length
);
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (1)
193
writer.WriteInt32(Span.
Length
);
FindSymbols\TopLevelSyntaxTree\NavigateToSearchIndex.NavigateToSearchInfo.cs (1)
264
for (var prefixLen = 1; prefixLen <= part.
Length
; prefixLen++)
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (4)
229
currentPositionDelta += commentChangesList[commentChangeIndex].NewText!.Length - commentChangesList[commentChangeIndex].Span.
Length
;
237
currentPositionDelta += mergedChange.NewText!.Length - mergedChange.Span.
Length
;
254
currentPositionDelta += mergedChange.NewText!.Length - mergedChange.Span.
Length
;
263
currentPositionDelta += commentChangesList[commentChangeIndex].NewText!.Length - commentChangesList[commentChangeIndex].Span.
Length
;
PatternMatching\AllLowerCamelCaseMatcher.cs (1)
157
var maxCandidateHumpLength = candidateHump.
Length
;
PatternMatching\PatternMatcher.cs (8)
433
if (patternPart.
Length
> candidatePart.
Length
)
440
candidate, candidatePart.Start, patternPart.
Length
,
441
pattern, patternPart.Start, patternPart.
Length
, compareOptions) == 0;
590
matchSpans.Add(new TextSpan(candidateHump.Start, patternChunkCharacterSpan.
Length
));
600
candidateHump = new TextSpan(candidateHump.Start + patternChunkCharacterSpan.
Length
, candidateHump.
Length
- patternChunkCharacterSpan.
Length
);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
887
var length = renameLocation.Location.SourceSpan.
Length
;
Rename\ConflictEngine\RenamedSpansTracker.cs (4)
63
adjustedStartingPosition += newSpan.
Length
- oldSpan.
Length
;
76
adjustedStartingPosition += c.NewSpan.
Length
- c.OriginalSpan.
Length
;
Rename\RenameUtilities.cs (2)
306
if (replaceInsideString.Substring(subSpan.Start, subSpan.
Length
) != matchText)
317
startOffset += offset + subSpan.
Length
;
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
387
.Where(t => syntaxFactsService.IsStringLiteralOrInterpolatedStringLiteral(t) && t.Span.
Length
>= renameTextLength)
405
.Where(t => t.Span.
Length
>= renameTextLength)
Shared\Extensions\FileLinePositionSpanExtensions.cs (4)
60
startColumn = lines[startLine].SpanIncludingLineBreak.
Length
;
73
endColumn = lines[endLine].SpanIncludingLineBreak.
Length
;
77
startColumn = Math.Min(startColumn, lines[startLine].SpanIncludingLineBreak.
Length
);
78
endColumn = Math.Min(endColumn, lines[endLine].SpanIncludingLineBreak.
Length
);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
70
bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
398
if (p.
Length
> 0 && char.IsLetter(name[p.Start]))
399
return name.Substring(p.Start, p.
Length
).ToCamelCase();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
147
=> !spansTree.HasIntervalThatOverlapsWith(nodeOrToken.FullSpan.Start, nodeOrToken.FullSpan.
Length
);
Workspace\Solution\DocumentState.cs (1)
283
if (change.Span.
Length
< MaxTextChangeRangeLength && change.NewLength < MaxTextChangeRangeLength)
Microsoft.DotNet.ProjectTools (2)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
200
var length = trivia.FullSpan.
Length
- (trivia.FullSpan.Intersection(excludeSpan)?.
Length
?? 0);
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckNameofFixProvider.cs (2)
92
if (candidate.Span.
Length
< shortestSymbol)
95
shortestSymbol = candidate.Span.
Length
;
Roslyn.Diagnostics.Analyzers (60)
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (10)
86
currentNewEnd = currentNewEnd + newChange.NewLength - newChange.Span.
Length
;
150
if (oldChange.Span.
Length
== 0 && oldChange.NewLength == 0)
224
var oldChangeLeadingDeletion = Math.Min(oldChange.Span.
Length
, oldChangeLeadingInsertion);
226
oldChange = new TextChangeRange(new TextSpan(newChange.SpanStart - oldDelta, oldChange.Span.
Length
- oldChangeLeadingDeletion), oldChange.NewLength - oldChangeLeadingInsertion);
308
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
310
var newDeletion = newChange.SpanLength + oldChange.Span.
Length
- oldChange.NewLength;
373
oldDelta = oldDelta - oldChange.Span.
Length
+ oldChange.NewLength;
391
builder[^1] = new TextChangeRange(new TextSpan(last.Span.Start, last.Span.
Length
+ change.Span.
Length
), last.NewLength + change.NewLength);
430
: this(range.Span.Start, range.Span.
Length
, range.NewLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (1)
286
if ((span2.
Length
== 0) || (span1.Start >= span2.End))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\TextSpanMutableIntervalTree.cs (2)
28
=> this.HasIntervalThatIntersectsWith(span.Start, span.
Length
);
31
=> this.HasIntervalThatOverlapsWith(span.Start, span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (1)
72
public int Length => _span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (8)
196
=> node.Span.
Length
;
199
=> node.FullSpan.
Length
;
424
d = x.
Length
- y.
Length
;
555
if (token.Span.
Length
> 0 && position <= token.Span.End)
585
if (token.Span.
Length
> 0 && token.SpanStart <= position)
641
if (token.Span.
Length
== 0)
681
if (token.Span.
Length
== 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (2)
53
=> token.Span.
Length
;
56
=> token.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTriviaExtensions.cs (2)
10
=> trivia.Span.
Length
;
13
=> trivia.FullSpan.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (5)
412
var intervals = tree.GetIntervalsThatContain(textSpan.Start, textSpan.
Length
);
542
var anchorData = _anchorTree.GetIntervalsThatOverlapWith(baseAnchorData.TextSpan.Start, baseAnchorData.TextSpan.
Length
);
600
var data = _suppressWrappingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
629
var data = _suppressSpacingTree.GetSmallestEdgeExclusivelyContainingInterval(textSpan.Start, textSpan.
Length
);
651
=> _suppressFormattingTree.HasIntervalThatIntersectsWith(textSpan.Start, textSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
129
currentNodeSpan.
Length
< resultSpan.
Length
)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83
var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
59
var sizeOfList = spanToFormat.
Length
/ MagicTextLengthToTokensRatio;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
243
for (; i < span.
Length
; i++)
252
if (i == span.
Length
&& text.Length == newText.Length)
260
span = new TextSpan(span.Start + i, span.
Length
- i);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AnchorIndentationOperation.cs (1)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\IndentBlockOperation.cs (2)
18
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
40
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\SuppressOperation.cs (1)
21
Contract.ThrowIfTrue(textSpan.Start < 0 || textSpan.
Length
< 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
501
for (var i = span.Start - this.Token1.Span.End; i < span.
Length
; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (1)
77
words.Add(name.Substring(part.Start, part.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (2)
161
Debug.Assert(spanToCheck.
Length
> 0);
178
=> name.Substring(wordSpan.Start, wordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (3)
21
Debug.Assert(nameSpan.
Length
> 0);
35
if (Current.
Length
== 0)
74
return Current.
Length
> 0 && Current.End <= _nameSpan.End;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\AbstractDocumentationCommentService.cs (1)
74
var sb = new StringBuilder(summaryElement.Span.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
264
WriteInteger(location.SourceSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (2)
194
_concatenatedLowerCaseWords.AsSpan(currentNode.CharacterSpan.Start, currentNode.CharacterSpan.
Length
),
195
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (2)
120
_concatenatedLowerCaseWords.AsSpan(characterSpan.Start, characterSpan.
Length
),
128
result.Add(new string(_concatenatedLowerCaseWords, characterSpan.Start, characterSpan.
Length
));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Node.cs (1)
30
writer.WriteInt32(WordSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (1)
70
bool OverlapsWithSpan(SyntaxNode n) => spansTree.HasIntervalThatOverlapsWith(n.FullSpan.Start, n.FullSpan.
Length
);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (2)
398
if (p.
Length
> 0 && char.IsLetter(name[p.Start]))
399
return name.Substring(p.Start, p.
Length
).ToCamelCase();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
147
=> !spansTree.HasIntervalThatOverlapsWith(nodeOrToken.FullSpan.Start, nodeOrToken.FullSpan.
Length
);
Roslyn.Diagnostics.CSharp.Analyzers (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
212
lineStart = lineSpan.
Length
> indentationLength
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (4)
370
return token.Span.
Length
== startDelimiterLength ||
371
(token.Span.
Length
> startDelimiterLength && endDelimiterLength < startDelimiterLength);
376
return token.Span.
Length
== startDelimiterLength ||
377
(token.Span.
Length
> startDelimiterLength && token.Text[^1] != lastChar);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (1)
125
var initialColumn = (token1.RawKind == 0) ? 0 : this.TreeInfo.GetOriginalColumn(Options.TabSize, token1) + token1.Span.
Length
;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SyntaxTreeExtensions.cs (1)
121
stack += token.Span.
Length
;