9 overrides of
Microsoft.CodeAnalysis (6)
Text\ChangedText.cs (1)
132public override char this[int position]
Text\CompositeText.cs (1)
72public override char this[int position]
Text\LargeText.cs (1)
143public override char this[int position]
Text\StringBuilderText.cs (1)
61public override char this[int position]
Text\StringText.cs (1)
56public override char this[int position]
Text\SubText.cs (1)
55public override char this[int position]
Microsoft.CodeAnalysis.CSharp.Features (1)
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
288public override char this[int position]
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Extensions.SnapshotSourceText.cs (1)
131public override char this[int position]
Microsoft.CodeAnalysis.Test.Utilities (1)
Syntax\SourceUtilities.cs (1)
25public override char this[int position] => _buffer[position % _buffer.Length];
142 references to
CSharpSyntaxGenerator (2)
SourceGenerator.cs (2)
149return _sourceText[_position]; 159return _sourceText[_position++];
Microsoft.AspNetCore.App.Analyzers (2)
Infrastructure\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
22public char Get(SourceText text, int index) => text[index];
Infrastructure\VirtualChars\TextLineExtensions.cs (1)
17if (!char.IsWhiteSpace(text[i]))
Microsoft.CodeAnalysis (14)
Text\ChangedText.cs (1)
134get { return _newText[position]; }
Text\SubText.cs (5)
64return UnderlyingText[UnderlyingSpan.Start + position]; 123Debug.Assert(_subText.UnderlyingText[underlyingSpanStart - 1] == '\r' && _subText.UnderlyingText[underlyingSpanStart] == '\n'); 131Debug.Assert(_subText.UnderlyingText[underlyingSpanEnd - 1] == '\r' && _subText.UnderlyingText[underlyingSpanEnd] == '\n');
Text\TextLine.cs (4)
49if (span.Start > 0 && !TextUtilities.IsAnyLineBreakCharacter(text[span.Start - 1])) 57endIncludesLineBreak = TextUtilities.IsAnyLineBreakCharacter(text[span.End - 1]); 90Debug.Assert(span.Start == 0 || TextUtilities.IsAnyLineBreakCharacter(text[span.Start - 1])); 91Debug.Assert(span.End == text.Length || TextUtilities.IsAnyLineBreakCharacter(text[span.End - 1]));
Text\TextUtilities.cs (4)
16var c = text[index]; 35return (next < text.Length) && '\n' == text[next] ? 2 : 1; 54char c = text[index]; 57if (index > 0 && text[index - 1] == '\r')
Microsoft.CodeAnalysis.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
23public readonly char Get(SourceText text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (3)
19if (!char.IsWhiteSpace(text[i])) 51if (!char.IsWhiteSpace(text[i])) 71if (!char.IsWhiteSpace(text[i]))
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (3)
155switch (text[position]) 198throw ExceptionUtilities.UnexpectedValue(text[position]); 255if (text[currentLineStart + j] != ch)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (2)
115while (start < end && char.IsWhiteSpace(sourceText[end - 1])) 118while (start < end && char.IsWhiteSpace(sourceText[start]))
Microsoft.CodeAnalysis.CSharp (4)
Parser\Lexer.cs (4)
2087if (position == 0 || SyntaxFacts.IsNewLine(text[position - 1])) 2089var firstCh = text[position]; 2096if (text[position + i] != firstCh) 2108text[position + s_conflictMarkerLength] == ' ';
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
137if (!SyntaxFacts.IsWhitespace(text[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (2)
352if (sourceText[i] != '"') 360if (sourceText[i] != '"')
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
84while (end < text.Length && text[end] == ' ') 87if (end < text.Length && SyntaxFacts.IsNewLine(text[end])) 89while (start > 0 && text[start - 1] == ' ')
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
86while (end < text.Length && text[end] == ' ') 89if (end < text.Length && SyntaxFacts.IsNewLine(text[end])) 91while (start > 0 && text[start - 1] == ' ')
Microsoft.CodeAnalysis.CSharp.EditorFeatures (14)
StringCopyPaste\StringCopyPasteHelpers.cs (8)
30=> index >= 0 && index < text.Length ? text[index] : '\0'; 108if (!SyntaxFacts.IsWhitespace(text[i])) 202if (text[currentIndex] == character) 205while (endQuoteIndex < contentEnd && text[endQuoteIndex] == character) 532if (commonIndentPrefix[commonPrefixLength] != text[lineWhitespaceSpan.Start + commonPrefixLength]) 551if (spans.First().Length > 0 && text[spans.First().Start] == '"') 554if (spans.Last().Length > 0 && text[spans.Last().End - 1] == '"') 562if (SyntaxFacts.IsNewLine(text[i]))
StringCopyPaste\StringInfo.cs (6)
93while (end > start && text[end - 1] == '"') 123Contract.ThrowIfFalse(SyntaxFacts.IsNewLine(text[rawStart])); 138Contract.ThrowIfFalse(SyntaxFacts.IsNewLine(text[rawEnd - 1])); 169if (end > start && text[end - 1] == '"') 193while (start < interpolatedString.StringStartToken.Span.End && text[start] == '"') 199while (end > interpolatedString.StringEndToken.Span.Start && text[end - 1] == '"')
Microsoft.CodeAnalysis.CSharp.Features (38)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (3)
77if (!char.IsWhiteSpace(text[i])) 240while (startPoint >= 0 && char.IsWhiteSpace(document.Text[startPoint])) 247while (startPoint >= 0 && !char.IsWhiteSpace(document.Text[startPoint]))
BraceCompletion\InterpolatedStringBraceCompletionService.cs (4)
58if (text[start] == '@') 61if (start == 0 || text[start - 1] != '$') 66else if (text[start] == '$') 69if (start > 0 && text[start - 1] == '@')
BraceCompletion\StringLiteralBraceCompletionService.cs (1)
42if (start > 0 && text[start - 1] == '@')
Completion\CompletionProviders\CompletionUtilities.cs (10)
62var ch = text[characterPosition]; 65if (ch == '.' && !(characterPosition >= 1 && text[characterPosition - 1] == '.')) 77if (ch == '>' && characterPosition >= 1 && text[characterPosition - 1] == '-') 83if (ch == ':' && characterPosition >= 1 && text[characterPosition - 1] == ':') 101while (text[characterPosition] == ' ' || 102char.IsLetter(text[characterPosition])) 110return text[characterPosition] == '#'; 121=> IsArgumentListCharacter(text[characterPosition]); 129var ch = text[characterPosition]; 137=> ch == ' ' && (characterPosition == text.Length - 1 || !IsWordStartCharacter(text[characterPosition + 1]));
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
55text[characterPosition] is ' ' or '[' or '(' or '~' ||
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
35=> text[characterPosition] == '.';
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
103=> CompletionUtilities.IsTriggerCharacter(text, characterPosition, options) || text[characterPosition] == ' ';
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (1)
66=> text[insertedCharacterPosition] == '.';
Completion\CompletionProviders\PartialMethodCompletionProvider.cs (1)
77=> text[characterPosition] == ' ' ||
Completion\CompletionProviders\PartialTypeCompletionProvider.cs (1)
52=> text[characterPosition] == ' ' ||
Completion\CompletionProviders\PropertySubPatternCompletionProvider.cs (1)
166=> CompletionUtilities.IsTriggerCharacter(text, characterPosition, options) || text[characterPosition] == ' ';
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
63=> text[characterPosition] is ('<' or '"') ||
EmbeddedLanguages\CSharpTestEmbeddedLanguageClassifier.cs (1)
77for (var i = lastLine.Start; i < lastLine.End && SyntaxFacts.IsWhitespace(text[i]); i++)
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
137if (!SyntaxFacts.IsWhitespace(text[i]))
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
184if (indentation[commonIndentation] != text[textLine.Start + commonIndentation])
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
84while (end < text.Length && text[end] == ' ') 87if (end < text.Length && SyntaxFacts.IsNewLine(text[end])) 89while (start > 0 && text[start - 1] == ' ')
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
86while (end < text.Length && text[end] == ' ') 89if (end < text.Length && SyntaxFacts.IsNewLine(text[end])) 91while (start > 0 && text[start - 1] == ' ')
Structure\Providers\DisabledTextTriviaStructureProvider.cs (3)
72return endPos >= 2 && text[endPos - 1] == '\n' && text[endPos - 2] == '\r' ? endPos - 2 : 73endPos >= 1 && SyntaxFacts.IsNewLine(text[endPos - 1]) ? endPos - 1 : endPos;
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (2)
352if (sourceText[i] != '"') 360if (sourceText[i] != '"')
Microsoft.CodeAnalysis.EditorFeatures (6)
IntelliSense\AsyncCompletion\CompletionSource.cs (4)
186text[caretPoint - 2] != '?' || 602while (current < questionPosition && char.IsWhiteSpace(text[current])) 607if (current < questionPosition && syntaxFacts.IsIdentifierStartCharacter(text[current])) 616while (current < questionPosition && syntaxFacts.IsIdentifierPartCharacter(text[current]))
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (2)
181while (leftSidePosition > 0 && IsTrackableCharacter(syntaxFactsService, beforeText[leftSidePosition - 1])) 186while (rightSidePosition < beforeText.Length && IsTrackableCharacter(syntaxFactsService, beforeText[rightSidePosition]))
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Completion\AbstractCompletionProviderTests.cs (1)
1275var trigger = RoslynCompletion.CompletionTrigger.CreateInsertionTrigger(text[position]);
Microsoft.CodeAnalysis.Features (26)
BraceCompletion\AbstractBraceCompletionService.cs (1)
203if (text[index] == openingBrace)
Completion\CommonCompletionUtilities.cs (6)
37while (start > 0 && isWordStartCharacter(text[start - 1])) 51while (end < text.Length && isWordCharacter(text[end])) 62var ch = text[characterPosition]; 71isWordCharacter(text[characterPosition - 1])) 77isWordCharacter(text[characterPosition + 1])) 221if (text[characterPosition] != value[i])
Completion\CompletionService_GetCompletions.cs (1)
202var character = text[caretPosition - 1];
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
31var ch = text[insertedCharacterPosition]; 40ch = text[insertedCharacterPosition - 1];
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
54!char.IsLetter(text[caretPosition - 2]);
EmbeddedLanguages\DateAndTime\EmbeddedCompletionContext.cs (1)
45while (char.IsLetter(text[startPosition - 1]))
ExternalAccess\Pythia\Api\PythiaCompletionProviderBase.cs (1)
76=> text[insertedCharacterPosition] == '.';
Navigation\IDefinitionLocationService.cs (2)
72if (char.IsLetterOrDigit(text[position])) 85=> position >= 0 && position < text.Length ? text[position] : (char)0;
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (3)
187var currentChar = sourceText[endExclusive]; 197endExclusive + 1 < sourceText.Length && char.IsLetterOrDigit(sourceText[endExclusive + 1])) 210var previousCharacter = sourceText[startInclusive - 1];
Snippets\SnippetUtilities.cs (1)
20var c = currentText[startPosition - 1];
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (3)
155switch (text[position]) 198throw ExceptionUtilities.UnexpectedValue(text[position]); 255if (text[currentLineStart + j] != ch)
src\Compilers\Core\Portable\Text\TextUtilities.cs (4)
16var c = text[index]; 35return (next < text.Length) && '\n' == text[next] ? 2 : 1; 54char c = text[index]; 57if (index > 0 && text[index - 1] == '\r')
Microsoft.CodeAnalysis.UnitTests (2)
Text\LargeTextTests.cs (2)
66Assert.Throws<IndexOutOfRangeException>(() => text[HelloWorld.Length]); 69Assert.Equal(HelloWorld[i], text[i]);
Microsoft.CodeAnalysis.Workspaces (10)
Shared\Extensions\SourceTextExtensions.cs (4)
93if (!Match(normalized[j], text[i + j], caseSensitive)) 126if (!Match(normalized[j], text[i + j], caseSensitive)) 154if (text[position + i] != value[i]) 167if (!char.IsWhiteSpace(text[start + i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
23public readonly char Get(SourceText text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\TextLineExtensions.cs (3)
19if (!char.IsWhiteSpace(text[i])) 51if (!char.IsWhiteSpace(text[i])) 71if (!char.IsWhiteSpace(text[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\CodeRefactoringHelpers.cs (2)
115while (start < end && char.IsWhiteSpace(sourceText[end - 1])) 118while (start < end && char.IsWhiteSpace(sourceText[start]))
Microsoft.VisualStudio.LanguageServices (3)
Venus\ContainedDocument.cs (3)
916if (!char.IsWhiteSpace(text[start])) 927if (!char.IsWhiteSpace(text[end])) 971if (end >= 0 && text[end] == '}')