2 overrides of IndexOf
Microsoft.CodeAnalysis (1)
Text\SourceText.cs (1)
888public override int IndexOf(int position)
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
162public override int IndexOf(int position)
70 references to IndexOf
Microsoft.CodeAnalysis (2)
Text\TextLine.cs (1)
99return _text?.Lines.IndexOf(_start) ?? 0;
Text\TextLineCollection.cs (1)
40return this[this.IndexOf(position)];
Microsoft.CodeAnalysis.CodeStyle (6)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
103var startLineNumber = text.Lines.IndexOf(span.Start); 104var endLineNumber = text.Lines.IndexOf(span.End);
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);
Microsoft.CodeAnalysis.CSharp (1)
Syntax\CSharpLineDirectiveMap.cs (1)
33var directiveLineNumber = sourceText.Lines.IndexOf(directiveNode.SpanStart) + 1;
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
SyntaxTokenExtensions.cs (2)
120var tokenLine = text.Lines.IndexOf(token.SpanStart); 121var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (1)
266if (!locatedAtTheEndOfLine && text.Lines.IndexOf(lastToken.Span.End) != line.LineNumber)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Formatting\Indentation\SmartTokenFormatterFormatTokenTests.cs (2)
567SourceText.From(code).Lines.IndexOf(position), 634SourceText.From(code).Lines.IndexOf(position),
Microsoft.CodeAnalysis.CSharp.Features (5)
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (2)
138&& text.Lines.IndexOf(syntaxToken.SpanStart) == text.Lines.IndexOf(touchingToken.SpanStart);
Debugging\CSharpProximityExpressionsService.Worker.cs (2)
161var line = _syntaxTree.GetText(cancellationToken).Lines.IndexOf(_position); 166nextStatement != null && _syntaxTree.GetText(cancellationToken).Lines.IndexOf(nextStatement.SpanStart) == line;
LineSeparators\CSharpLineSeparatorService.cs (1)
333var line = syntaxTree.GetText(cancellationToken).Lines.IndexOf(textSpan.End);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs\SyntaxTokenExtensions.cs (2)
120var tokenLine = text.Lines.IndexOf(token.SpanStart); 121var previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart);
Microsoft.CodeAnalysis.EditorFeatures (2)
AutomaticCompletion\AbstractAutomaticLineEnderCommandHandler.cs (2)
180if (text.Lines.IndexOf(token.Span.End) != text.Lines.IndexOf(line.End))
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
NavigateTo\NavigateToItemDisplay.cs (1)
85new[] { new DescriptionRun((sourceText.Lines.IndexOf(span.Start) + 1).ToString()) }))
Microsoft.CodeAnalysis.Features (8)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (4)
109var indexOfLine = lines.IndexOf(containingStatement.GetFirstToken().SpanStart); 124indexOfLine = lines.IndexOf(containingStatement.GetLastToken().SpanStart); 276var indexOfLine = lines.IndexOf(span.Start); 283indexOfLine = lines.IndexOf(spanEnd);
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
74=> text.Lines.IndexOf(position) == startLine;
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (2)
62var startLineNumber = text.Lines.IndexOf(position); 167=> _text.Lines.IndexOf(position) == _startLineNumber;
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
99var line = text.Lines.IndexOf(position);
Microsoft.CodeAnalysis.UnitTests (6)
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)
SyntaxTokenExtensions.vb (2)
203Dim tokenLine = text.Lines.IndexOf(token.SpanStart) 204Dim previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart)
SyntaxTreeExtensions.vb (1)
363syntaxTree.GetText(cancellationToken).Lines.IndexOf(statement.SpanStart) = lineNumber Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
VisualBasicIndentationService.Indenter.vb (1)
116If HasLinesBetween(indenter.Tree.GetText().Lines.IndexOf(token.Span.End), indenter.LineToBeIndented.LineNumber) Then
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (2)
Utilities\CommandHandlers\AbstractImplementAbstractClassOrInterfaceCommandHandler.vb (2)
135If text.Lines.IndexOf(token.SpanStart) <> text.Lines.IndexOf(caretPosition) Then
Microsoft.CodeAnalysis.VisualBasic.Features (8)
CodeFixes\IncorrectExitContinue\IncorrectExitContinueCodeFixProvider.vb (4)
113If tokenAfterContinueToken.IsSkipped() AndAlso text.Lines.IndexOf(tokenAfterContinueToken.SpanStart) = text.Lines.IndexOf(continueStatement.SpanStart) Then 145If tokenAfterExitToken.IsSkipped() AndAlso text.Lines.IndexOf(tokenAfterExitToken.SpanStart) = text.Lines.IndexOf(exitStatement.SpanStart) Then
Debugging\ProximityExpressionsGetter.Worker.vb (2)
86Dim line = _syntaxTree.GetText(cancellationToken).Lines.IndexOf(_position) 89While nextStatement IsNot Nothing AndAlso _syntaxTree.GetText(cancellationToken).Lines.IndexOf(nextStatement.SpanStart) = line
Highlighting\KeywordHighlightingHelpers.vb (2)
89Dim previousLine = text.Lines.IndexOf(previousToken.SpanStart) 90Dim awaitLine = text.Lines.IndexOf(.AwaitKeyword.SpanStart)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb\SyntaxTokenExtensions.vb (2)
203Dim tokenLine = text.Lines.IndexOf(token.SpanStart) 204Dim previousTokenLine = text.Lines.IndexOf(previousToken.SpanStart)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTreeExtensions.vb\SyntaxTreeExtensions.vb (1)
363syntaxTree.GetText(cancellationToken).Lines.IndexOf(statement.SpanStart) = lineNumber Then
VisualBasicIndentationService.Indenter.vb (1)
116If HasLinesBetween(indenter.Tree.GetText().Lines.IndexOf(token.Span.End), indenter.LineToBeIndented.LineNumber) Then
Microsoft.CodeAnalysis.Workspaces (6)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs\SyntaxTreeExtensions.cs (2)
103var startLineNumber = text.Lines.IndexOf(span.Start); 104var endLineNumber = text.Lines.IndexOf(span.End);
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);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.NodeLocator.cs (1)
175openBraceLine.LineNumber < text.Lines.IndexOf(tokenAfterOpenBrace.SpanStart))
Microsoft.VisualStudio.LanguageServices.Implementation (1)
CodeModel\MethodXml\AbstractMethodXmlBuilder.cs (1)
368=> Text.Lines.IndexOf(node.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)