4 overrides of IndexOf
Microsoft.CodeAnalysis (3)
Text\CompositeText.cs (1)
471public override int IndexOf(int position)
Text\SourceText.cs (1)
998public override int IndexOf(int position)
Text\SubText.cs (1)
203public override int IndexOf(int position)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
161public override int IndexOf(int position)
59 references to IndexOf
Microsoft.CodeAnalysis (4)
Text\CompositeText.cs (1)
481var lineNumberWithinSegment = segment.Lines.IndexOf(segmentOffset);
Text\SubText.cs (1)
211var underlyingLineNumber = _subText.UnderlyingText.Lines.IndexOf(underlyingPosition);
Text\TextLine.cs (1)
111return _text?.Lines.IndexOf(_start) ?? 0;
Text\TextLineCollection.cs (1)
40return this[this.IndexOf(position)];
Microsoft.CodeAnalysis.CodeStyle (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (4)
48var startLineNumber = text.Lines.IndexOf(span.Start); 49var endLineNumber = text.Lines.IndexOf(span.End); 89=> text.Lines.IndexOf(pos1) == text.Lines.IndexOf(pos2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
104var startLineNumber = text.Lines.IndexOf(span.Start); 105var endLineNumber = text.Lines.IndexOf(span.End);
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (2)
167var tokenLine = text.Lines.IndexOf(token.SpanStart); 168var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
257if (!locatedAtTheEndOfLine && text.Lines.IndexOf(lastToken.Span.End) != line.LineNumber)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Formatting\Indentation\SmartTokenFormatterFormatTokenTests.cs (2)
565SourceText.From(code).Lines.IndexOf(position), 632SourceText.From(code).Lines.IndexOf(position),
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
137&& text.Lines.IndexOf(syntaxToken.SpanStart) == text.Lines.IndexOf(touchingToken.SpanStart);
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
155var line = _syntaxTree.GetText(cancellationToken).Lines.IndexOf(_position);
LineSeparators\CSharpLineSeparatorService.cs (1)
332var line = syntaxTree.GetText(cancellationToken).Lines.IndexOf(textSpan.End);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
IncrementalParsing\IncrementalParsingTests.cs (1)
623int valueSetterLineIndex = initialLines.IndexOf(valueSetterLinePosition);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (2)
167var tokenLine = text.Lines.IndexOf(token.SpanStart); 168var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart);
Microsoft.CodeAnalysis.EditorFeatures (1)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (1)
181if (text.Lines.IndexOf(token.Span.End) != text.Lines.IndexOf(line.End))
Microsoft.CodeAnalysis.Features (6)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (4)
109var indexOfLine = lines.IndexOf(containingStatement.GetFirstToken().SpanStart); 124indexOfLine = lines.IndexOf(containingStatement.GetLastToken().SpanStart); 274var indexOfLine = lines.IndexOf(span.Start); 281indexOfLine = lines.IndexOf(spanEnd);
Completion\Providers\AbstractOverrideCompletionProvider.BaseItemGetter.cs (1)
57=> Text.Lines.IndexOf(position) == StartLineNumber;
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
70=> text.Lines.IndexOf(position) == startLine;
Microsoft.CodeAnalysis.UnitTests (8)
Text\CompositeTextTests.cs (2)
43Assert.Equal(sourceText.Lines.IndexOf(i), compositeText.Lines.IndexOf(i));
Text\LargeTextTests.cs (3)
174Assert.Equal(lineNumber, text.Lines.IndexOf(p)); 182Assert.Equal(lineNumber - 1, text.Lines.IndexOf(start - 1)); 190Assert.Equal(lineNumber + 1, text.Lines.IndexOf(nextPosition));
Text\StringTextTest.cs (3)
127Assert.Equal(lineNumber, text.Lines.IndexOf(p)); 135Assert.Equal(lineNumber - 1, text.Lines.IndexOf(start - 1)); 143Assert.Equal(lineNumber + 1, text.Lines.IndexOf(nextPosition));
Microsoft.CodeAnalysis.VisualBasic (2)
CommandLine\CommandLineDiagnosticFormatter.vb (1)
63Dim linenumber = text.Lines.IndexOf(sourceSpanStart)
Syntax\VisualBasicLineDirectiveMap.vb (1)
34Dim directiveLineNumber As Integer = sourceText.Lines.IndexOf(directive.SpanStart) + 1
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (2)
203Dim tokenLine = text.Lines.IndexOf(token.SpanStart) 204Dim previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
363syntaxTree.GetText(cancellationToken).Lines.IndexOf(statement.SpanStart) = lineNumber Then
Microsoft.CodeAnalysis.VisualBasic.Features (3)
Debugging\ProximityExpressionsGetter.Worker.vb (1)
86Dim line = _syntaxTree.GetText(cancellationToken).Lines.IndexOf(_position)
Highlighting\KeywordHighlightingHelpers.vb (2)
89Dim previousLine = text.Lines.IndexOf(previousToken.SpanStart) 90Dim awaitLine = text.Lines.IndexOf(.AwaitKeyword.SpanStart)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (2)
203Dim tokenLine = text.Lines.IndexOf(token.SpanStart) 204Dim previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb (1)
363syntaxTree.GetText(cancellationToken).Lines.IndexOf(statement.SpanStart) = lineNumber Then
Microsoft.CodeAnalysis.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SourceTextExtensions_SharedWithCodeStyle.cs (4)
48var startLineNumber = text.Lines.IndexOf(span.Start); 49var endLineNumber = text.Lines.IndexOf(span.End); 89=> text.Lines.IndexOf(pos1) == text.Lines.IndexOf(pos2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
104var startLineNumber = text.Lines.IndexOf(span.Start); 105var endLineNumber = text.Lines.IndexOf(span.End);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
174openBraceLine.LineNumber < text.Lines.IndexOf(tokenAfterOpenBrace.SpanStart))
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
CodeModel\VisualBasicCodeModelService.NodeLocator.vb (4)
728Dim beginLine = text.Lines.IndexOf(propertyStatement.Span.End) 1002Dim beginLine = text.Lines.IndexOf(beginStatement.SpanStart) 1008lineNumber = text.Lines.IndexOf(colonTrivia.Value.SpanStart) 1026Dim beginLine = text.Lines.IndexOf(beginStatement.SpanStart)