88 references to Span
IdeCoreBenchmarks (1)
IncrementalSourceGeneratorBenchmarks.cs (1)
167var changedText = sourceText.WithChanges(new TextChange(sourceText.Lines[0].Span, $"// added text{i}"));
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
218var lineSpan = currentLine.Span;
Microsoft.CodeAnalysis (1)
Text\TextLine.cs (1)
179return _text.ToString(this.Span);
Microsoft.CodeAnalysis.CodeStyle (14)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
134var textSpanEndPosition = Math.Min(parenthesizedExpressionLocation.SourceSpan.End, expressionFirstLine.Span.End);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\NamingStyles\NamingStyleOptionAccumulator.cs (2)
36RuleName: (section, severity.line?.Span, ruleTitle), // all rules must have a severity so we consider this its location 39Severity: (section, severity.line?.Span, severity.severity)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (2)
69for (var i = line.Span.Start; i < line.Span.End; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_NamingStyle.cs (5)
39OptionName: (section, nameTextLine?.Span, name), 40Prefix: (section, prefixTextLine?.Span, prefix), 41Suffix: (section, suffixTextLine?.Span, suffix), 42WordSeparator: (section, wordSeparatorTextLine?.Span, wordSeparator), 43Capitalization: (section, capitalizationTextLine?.Span, capitalization));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
39OptionName: (section, nameTextLine?.Span, name), 40SymbolKinds: (section, kindsTextLine?.Span, kinds), 41Accessibilities: (section, accessibilitiesTextLine?.Span, accessibilities), 42Modifiers: (section, modifiersTextLine?.Span, modifiers));
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
207var lineSpan = currentLine.Span;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (3)
133if (syntaxTree.IsEntirelyWithinStringLiteral(textLine.Span.Start, out var stringLiteral, cancellationToken)) 182while (commonIndentation < indentation.Length && commonIndentation < textLine.Span.Length) 222if (tree.IsEntirelyWithinStringLiteral(textLine.Span.Start, cancellationToken))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
252return textBeforePaste.ToString(TextSpan.FromBounds(lastLine.Span.Start, quotePosition));
StringCopyPaste\StringCopyPasteHelpers.cs (1)
24=> line.Span.End != line.SpanIncludingLineBreak.End;
Microsoft.CodeAnalysis.CSharp.Features (6)
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
87return line.Span.End;
Snippets\CSharpIntMainSnippetProvider.cs (1)
47return line.Span.End;
Snippets\CSharpSnippetHelpers.cs (1)
26return line.Span.End;
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (3)
133if (syntaxTree.IsEntirelyWithinStringLiteral(textLine.Span.Start, out var stringLiteral, cancellationToken)) 182while (commonIndentation < indentation.Length && commonIndentation < textLine.Span.Length) 222if (tree.IsEntirelyWithinStringLiteral(textLine.Span.Start, cancellationToken))
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
207var lineSpan = currentLine.Span;
Microsoft.CodeAnalysis.EditorFeatures (3)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (3)
185textChange = new TextChange(curLine.Span, $"{untrimmedKey}= {optionValue}{comment}"); 306return (editorConfigText.WithChanges(new TextChange(new TextSpan(lastValidSpecificHeaderSpanEnd.Value.Span.End, 0), newEntry)), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd); 315return (editorConfigText.WithChanges(new TextChange(new TextSpan(lastValidHeaderSpanEnd.Value.Span.End, 0), newEntry)), lastValidHeaderSpanEnd, lastValidSpecificHeaderSpanEnd);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
EditorAdapter\TextSnapshotImplementationTest.cs (2)
43Assert.Equal(new TextSpan(0, 3), line1.Span); 54Assert.Equal(new TextSpan(5, 3), line1.Span);
Microsoft.CodeAnalysis.Features (10)
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
500textChange = new TextChange(curLine.Span, $"{untrimmedKey}={newOptionValue}{newSeverityValue}{commentValue}"); 556textChange = new TextChange(curLine.Span, $"{untrimmedKey}={newSeverityValue}{commentValue}"); 720var textChange = new TextChange(new TextSpan(lastValidSpecificHeaderSpanEnd.Value.Span.End, 0), newEntry); 730var textChange = new TextChange(new TextSpan(lastValidHeaderSpanEnd.Value.Span.End, 0), newEntry);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (1)
435: currentLine.Span;
EditAndContinue\EditSession.cs (4)
219var oldLineSpan = oldText.Lines[i].Span; 220var newLineSpan = newText.Lines[i].Span; 223return newText.Lines[i].Span; 228(newLineCount > oldLineCount) ? newText.Lines[oldLineCount].Span :
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
134var textSpanEndPosition = Math.Min(parenthesizedExpressionLocation.SourceSpan.End, expressionFirstLine.Span.End);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
216var amountToIndent = desiredCaretLinePosition.Character - lineToIndent.Span.Length;
Handler\SemanticTokens\SemanticTokensHelpers.cs (1)
204textSpan = line.Span;
Microsoft.CodeAnalysis.UnitTests (23)
Text\LargeTextTests.cs (2)
162Assert.Equal(start, textLine.Span.Start); 163Assert.Equal(length, textLine.Span.Length);
Text\SourceTextTests.cs (1)
48Assert.Equal(0, text.Lines[0].Span.Length);
Text\StringText_LineTest.cs (3)
22Assert.Equal(span, line.Span); 86Assert.Equal(0, line.Span.Length); 89Assert.Equal(start, line.Span.Start);
Text\StringTextDecodingTests.cs (2)
246Assert.Equal(3, text.Lines[0].Span.Length); 276Assert.Equal(3, text.Lines[0].Span.Length);
Text\StringTextTest.cs (4)
48Assert.Equal(3, data.Lines[0].Span.Length); 63Assert.Equal(0, data.Lines[0].Span.Length); 115Assert.Equal(start, textLine.Span.Start); 116Assert.Equal(length, textLine.Span.Length);
Text\StringTextTests_Default.cs (8)
43Assert.Equal(0, data.Lines[0].Span.Length); 60Assert.Equal(3, data.Lines[0].Span.Length); 61Assert.Equal(3 + newLine.Length, data.Lines[1].Span.Start); 73Assert.Equal("goo", data.ToString(data.Lines[0].Span)); 74Assert.Equal("bar", data.ToString(data.Lines[1].Span)); 75Assert.Equal("baz", data.ToString(data.Lines[2].Span)); 83Assert.Equal("goo", data.ToString(data.Lines[0].Span)); 84Assert.Equal("bar", data.ToString(data.Lines[1].Span));
Text\TextChangeTests.cs (3)
259return x.Span == y.Span; 264return obj.Span.GetHashCode();
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Utilities\NavigationPointHelpers.vb (1)
63Dim totalLineSize = line.GetColumnFromLineOffset(line.Span.Length, indentSize)
Microsoft.CodeAnalysis.Workspaces (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\NamingStyles\NamingStyleOptionAccumulator.cs (2)
36RuleName: (section, severity.line?.Span, ruleTitle), // all rules must have a severity so we consider this its location 39Severity: (section, severity.line?.Span, severity.severity)));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (2)
69for (var i = line.Span.Start; i < line.Span.End; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_NamingStyle.cs (5)
39OptionName: (section, nameTextLine?.Span, name), 40Prefix: (section, prefixTextLine?.Span, prefix), 41Suffix: (section, suffixTextLine?.Span, suffix), 42WordSeparator: (section, wordSeparatorTextLine?.Span, wordSeparator), 43Capitalization: (section, capitalizationTextLine?.Span, capitalization));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (4)
39OptionName: (section, nameTextLine?.Span, name), 40SymbolKinds: (section, kindsTextLine?.Span, kinds), 41Accessibilities: (section, accessibilitiesTextLine?.Span, accessibilities), 42Modifiers: (section, modifiersTextLine?.Span, modifiers));
Microsoft.VisualStudio.LanguageServices (2)
FindReferences\Entries\AbstractDocumentSpanEntry.cs (1)
106return text.GetSubText(line.Span);
Workspace\VisualStudioFormattingRuleFactoryServiceFactory.cs (1)
79if (visibleSpan.IntersectsWith(line.Span))
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Venus\DocumentService_IntegrationTests.vb (2)
328Return New ExcerptResult(mappedSource.GetSubText(line.Span), New TextSpan(mappedSpan.Start - line.Start, mappedSpan.Length), ImmutableArray.Create(New ClassifiedSpan(New TextSpan(0, line.Span.Length), ClassificationTypeNames.Text)), document, span)