326 references to GetFirstToken
Microsoft.AspNetCore.App.CodeFixes (1)
RouteParameterUnusedParameterFixer.cs (1)
62
var token = param.
GetFirstToken
();
Microsoft.CodeAnalysis (3)
Syntax\SyntaxNode.cs (1)
1066
return
GetFirstToken
(includeZeroWidth: true).LeadingTrivia;
Syntax\SyntaxNodeExtensions.cs (2)
351
var first = node.
GetFirstToken
(includeZeroWidth: true);
363
var first = node.
GetFirstToken
(includeZeroWidth: true);
Microsoft.CodeAnalysis.CodeStyle (25)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
35
var firstToken = root.
GetFirstToken
(includeZeroWidth: true);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
147
node.
GetFirstToken
().GetLocation(),
152
node.
GetFirstToken
().ToString(),
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
89
if (nextToken != nextTokenContainingStatement.
GetFirstToken
())
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
39
=> switchBlock.
GetFirstToken
().GetLocation();
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
158
if (lastToken.GetNextToken(includeDirectives: true) == node.
GetFirstToken
())
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
110
parenthesizedExpression.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
698
var firstToken = memberDeclaration.
GetFirstToken
();
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
99
.Subtract(GetSpanWithinLiteralQuotes(virtualCharService, literal.Syntax.
GetFirstToken
())));
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
191
objectCreationExpression.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
57
ifStatement.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
96
ifStatement.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
129
objectCreationExpression.
GetFirstToken
().GetLocation(),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
124
var firstToken = root.
GetFirstToken
(includeZeroWidth: true, includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
112
startToken: _rootNode.
GetFirstToken
(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
44
_firstToken = Root.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
18
Contract.ThrowIfFalse(root.
GetFirstToken
(includeZeroWidth: true).RawKind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (2)
283
? (childNode.
GetFirstToken
(includeZeroWidth: true), childNode.GetLastToken(includeZeroWidth: true))
366
if (conditionStatement.
GetFirstToken
() == indentationAnchor)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
487
var firstToken = trivia2.GetStructure()!.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (1)
169
return GetFileBanner(root.
GetFirstToken
(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
168
if (token == member.
GetFirstToken
() &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
357
var previousToken = node.
GetFirstToken
().GetPreviousToken();
360
syntaxFacts.IsWordOrNumber(resultNode.
GetFirstToken
()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
120
startToken = (startToken.RawKind != 0) ? startToken : root.
GetFirstToken
(includeZeroWidth: true);
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
142
if (!sourceText.AreOnSameLine(condition.
GetFirstToken
(), condition.GetLastToken()) ||
143
!sourceText.AreOnSameLine(trueSyntax.
GetFirstToken
(), trueSyntax.GetLastToken()) ||
144
!sourceText.AreOnSameLine(falseSyntax.
GetFirstToken
(), falseSyntax.GetLastToken()))
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
84
var firstToken = objectCreation.
GetFirstToken
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
48
var start = node.
GetFirstToken
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (3)
55
var previousToken = firstParameter.
GetFirstToken
().GetPreviousToken();
57
if (sourceText.AreOnSameLine(previousToken, firstParameter.
GetFirstToken
()))
165
if (text.AreOnSameLine(lastParameter.GetLastToken(), thisParameter.
GetFirstToken
()))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
35
var firstToken = root.
GetFirstToken
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
171
var previousToken = FirstStatementAffectedInInnermostBlock.
GetFirstToken
().GetPreviousToken();
Microsoft.CodeAnalysis.CSharp (10)
Binder\Binder_Expressions.cs (1)
4534
MessageID.IDS_FeatureNestedStackalloc.CheckFeatureAvailability(diagnostics, node.
GetFirstToken
());
Binder\Binder_Invocation.cs (1)
1357
_ => syntax.
GetFirstToken
()
BoundTree\BoundTreeVisitors.cs (1)
192
return syntax.
GetFirstToken
().GetLocation();
Compilation\CSharpSemanticModel.cs (1)
1318
SyntaxToken firstToken = node.
GetFirstToken
(includeZeroWidth: false);
FlowAnalysis\ControlFlowPass.cs (4)
219
var loc = new SourceLocation(leave.Syntax.
GetFirstToken
());
227
var loc = new SourceLocation(leave.Syntax.
GetFirstToken
());
268
var firstToken = statement.Syntax.
GetFirstToken
();
303
var location = new SourceLocation(branch.Branch.Syntax.
GetFirstToken
());
Syntax\CSharpSyntaxNode.cs (1)
323
return base.
GetFirstToken
(includeZeroWidth, includeSkipped, includeDirectives, includeDocumentationComments);
Syntax\LookupPosition.cs (1)
502
firstIncluded = lambdaExpressionOrQueryNode.
GetFirstToken
().GetNextToken();
Microsoft.CodeAnalysis.CSharp.CodeStyle (48)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (5)
109
var firstToken = statement.
GetFirstToken
();
162
if (FormattingRangeHelper.AreTwoTokensOnSameLine(statement.
GetFirstToken
(), statement.GetLastToken()))
173
var lastTokenBeforeEmbeddedStatement = embeddedStatement.
GetFirstToken
().GetPreviousToken();
174
if (!FormattingRangeHelper.AreTwoTokensOnSameLine(statement.
GetFirstToken
(), lastTokenBeforeEmbeddedStatement))
186
if (!FormattingRangeHelper.AreTwoTokensOnSameLine(embeddedStatement.
GetFirstToken
(), embeddedStatement.GetLastToken()))
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
71
location: switchStatement.
GetFirstToken
().GetLocation(),
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
133
var location = syntaxNode.
GetFirstToken
().GetLocation();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
61
=> node.
GetFirstToken
().GetAllPrecedingTriviaToPreviousToken(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
24
var formatter = new CSharpStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.
GetFirstToken
(includeZeroWidth: true), root.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
112
return token.Parent.Parent.
GetFirstToken
() != token;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\AnchorIndentationFormattingRule.cs (2)
43
block.Parent.
GetFirstToken
(includeZeroWidth: true),
90
=> AddAnchorIndentationOperation(list, node.
GetFirstToken
(includeZeroWidth: true), node.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (2)
170
var firstTokenOfNode = node.
GetFirstToken
(includeZeroWidth: true);
182
firstTokenOfNode = node.Parent.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (6)
69
var baseToken = declaringNode.
GetFirstToken
();
70
AddIndentBlockOperation(list, baseToken, node.
GetFirstToken
(), node.GetLastToken());
190
var baseTokenForAlignment = recursivePatternParent.
GetFirstToken
();
209
var baseToken = baseNode.
GetFirstToken
(includeZeroWidth: true);
210
var firstToken = body.
GetFirstToken
(includeZeroWidth: true);
280
var firstToken = node.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
585
var firstToken = node.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (5)
83
AddSuppressWrappingIfOnSingleLineOperation(list, node.
GetFirstToken
(), node.GetLastToken());
91
AddSuppressWrappingIfOnSingleLineOperation(list, node.
GetFirstToken
(), node.GetLastToken());
215
node.
GetFirstToken
(includeZeroWidth: true),
402
AddSuppressWrappingIfOnSingleLineOperation(list, parent.
GetFirstToken
(includeZeroWidth: true), parent.GetLastToken(includeZeroWidth: true));
407
var firstToken = item.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (2)
145
var firstTokenOfNode = node.
GetFirstToken
(includeZeroWidth: true);
150
firstTokenOfNode = node.Parent!.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (20)
107
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
131
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
(), canTokenBeFirstInABlock: true), parent.GetLastToken());
145
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
(), canTokenBeFirstInABlock: true), parent.GetLastToken());
153
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
158
return ValueTuple.Create(GetAppropriatePreviousToken(container.
GetFirstToken
()), container.GetLastToken());
161
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
(), canTokenBeFirstInABlock: true), parent.GetLastToken());
180
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
190
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
193
return ValueTuple.Create(containerOfList.
GetFirstToken
(), containerOfList.GetLastToken());
198
return ValueTuple.Create(parent.
GetFirstToken
(), parent.GetLastToken());
206
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
215
var firstTokenOfInnerBlock = parent.
GetFirstToken
();
226
return ValueTuple.Create(parentOfParent.
GetFirstToken
(), parentOfParent.GetLastToken());
234
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
241
return ValueTuple.Create(GetAppropriatePreviousToken(containerOfBlock.
GetFirstToken
()), containerOfBlock.GetLastToken());
250
var firstTokenOfInnerBlock = parent.
GetFirstToken
();
261
return ValueTuple.Create(GetPreviousTokenIfNotFirstTokenInTree(parent.
GetFirstToken
()), parent.GetLastToken());
277
return (GetPreviousTokenIfNotFirstTokenInTree(parent.
GetFirstToken
()), parent.GetLastToken());
280
return (GetPreviousTokenIfNotFirstTokenInTree(parent.
GetFirstToken
()), parent.GetLastToken());
339
return GetAppropriatePreviousToken(labelNode.
GetFirstToken
());
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
588
var firstToken = node.
GetFirstToken
();
763
if (!document.Text.AreOnSameLine(component.
GetFirstToken
(), component.GetLastToken()))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
98
=> sourceText.AreOnSameLine(node.
GetFirstToken
(), node.GetLastToken());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (2)
199
var baseToken = node.Parent.
GetFirstToken
(includeZeroWidth: true);
203
node.
GetFirstToken
(includeZeroWidth: true).GetNextToken(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (7)
233
return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(embeddedStatementOwner.
GetFirstToken
(includeZeroWidth: true).SpanStart));
275
return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.
GetFirstToken
(includeZeroWidth: true).SpanStart), indenter.Options.FormattingOptions.IndentationSize);
289
return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.
GetFirstToken
(includeZeroWidth: true).SpanStart));
309
return GetDefaultIndentationFromToken(indenter, token.Parent.
GetFirstToken
(includeZeroWidth: true));
349
var firstToken = node.
GetFirstToken
(includeZeroWidth: true);
384
var firstToken = queryExpressionClause.
GetFirstToken
(includeZeroWidth: true);
428
return indenter.GetIndentationOfToken(queryBody.Parent.
GetFirstToken
(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (2)
59
var firstRewrittenToken = rewrittenNode.
GetFirstToken
(true, false, true, true);
60
var firstOriginalToken = originalNode.
GetFirstToken
(true, false, true, true);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
236
=> context.ReportDiagnostic(Diagnostic.Create(s_syntaxDiagnosticDescriptor, context.Tree.GetRoot().
GetFirstToken
().GetLocation()));
Microsoft.CodeAnalysis.CSharp.Features (27)
ChangeSignature\ChangeSignatureFormattingRule.cs (2)
42
var baseToken = node.Parent.
GetFirstToken
();
43
var startToken = node.
GetFirstToken
();
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (3)
119
var firstNonDirectiveToken = root.
GetFirstToken
();
219
var firstToken = root.
GetFirstToken
(includeDirectives: true);
247
var firstSemanticToken = root.
GetFirstToken
();
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
129
var fileBanner = root.
GetFirstToken
() == namespaceDeclaration.GetFirstToken()
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
274
var firstToken = node.
GetFirstToken
();
EditAndContinue\BreakpointSpans.cs (1)
113
=> CreateSpan(node.
GetFirstToken
(), node.GetLastToken());
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (1)
75
TriviaLocation.BeforeBeginningOfSpan => callsite.
GetFirstToken
(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true),
ExtractMethod\CSharpSelectionResult.cs (1)
96
return firstToken.SpanStart <= current.
GetFirstToken
().SpanStart &&
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (2)
38
? foundContinuedLoop.
GetFirstToken
().Span.Start
66
return foundReturnableConstruct.
GetFirstToken
().Span.Start;
QuickInfo\CSharpSyntacticQuickInfoProvider.cs (1)
85
else if (parent.
GetFirstToken
() == openBrace)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (5)
109
var firstToken = statement.
GetFirstToken
();
162
if (FormattingRangeHelper.AreTwoTokensOnSameLine(statement.
GetFirstToken
(), statement.GetLastToken()))
173
var lastTokenBeforeEmbeddedStatement = embeddedStatement.
GetFirstToken
().GetPreviousToken();
174
if (!FormattingRangeHelper.AreTwoTokensOnSameLine(statement.
GetFirstToken
(), lastTokenBeforeEmbeddedStatement))
186
if (!FormattingRangeHelper.AreTwoTokensOnSameLine(embeddedStatement.
GetFirstToken
(), embeddedStatement.GetLastToken()))
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
71
location: switchStatement.
GetFirstToken
().GetLocation(),
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
133
var location = syntaxNode.
GetFirstToken
().GetLocation();
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
588
var firstToken = node.
GetFirstToken
();
763
if (!document.Text.AreOnSameLine(component.
GetFirstToken
(), component.GetLastToken()))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
98
=> sourceText.AreOnSameLine(node.
GetFirstToken
(), node.GetLastToken());
Structure\CSharpStructureHelpers.cs (2)
235
var startToken = node.
GetFirstToken
();
450
var spanStart = syntaxList.First().
GetFirstToken
().FullSpan.End;
Wrapping\SeparatedSyntaxList\CSharpArgumentWrapper.cs (1)
82
startToken = declaration.
GetFirstToken
();
Wrapping\SeparatedSyntaxList\CSharpParameterWrapper.cs (1)
65
: declaration.
GetFirstToken
();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Parsing\SyntaxExtensions.cs (1)
19
return node.
GetFirstToken
(includeSkipped: true).LeadingTrivia;
Syntax\SyntaxNodeTests.cs (2)
1085
SyntaxToken token = syntaxTree.GetRoot().
GetFirstToken
();
1235
SyntaxToken token = syntaxTree.GetRoot().
GetFirstToken
(includeZeroWidth: true);
Microsoft.CodeAnalysis.CSharp.Workspaces (57)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3039
var firstToken = node.
GetFirstToken
();
Formatting\TypingFormattingRule.cs (1)
34
var firstTokenOfNode = node.
GetFirstToken
(includeZeroWidth: true);
Simplification\CSharpSimplificationService.cs (2)
140
var firstRewrittenToken = rewrittenNode.
GetFirstToken
(true, false, true, true);
141
var firstOriginalToken = originalNode.
GetFirstToken
(true, false, true, true);
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
160
if (!FormattingRangeHelper.AreTwoTokensOnSameLine(node.Parent.
GetFirstToken
(), node.GetFirstToken().GetPreviousToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
61
=> node.
GetFirstToken
().GetAllPrecedingTriviaToPreviousToken(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\CSharpStructuredTriviaFormatEngine.cs (1)
24
var formatter = new CSharpStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.
GetFirstToken
(includeZeroWidth: true), root.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
112
return token.Parent.Parent.
GetFirstToken
() != token;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\AnchorIndentationFormattingRule.cs (2)
43
block.Parent.
GetFirstToken
(includeZeroWidth: true),
90
=> AddAnchorIndentationOperation(list, node.
GetFirstToken
(includeZeroWidth: true), node.GetLastToken(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (2)
170
var firstTokenOfNode = node.
GetFirstToken
(includeZeroWidth: true);
182
firstTokenOfNode = node.Parent.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (6)
69
var baseToken = declaringNode.
GetFirstToken
();
70
AddIndentBlockOperation(list, baseToken, node.
GetFirstToken
(), node.GetLastToken());
190
var baseTokenForAlignment = recursivePatternParent.
GetFirstToken
();
209
var baseToken = baseNode.
GetFirstToken
(includeZeroWidth: true);
210
var firstToken = body.
GetFirstToken
(includeZeroWidth: true);
280
var firstToken = node.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
585
var firstToken = node.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (5)
83
AddSuppressWrappingIfOnSingleLineOperation(list, node.
GetFirstToken
(), node.GetLastToken());
91
AddSuppressWrappingIfOnSingleLineOperation(list, node.
GetFirstToken
(), node.GetLastToken());
215
node.
GetFirstToken
(includeZeroWidth: true),
402
AddSuppressWrappingIfOnSingleLineOperation(list, parent.
GetFirstToken
(includeZeroWidth: true), parent.GetLastToken(includeZeroWidth: true));
407
var firstToken = item.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (2)
145
var firstTokenOfNode = node.
GetFirstToken
(includeZeroWidth: true);
150
firstTokenOfNode = node.Parent!.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (20)
107
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
131
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
(), canTokenBeFirstInABlock: true), parent.GetLastToken());
145
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
(), canTokenBeFirstInABlock: true), parent.GetLastToken());
153
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
158
return ValueTuple.Create(GetAppropriatePreviousToken(container.
GetFirstToken
()), container.GetLastToken());
161
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
(), canTokenBeFirstInABlock: true), parent.GetLastToken());
180
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
190
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
193
return ValueTuple.Create(containerOfList.
GetFirstToken
(), containerOfList.GetLastToken());
198
return ValueTuple.Create(parent.
GetFirstToken
(), parent.GetLastToken());
206
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
215
var firstTokenOfInnerBlock = parent.
GetFirstToken
();
226
return ValueTuple.Create(parentOfParent.
GetFirstToken
(), parentOfParent.GetLastToken());
234
return ValueTuple.Create(GetAppropriatePreviousToken(parent.
GetFirstToken
()), parent.GetLastToken());
241
return ValueTuple.Create(GetAppropriatePreviousToken(containerOfBlock.
GetFirstToken
()), containerOfBlock.GetLastToken());
250
var firstTokenOfInnerBlock = parent.
GetFirstToken
();
261
return ValueTuple.Create(GetPreviousTokenIfNotFirstTokenInTree(parent.
GetFirstToken
()), parent.GetLastToken());
277
return (GetPreviousTokenIfNotFirstTokenInTree(parent.
GetFirstToken
()), parent.GetLastToken());
280
return (GetPreviousTokenIfNotFirstTokenInTree(parent.
GetFirstToken
()), parent.GetLastToken());
339
return GetAppropriatePreviousToken(labelNode.
GetFirstToken
());
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (2)
199
var baseToken = node.Parent.
GetFirstToken
(includeZeroWidth: true);
203
node.
GetFirstToken
(includeZeroWidth: true).GetNextToken(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.Indenter.cs (7)
233
return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(embeddedStatementOwner.
GetFirstToken
(includeZeroWidth: true).SpanStart));
275
return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.
GetFirstToken
(includeZeroWidth: true).SpanStart), indenter.Options.FormattingOptions.IndentationSize);
289
return indenter.GetIndentationOfLine(sourceText.Lines.GetLineFromPosition(nonTerminalNode.
GetFirstToken
(includeZeroWidth: true).SpanStart));
309
return GetDefaultIndentationFromToken(indenter, token.Parent.
GetFirstToken
(includeZeroWidth: true));
349
var firstToken = node.
GetFirstToken
(includeZeroWidth: true);
384
var firstToken = queryExpressionClause.
GetFirstToken
(includeZeroWidth: true);
428
return indenter.GetIndentationOfToken(queryBody.Parent.
GetFirstToken
(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (2)
59
var firstRewrittenToken = rewrittenNode.
GetFirstToken
(true, false, true, true);
60
var firstOriginalToken = originalNode.
GetFirstToken
(true, false, true, true);
Microsoft.CodeAnalysis.Features (57)
AddImport\References\Reference.cs (1)
87
var newIdentifier = generator.IdentifierName(SearchResult.DesiredName).
GetFirstToken
().WithTriviaFrom(identifier);
AddImport\SymbolReferenceFinder.cs (1)
322
var name = nameNode.
GetFirstToken
().ValueText;
AddImport\SymbolResult.cs (2)
38
NameNode.
GetFirstToken
().ValueText != DesiredName;
45
NameNode.
GetFirstToken
().ValueText, DesiredName);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (2)
107
if (containingStatement is not null && containingStatement.
GetFirstToken
() != token)
109
var indexOfLine = lines.IndexOf(containingStatement.
GetFirstToken
().SpanStart);
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (5)
154
var text = piece.
GetFirstToken
().Text;
155
var value = piece.
GetFirstToken
().Value?.ToString() ?? piece.
GetFirstToken
().ValueText;
258
var existingText = interpolatedStringTextNode.
GetFirstToken
().Text;
259
var existingValue = interpolatedStringTextNode.
GetFirstToken
().ValueText;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
312
int.TryParse(literalExpression.
GetFirstToken
().ValueText, out var index) &&
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (2)
93
var text = literalExpression.
GetFirstToken
().Text;
94
var valueText = literalExpression.
GetFirstToken
().ValueText;
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (2)
212
var startPosition = member.
GetFirstToken
().SpanStart;
335
var token = targetMember.
GetFirstToken
();
ExtractMethod\SelectionResult.cs (1)
173
if (IsConfigureAwaitFalse(node) && !UnderAnonymousOrLocalMethod(node.
GetFirstToken
(), firstToken, lastToken))
GenerateEqualsAndGetHashCodeFromMembers\FormatLargeBinaryExpressionRule.cs (2)
52
expr.
GetFirstToken
(),
53
expr.
GetFirstToken
().GetNextToken(),
GenerateType\AbstractGenerateTypeService.State.cs (1)
94
NameIsVerbatim = syntaxFacts.IsVerbatimIdentifier(SimpleName.
GetFirstToken
());
ReplacePropertyWithMethods\AbstractReplacePropertyWithMethodsService.cs (2)
432
name.
GetFirstToken
(),
433
AddConflictAnnotation(name.
GetFirstToken
(), conflictMessage));
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (4)
102
CanInsertStatementBeforeToken(parentNode.
GetFirstToken
()))
107
if (sourceText.AreOnSameLine(dotToken, name.
GetFirstToken
()))
135
if (syntaxFacts.IsQualifiedName(parentNode) && CanInsertStatementBeforeToken(parentNode.
GetFirstToken
()))
140
if (sourceText.AreOnSameLine(dotToken, right.
GetFirstToken
()))
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
75
var token = name.
GetFirstToken
();
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
35
var firstToken = root.
GetFirstToken
(includeZeroWidth: true);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (2)
147
node.
GetFirstToken
().GetLocation(),
152
node.
GetFirstToken
().ToString(),
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
89
if (nextToken != nextTokenContainingStatement.
GetFirstToken
())
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
39
=> switchBlock.
GetFirstToken
().GetLocation();
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
158
if (lastToken.GetNextToken(includeDirectives: true) == node.
GetFirstToken
())
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
110
parenthesizedExpression.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
698
var firstToken = memberDeclaration.
GetFirstToken
();
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
99
.Subtract(GetSpanWithinLiteralQuotes(virtualCharService, literal.Syntax.
GetFirstToken
())));
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
191
objectCreationExpression.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (1)
57
ifStatement.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer_IfStatement.cs (1)
96
ifStatement.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (1)
129
objectCreationExpression.
GetFirstToken
().GetLocation(),
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
142
if (!sourceText.AreOnSameLine(condition.
GetFirstToken
(), condition.GetLastToken()) ||
143
!sourceText.AreOnSameLine(trueSyntax.
GetFirstToken
(), trueSyntax.GetLastToken()) ||
144
!sourceText.AreOnSameLine(falseSyntax.
GetFirstToken
(), falseSyntax.GetLastToken()))
src\Analyzers\Core\CodeFixes\UseObjectInitializer\AbstractUseObjectInitializerCodeFixProvider.cs (1)
84
var firstToken = objectCreation.
GetFirstToken
();
Wrapping\AbstractWrapper.cs (1)
52
var firstToken = item.IsToken ? item.AsToken() : item.AsNode()!.
GetFirstToken
();
Wrapping\Edit.cs (1)
69
var rightFirstToken = right.IsToken ? right.AsToken() : right.AsNode()!.
GetFirstToken
();
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (11)
100
? Edit.UpdateBetween(_listSyntax.
GetFirstToken
(), NewLineTrivia, await _singleIndentationTrivia.GetValueAsync(cancellationToken).ConfigureAwait(false), _listItems[0])
101
: Edit.DeleteBetween(_listSyntax.
GetFirstToken
(), _listItems[0]));
106
var openToken = _listSyntax.
GetFirstToken
();
118
var openToken = _listSyntax.
GetFirstToken
();
132
var previousToken = _listSyntax.
GetFirstToken
().GetPreviousToken();
208
result.Add(Edit.DeleteBetween(_listSyntax.
GetFirstToken
().GetPreviousToken(), _listSyntax.
GetFirstToken
()));
297
_listSyntax.
GetFirstToken
().GetPreviousToken(), NewLineTrivia,
299
_listSyntax.
GetFirstToken
()));
432
_listSyntax.
GetFirstToken
().GetPreviousToken(), NewLineTrivia,
434
_listSyntax.
GetFirstToken
()));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (2)
Diagnostics\NonLocalDiagnosticTests.cs (2)
94
var diagnostic = Diagnostic.Create(NonLocalDescriptor, root.
GetFirstToken
().GetLocation());
105
var diagnostic = Diagnostic.Create(CompilationEndDescriptor, root.
GetFirstToken
().GetLocation());
Microsoft.CodeAnalysis.VisualBasic (3)
Binding\Binder_Expressions.vb (1)
4037
Return argumentExpression.
GetFirstToken
() ' since we use this for error reporting, this gives us something close, anyway.
BoundTree\BoundTreeVisitor.vb (1)
168
Return syntax.
GetFirstToken
().GetLocation()
Syntax\VisualBasicSyntaxNode.vb (1)
320
Return CType(MyBase.
GetFirstToken
(includeZeroWidth, includeSkipped, includeDirectives, includeDocumentationComments), SyntaxToken)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (5)
src\Workspaces\VisualBasic\Portable\Formatting\Engine\VisualBasicStructuredTriviaFormatEngine.vb (1)
21
Dim formatter = New VisualBasicStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.
GetFirstToken
(includeZeroWidth:=True), root.GetLastToken(includeZeroWidth:=True))
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (4)
21
Dim baseToken = node.
GetFirstToken
(includeZeroWidth:=True)
145
AddIndentBlockOperation(operations, outerBlockWithBaseToken.
GetFirstToken
(), pair.Item1, pair.Item2)
201
Dim outerBlockGetFirstToken = outerBlock.
GetFirstToken
()
209
outerBlockGetFirstToken = outerBlock.
GetFirstToken
()
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
62
Dim baseToken = node.
GetFirstToken
(includeZeroWidth:=True)
97
Dim openBrace = parameterOrArgumentList.
GetFirstToken
(includeZeroWidth:=True)
Microsoft.CodeAnalysis.VisualBasic.Features (12)
ChangeSignature\ChangeSignatureFormattingRule.vb (2)
24
Dim firstToken As SyntaxToken = node.
GetFirstToken
()
27
node.Parent.
GetFirstToken
(),
ExtractMethod\VisualBasicMethodExtractor.TriviaResult.vb (1)
61
Return callsite.
GetFirstToken
(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)
ExtractMethod\VisualBasicMethodExtractor.vb (1)
102
currentToken.Parent.
GetFirstToken
(includeZeroWidth:=True) = currentToken Then
ExtractMethod\VisualBasicSelectionResult.vb (1)
87
Return firstToken.SpanStart <= current.
GetFirstToken
().SpanStart AndAlso
ExtractMethod\VisualBasicSelectionValidator.vb (1)
518
commonRoot.
GetFirstToken
(includeZeroWidth:=True) = firstTokenInSelection AndAlso
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (2)
33
Return FindContainingReturnableConstruct(node).
GetFirstToken
().Span.Start
38
Return continueTarget.
GetFirstToken
().Span.Start
Structure\VisualBasicStructureHelpers.vb (2)
93
Dim startToken = node.
GetFirstToken
()
212
Dim firstToken = blockNode.
GetFirstToken
()
Wrapping\SeparatedSyntaxList\VisualBasicArgumentWrapper.vb (1)
64
startToken = declaration.
GetFirstToken
()
Wrapping\SeparatedSyntaxList\VisualBasicParameterWrapper.vb (1)
56
declaration.
GetFirstToken
())
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
TestSyntaxNodes.vb (2)
2216
Dim token As SyntaxToken = tree.GetRoot().
GetFirstToken
()
2231
token = tree.GetRoot().
GetFirstToken
()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (8)
Formatting\Engine\VisualBasicStructuredTriviaFormatEngine.vb (1)
21
Dim formatter = New VisualBasicStructuredTriviaFormatEngine(trivia, initialColumn, options, formattingRules, root.
GetFirstToken
(includeZeroWidth:=True), root.GetLastToken(includeZeroWidth:=True))
Formatting\Rules\NodeBasedFormattingRule.vb (4)
21
Dim baseToken = node.
GetFirstToken
(includeZeroWidth:=True)
145
AddIndentBlockOperation(operations, outerBlockWithBaseToken.
GetFirstToken
(), pair.Item1, pair.Item2)
201
Dim outerBlockGetFirstToken = outerBlock.
GetFirstToken
()
209
outerBlockGetFirstToken = outerBlock.
GetFirstToken
()
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
116
If parent.Kind = SyntaxKind.FunctionAggregation AndAlso parent.
GetFirstToken
() = identifier Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
62
Dim baseToken = node.
GetFirstToken
(includeZeroWidth:=True)
97
Dim openBrace = parameterOrArgumentList.
GetFirstToken
(includeZeroWidth:=True)
Microsoft.CodeAnalysis.Workspaces (26)
CodeCleanup\AbstractCodeCleanerService.cs (3)
293
previousToken = (previousToken.RawKind == 0) ? root.
GetFirstToken
(includeZeroWidth: true) : previousToken;
337
previousToken = (previousToken.RawKind == 0) ? root.
GetFirstToken
(includeZeroWidth: true) : previousToken;
425
return root.
GetFirstToken
(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (3)
412
var location = node.
GetFirstToken
().GetLocation();
529
var location = node.
GetFirstToken
().GetLocation();
564
var location = node.
GetFirstToken
().GetLocation();
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.cs (1)
83
return node.
GetFirstToken
() == token && syntaxFacts.IsConversionExpression(node);
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
168
var location = node.
GetFirstToken
().GetLocation();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (1)
124
var firstToken = root.
GetFirstToken
(includeZeroWidth: true, includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
112
startToken: _rootNode.
GetFirstToken
(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.cs (1)
44
_firstToken = Root.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (1)
18
Contract.ThrowIfFalse(root.
GetFirstToken
(includeZeroWidth: true).RawKind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (2)
283
? (childNode.
GetFirstToken
(includeZeroWidth: true), childNode.GetLastToken(includeZeroWidth: true))
366
if (conditionStatement.
GetFirstToken
() == indentationAnchor)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (1)
487
var firstToken = trivia2.GetStructure()!.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (1)
169
return GetFileBanner(root.
GetFirstToken
(includeZeroWidth: true));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (1)
168
if (token == member.
GetFirstToken
() &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (2)
357
var previousToken = node.
GetFirstToken
().GetPreviousToken();
360
syntaxFacts.IsWordOrNumber(resultNode.
GetFirstToken
()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (1)
120
startToken = (startToken.RawKind != 0) ? startToken : root.
GetFirstToken
(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (1)
48
var start = node.
GetFirstToken
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (3)
55
var previousToken = firstParameter.
GetFirstToken
().GetPreviousToken();
57
if (sourceText.AreOnSameLine(previousToken, firstParameter.
GetFirstToken
()))
165
if (text.AreOnSameLine(lastParameter.GetLastToken(), thisParameter.
GetFirstToken
()))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\AddImports\AddImportHelpers.cs (1)
35
var firstToken = root.
GetFirstToken
();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
171
var previousToken = FirstStatementAffectedInInnermostBlock.
GetFirstToken
().GetPreviousToken();
Microsoft.CodeAnalysis.Workspaces.UnitTests (5)
CodeCleanup\CodeCleanupTests.cs (1)
350
var previousToken = member.
GetFirstToken
().GetPreviousToken().GetPreviousToken();
CodeCleanup\Extensions.cs (1)
20
var previousToken = node.
GetFirstToken
(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true).GetPreviousToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
UtilityTest\FormattingRangeHelperTests.cs (3)
20
var token1 = root.
GetFirstToken
();
30
var token1 = root.
GetFirstToken
();
39
var token = SyntaxFactory.ParseSyntaxTree("else\nFoo();").GetRoot().
GetFirstToken
();
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (2)
1245
var firstToken = node.
GetFirstToken
();
3349
var firstToken = container.
GetFirstToken
();
CodeModel\SyntaxNodeExtensions.cs (1)
68
return node.
GetFirstToken
();
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService.vb (2)
857
Dim token = node.
GetFirstToken
(includeSkipped:=True)
3815
Dim firstToken = container.
GetFirstToken
()