385 references to GetPreviousToken
Microsoft.AspNetCore.App.Analyzers (6)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (2)
109token = token.GetPreviousToken(); 164var previous = token.GetPreviousToken();
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (1)
147if (HasLanguageComment(token.GetPreviousToken().TrailingTrivia, out identifier, out options))
RouteEmbeddedLanguage\Infrastructure\SyntaxNodeExtensions.cs (3)
94: token.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments); 106token = token.GetPreviousToken(); 122.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments);
Microsoft.CodeAnalysis.CodeStyle (22)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
607.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments); 670: token.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments); 682token = token.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
72var previousToken = token.GetPreviousToken(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
84token = token.GetPreviousToken(); 186var token = endOfFileToken.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (3)
156var previousToken = tokenData.Token.GetPreviousToken(includeZeroWidth: true); 392Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 417Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (2)
36var currentToken = token.GetPreviousToken(includeZeroWidth: true); 45currentToken = currentToken.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
292var previousToken = firstToken.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (2)
159token1 = token1.GetPreviousToken(); 179token1 = token1.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
133token = token.GetPreviousToken(); 139token = token.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
86return tokenToRightOrIn.GetPreviousToken().GetAncestor<TNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
357var previousToken = node.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (4)
93startToken = startToken.GetPreviousToken(); 100startToken = startToken.GetPreviousToken(); 297var previousToken = token.GetPreviousToken(); 362var startToken = root.FindToken(span.Start).GetPreviousToken();
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (3)
179var previousToken = commaToken.GetPreviousToken(); 202: tokenOnLocation.GetPreviousToken(includeZeroWidth: true); 295? tokenToLeft.GetPreviousToken(includeZeroWidth: true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (1)
55var previousToken = firstParameter.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
171var previousToken = FirstStatementAffectedInInnermostBlock.GetFirstToken().GetPreviousToken();
Microsoft.CodeAnalysis.CSharp (1)
Compilation\CSharpSemanticModel.cs (1)
1285token = token.GetPreviousToken();
Microsoft.CodeAnalysis.CSharp.CodeStyle (30)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
173var lastTokenBeforeEmbeddedStatement = embeddedStatement.GetFirstToken().GetPreviousToken();
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
178var previousToken = expressionStatement.GetFirstToken().GetPreviousToken();
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
103if (ContainsEndOfLineBetween(statementStartToken.GetPreviousToken(), statementStartToken))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
663.WithPrependedLeadingTrivia(originalInitializer.OpenBraceToken.GetPreviousToken().TrailingTrivia) 672if (initializer.OpenBraceToken.GetPreviousToken().TrailingTrivia.Any(static x => x.IsSingleOrMultiLineComment()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
86&& firstToken.GetPreviousToken().Kind() == SyntaxKind.CloseParenToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
46var tokenBeforeParen = node.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\StatementSyntaxExtensions.cs (1)
20var previousToken = statement.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
72var prevToken = token.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (4)
147? token.GetPreviousToken(includeSkipped: true) 162var previousToken = token.GetPreviousToken(includeSkipped: true, includeDirectives: true, includeDocumentationComments: true); 325return token.GetPreviousToken(includeSkipped: true); 336return token.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (3)
35token = token.GetPreviousToken(includeSkipped: true); 396token = token.GetPreviousToken(includeSkipped: true, includeDirectives: true); 448token = root.EndOfFileToken.GetPreviousToken(includeSkipped: true, includeDirectives: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
68var previousToken = currentToken.GetPreviousToken(includeSkipped: false, includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (1)
187firstTokenOfNode = firstTokenOfNode.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
250AddIndentBlockOperation(list, bracePair.openBrace.GetNextToken(includeZeroWidth: true), bracePair.closeBrace.GetPreviousToken(includeZeroWidth: true)); 263AddIndentBlockOperation(list, bracketPair.openBracket.GetNextToken(includeZeroWidth: true), bracketPair.closeBracket.GetPreviousToken(includeZeroWidth: true)); 276var baseToken = firstToken.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
375AddSuppressAllOperationIfOnMultipleLine(list, arrayOrCollectionInitializer.OpenBraceToken.GetPreviousToken(includeZeroWidth: true), arrayOrCollectionInitializer.CloseBraceToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
73var firstToken = firstTokenOfEmbeddedStatement.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
83var previousToken = token.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
38var previousToken = currentToken.GetPreviousToken(); 49previousToken = currentToken.GetPreviousToken(); 288var previousToken = token.GetPreviousToken(); 310var previousToken = startToken.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TokenComparer.cs (2)
24x.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.StaticKeyword && 25y.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.StaticKeyword)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (26)
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
200if (sourceText.AreOnSameLine(declarator.GetFirstToken(), declarator.GetFirstToken().GetPreviousToken(includeSkipped: true)))
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
75var firstBrace = token.GetPreviousToken();
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (2)
55var parenToken = colonToken.GetPreviousToken(); 92var closeParen = colonToken.GetPreviousToken();
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
108var previousToken = openBrace.GetPreviousToken();
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (3)
180initializer.OpenBraceToken.GetPreviousToken().TrailingTrivia.Any(static x => x.IsSingleOrMultiLineComment()); 184var additionalLeadingTrivia = initializer!.OpenBraceToken.GetPreviousToken().TrailingTrivia 589if (document.Text.AreOnSameLine(firstToken.GetPreviousToken(), firstToken))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
186if (text.AreOnSameLine(firstToken.GetPreviousToken(), firstToken))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (4)
48token.GetPreviousToken() is { RawKind: (int)SyntaxKind.StaticKeyword, Parent: UsingDirectiveSyntax }) 301token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.IntoKeyword) 494targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>()) 576targetToken = targetToken.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (7)
851token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IdentifierToken) && 852token.GetPreviousToken(includeSkipped: true).GetPreviousToken().IsKind(SyntaxKind.WhereKeyword)) 1186token.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword) 1372return IsAtStartOfPattern(syntaxTree, parenthesizedExpression.GetFirstToken().GetPreviousToken(), parenthesizedExpression.SpanStart); 1889token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.FixedKeyword)) 2342var previousToken = tokenOnLeftOfPosition.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (3)
87var previousToken = token.GetPreviousToken(includeZeroWidth: true); 158constructorInitializer.ArgumentList.CloseParenToken.GetPreviousToken(includeZeroWidth: true), 204node.GetLastToken(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
424previousToken.GetPreviousToken().Kind() is SyntaxKind.EqualsToken or SyntaxKind.OpenParenToken or SyntaxKind.CommaToken) 802if (previousToken.HasValue && previousToken.Value.GetPreviousToken().Kind() == SyntaxKind.EqualsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
78var previousToken = originalToken.GetPreviousToken();
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (2)
226var previousToken = lastToken.GetPreviousToken(); 604&& IsTokenPartOfExpression(switchStatementNode.GetFirstToken().GetPreviousToken()))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Formatting\Indentation\SmartTokenFormatterFormatRangeTests.cs (2)
3418if (position == endToken.SpanStart && !endToken.GetPreviousToken().IsKind(SyntaxKind.None)) 3420endToken = endToken.GetPreviousToken();
Microsoft.CodeAnalysis.CSharp.Features (61)
BraceCompletion\LessAndGreaterThanBraceCompletionService.cs (1)
58var previousToken = token.GetPreviousToken();
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
297var previousToken = token.GetPreviousToken();
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (2)
99var tokenBeforeType = typeNode.GetFirstToken().GetPreviousToken(); 129tokenBeforeType = tokenBeforeType.GetPreviousToken();
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider.cs (2)
190var questionToken = dotToken.GetPreviousToken().Kind() == SyntaxKind.QuestionToken 191? dotToken.GetPreviousToken()
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Conversions.cs (2)
84var questionToken = dotToken.GetPreviousToken().Kind() == SyntaxKind.QuestionToken 85? dotToken.GetPreviousToken()
Completion\CompletionProviders\OverrideCompletionProvider.cs (2)
71nextToken = typeSyntax.GetFirstToken().GetPreviousToken(); 184token = token.GetPreviousToken();
Completion\CompletionProviders\Scripting\DirectiveCompletionProviderUtilities.cs (1)
19token = token.GetPreviousToken(includeSkipped: true, includeDirectives: true);
Completion\CompletionProviders\SymbolCompletionProvider.cs (1)
175return token.GetPreviousToken().Kind() != SyntaxKind.NumericLiteralToken;
Completion\CompletionProviders\XmlDocCommentCompletionProvider.cs (1)
223token = token.GetPreviousToken();
Completion\KeywordRecommenders\AnnotationsKeywordRecommender.cs (2)
20var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); 21var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\ByKeywordRecommender.cs (1)
46token.GetPreviousToken(includeSkipped: true) == lastToken)
Completion\KeywordRecommenders\CheckedKeywordRecommender.cs (2)
33var previousPossiblySkippedToken = targetToken.GetPreviousToken(includeSkipped: true); 55previousToken = targetToken.GetPreviousToken(includeSkipped: false);
Completion\KeywordRecommenders\ChecksumKeywordRecommender.cs (1)
22var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\DefaultKeywordRecommender.cs (1)
37var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\DisableKeywordRecommender.cs (2)
20var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); 21var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\EnableKeywordRecommender.cs (2)
20var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); 30var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\HiddenKeywordRecommender.cs (1)
26var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\InKeywordRecommender.cs (1)
91if (token.GetPreviousToken(includeSkipped: true).IsKindOrHasMatchingText(SyntaxKind.FromKeyword))
Completion\KeywordRecommenders\IntoKeywordRecommender.cs (1)
105token = token.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\RefKeywordRecommender.cs (1)
200var previous = token.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\RestoreKeywordRecommender.cs (2)
20var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); 21var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\ScopedKeywordRecommender.cs (1)
37var previous = token.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\UsingKeywordRecommender.cs (1)
138var previousToken = token.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\WarningKeywordRecommender.cs (1)
28var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\WarningsKeywordRecommender.cs (2)
20var previousToken2 = previousToken1.GetPreviousToken(includeSkipped: true); 21var previousToken3 = previousToken2.GetPreviousToken(includeSkipped: true);
Completion\KeywordRecommenders\WhereKeywordRecommender.cs (1)
101.GetPreviousToken(includeZeroWidth: true)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
269if (parsedDocument.Text.AreOnSameLine(firstToken.GetPreviousToken(), firstToken))
Debugging\CSharpProximityExpressionsService.cs (2)
58if (token.Kind() == SyntaxKind.CloseBraceToken && token.GetPreviousToken().Kind() != SyntaxKind.None) 60token = token.GetPreviousToken();
DocumentationComments\CSharpDocumentationCommentSnippetService.cs (1)
87var previousToken = firstToken.GetPreviousToken();
ExtractMethod\CSharpMethodExtractor.TriviaResult.cs (2)
75TriviaLocation.BeforeBeginningOfSpan => callsite.GetFirstToken(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true), 81? body.CloseBraceToken.GetPreviousToken(includeZeroWidth: true)
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
42if (token.GetPreviousToken().IsKind(SyntaxKind.YieldKeyword))
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (1)
105var previousToken = mod.GetPreviousToken();
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
173var lastTokenBeforeEmbeddedStatement = embeddedStatement.GetFirstToken().GetPreviousToken();
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
178var previousToken = expressionStatement.GetFirstToken().GetPreviousToken();
src\Analyzers\CSharp\Analyzers\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementDiagnosticAnalyzer.cs (1)
103if (ContainsEndOfLineBetween(statementStartToken.GetPreviousToken(), statementStartToken))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
663.WithPrependedLeadingTrivia(originalInitializer.OpenBraceToken.GetPreviousToken().TrailingTrivia) 672if (initializer.OpenBraceToken.GetPreviousToken().TrailingTrivia.Any(static x => x.IsSingleOrMultiLineComment()))
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
200if (sourceText.AreOnSameLine(declarator.GetFirstToken(), declarator.GetFirstToken().GetPreviousToken(includeSkipped: true)))
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (1)
75var firstBrace = token.GetPreviousToken();
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (2)
55var parenToken = colonToken.GetPreviousToken(); 92var closeParen = colonToken.GetPreviousToken();
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
108var previousToken = openBrace.GetPreviousToken();
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (3)
180initializer.OpenBraceToken.GetPreviousToken().TrailingTrivia.Any(static x => x.IsSingleOrMultiLineComment()); 184var additionalLeadingTrivia = initializer!.OpenBraceToken.GetPreviousToken().TrailingTrivia 589if (document.Text.AreOnSameLine(firstToken.GetPreviousToken(), firstToken))
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (1)
186if (text.AreOnSameLine(firstToken.GetPreviousToken(), firstToken))
Structure\CSharpStructureHelpers.cs (2)
290EnumDeclarationSyntax enumDeclaration => enumDeclaration.OpenBraceToken.GetPreviousToken(), 291TypeDeclarationSyntax typeDeclaration => typeDeclaration.OpenBraceToken.GetPreviousToken(),
Structure\Providers\BlockSyntaxStructureProvider.cs (1)
165var previousToken = node.GetFirstToken().GetPreviousToken();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (8)
Syntax\SyntaxNodeTests.cs (8)
1111token = token.GetPreviousToken(); 1142token = token.GetPreviousToken(includeSkipped: true); 1171token = token.GetPreviousToken(includeSkipped: false); 1195token = token.GetPreviousToken(); 1256var token = tree.GetCompilationUnitRoot().EndOfFileToken.GetPreviousToken(includeZeroWidth: true); 1260token = token.GetPreviousToken(includeZeroWidth: true); 1280SyntaxToken token = syntaxTree.GetCompilationUnitRoot().EndOfFileToken.GetPreviousToken(includeZeroWidth: true); 1284token = token.GetPreviousToken(includeZeroWidth: true);
Microsoft.CodeAnalysis.CSharp.Workspaces (62)
Classification\Worker_Preprocesser.cs (1)
80var lastToken = node.EndOfDirectiveToken.GetPreviousToken(includeSkipped: false);
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3074var previousToken = firstToken.GetPreviousToken();
Formatting\TypingFormattingRule.cs (1)
91endToken = endToken.GetPreviousToken();
Rename\CSharpRenameRewriterLanguageService.cs (3)
380if (!isRenameLocation && symbol is INamespaceSymbol && token.GetPreviousToken().IsKind(SyntaxKind.NamespaceKeyword)) 399if (isRenameLocation && token.GetPreviousToken().IsKind(SyntaxKind.NamespaceKeyword)) 752token.GetPreviousToken().Kind() != SyntaxKind.DotToken &&
Simplification\CSharpSimplificationService.cs (1)
159var previousToken = originalToken.GetPreviousToken();
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
160if (!FormattingRangeHelper.AreTwoTokensOnSameLine(node.Parent.GetFirstToken(), node.GetFirstToken().GetPreviousToken()))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
86&& firstToken.GetPreviousToken().Kind() == SyntaxKind.CloseParenToken;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
46var tokenBeforeParen = node.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\StatementSyntaxExtensions.cs (1)
20var previousToken = statement.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
72var prevToken = token.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTokenExtensions.cs (4)
147? token.GetPreviousToken(includeSkipped: true) 162var previousToken = token.GetPreviousToken(includeSkipped: true, includeDirectives: true, includeDocumentationComments: true); 325return token.GetPreviousToken(includeSkipped: true); 336return token.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTreeExtensions.cs (3)
35token = token.GetPreviousToken(includeSkipped: true); 396token = token.GetPreviousToken(includeSkipped: true, includeDirectives: true); 448token = root.EndOfFileToken.GetPreviousToken(includeSkipped: true, includeDirectives: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (1)
68var previousToken = currentToken.GetPreviousToken(includeSkipped: false, includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\BaseFormattingRule.cs (1)
187firstTokenOfNode = firstTokenOfNode.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (3)
250AddIndentBlockOperation(list, bracePair.openBrace.GetNextToken(includeZeroWidth: true), bracePair.closeBrace.GetPreviousToken(includeZeroWidth: true)); 263AddIndentBlockOperation(list, bracketPair.openBracket.GetNextToken(includeZeroWidth: true), bracketPair.closeBracket.GetPreviousToken(includeZeroWidth: true)); 276var baseToken = firstToken.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
375AddSuppressAllOperationIfOnMultipleLine(list, arrayOrCollectionInitializer.OpenBraceToken.GetPreviousToken(includeZeroWidth: true), arrayOrCollectionInitializer.CloseBraceToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\WrappingFormattingRule.cs (1)
73var firstToken = firstTokenOfEmbeddedStatement.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Indentation\CSharpSmartTokenFormatter.cs (1)
83var previousToken = token.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\FormattingRangeHelper.cs (4)
38var previousToken = currentToken.GetPreviousToken(); 49previousToken = currentToken.GetPreviousToken(); 288var previousToken = token.GetPreviousToken(); 310var previousToken = startToken.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TokenComparer.cs (2)
24x.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.StaticKeyword && 25y.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.UsingKeyword or SyntaxKind.StaticKeyword)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (1)
456var previousToken = targetToken.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (4)
48token.GetPreviousToken() is { RawKind: (int)SyntaxKind.StaticKeyword, Parent: UsingDirectiveSyntax }) 301token.GetPreviousToken(includeSkipped: true).Kind() == SyntaxKind.IntoKeyword) 494targetToken.GetPreviousToken(includeSkipped: true).IsLastTokenOfNode<TypeSyntax>()) 576targetToken = targetToken.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (18)
631token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.GlobalKeyword)) 696token.GetPreviousToken().IsKind(SyntaxKind.PartialKeyword)) 851token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IdentifierToken) && 852token.GetPreviousToken(includeSkipped: true).GetPreviousToken().IsKind(SyntaxKind.WhereKeyword)) 1186token.GetPreviousToken(includeSkipped: true).Kind() is SyntaxKind.ImplicitKeyword or SyntaxKind.ExplicitKeyword) 1372return IsAtStartOfPattern(syntaxTree, parenthesizedExpression.GetFirstToken().GetPreviousToken(), parenthesizedExpression.SpanStart); 1831var previous = token.GetPreviousToken(includeSkipped: true); 1889token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.FixedKeyword)) 2342var previousToken = tokenOnLeftOfPosition.GetPreviousToken(includeSkipped: true); 2601if (token.GetPreviousToken(includeSkipped: true).Kind() != SyntaxKind.OpenBracketToken) 2615token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.WhileKeyword)) 2631token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.LockKeyword)) 2638token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.IfKeyword)) 2645token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.SwitchKeyword)) 2652token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.CheckedKeyword)) 2659token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.UncheckedKeyword)) 2666token.GetPreviousToken(includeSkipped: true).IsKind(SyntaxKind.WhenKeyword))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Indentation\CSharpIndentationService.cs (3)
87var previousToken = token.GetPreviousToken(includeZeroWidth: true); 158constructorInitializer.ArgumentList.CloseParenToken.GetPreviousToken(includeZeroWidth: true), 204node.GetLastToken(includeZeroWidth: true).GetPreviousToken(includeZeroWidth: true),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
424previousToken.GetPreviousToken().Kind() is SyntaxKind.EqualsToken or SyntaxKind.OpenParenToken or SyntaxKind.CommaToken) 802if (previousToken.HasValue && previousToken.Value.GetPreviousToken().Kind() == SyntaxKind.EqualsToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Utilities\CSharpSimplificationHelpers.cs (1)
78var previousToken = originalToken.GetPreviousToken();
Microsoft.CodeAnalysis.EditorFeatures (1)
TextStructureNavigation\AbstractTextStructureNavigatorProvider.TextStructureNavigator.cs (1)
106token = token.GetPreviousToken();
Microsoft.CodeAnalysis.Features (14)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (1)
215var previousOfStart = startToken.GetPreviousToken(includeZeroWidth: true);
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
163var previousToken = endOfFileToken.GetPreviousToken(includeZeroWidth: true, includeSkipped: true);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeEmbeddedLanguage.cs (1)
51var previous = token.GetPreviousToken();
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
87if (HasLanguageComment(token.GetPreviousToken().TrailingTrivia, syntaxFacts, out identifier, out options))
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
115tokens[TriviaLocation.BeforeBeginningOfSpan] = tokens[TriviaLocation.AfterBeginningOfSpan].GetPreviousToken(includeZeroWidth: true);
ExtractMethod\AbstractSyntaxTriviaService.Result.cs (3)
116tokens[TriviaLocation.AfterBeginningOfSpan].GetPreviousToken(includeZeroWidth: true) == tokens[TriviaLocation.BeforeEndOfSpan] || 223PreviousToken = tokens[TriviaLocation.AfterBeginningOfSpan].GetPreviousToken(includeZeroWidth: true), 235PreviousToken = tokens[TriviaLocation.AfterEndOfSpan].GetPreviousToken(includeZeroWidth: true),
Snippets\SnippetProviders\AbstractInlineStatementSnippetProvider.cs (1)
82var previousToken = token.GetPreviousToken();
Wrapping\SeparatedSyntaxList\SeparatedSyntaxListCodeActionComputer.cs (5)
132var previousToken = _listSyntax.GetFirstToken().GetPreviousToken(); 208result.Add(Edit.DeleteBetween(_listSyntax.GetFirstToken().GetPreviousToken(), _listSyntax.GetFirstToken())); 215result.Add(Edit.DeleteBetween(comma.GetPreviousToken(), comma)); 297_listSyntax.GetFirstToken().GetPreviousToken(), NewLineTrivia, 432_listSyntax.GetFirstToken().GetPreviousToken(), NewLineTrivia,
Microsoft.CodeAnalysis.VisualBasic (1)
Compilation\SemanticModel.vb (1)
636token = token.GetPreviousToken(includeSkipped:=False, includeDirectives:=False, includeDocumentationComments:=False)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (36)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ParenthesizedExpressionSyntaxExtensions.vb (1)
181Dim previousToken = node.OpenParenToken.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
696Dim previousToken = statement.GetFirstToken().GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (2)
197Dim previousToken = token.GetPreviousToken(includeSkipped:=True, includeDirectives:=True, includeDocumentationComments:=True) 216token.GetPreviousToken(includeSkipped:=True),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Indentation\VisualBasicSmartTokenFormatter.vb (1)
38Dim previousToken = token.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\TokenComparer.vb (2)
25token1.GetPreviousToken().Kind = SyntaxKind.ImportsKeyword AndAlso 26token2.GetPreviousToken().Kind = SyntaxKind.ImportsKeyword Then
src\Workspaces\VisualBasic\Portable\Formatting\Rules\AdjustSpaceFormattingRule.vb (1)
363Return ContainsLineBreak(previousToken.LeadingTrivia) OrElse ContainsLineBreak(previousToken.GetPreviousToken(includeZeroWidth:=True).TrailingTrivia)
src\Workspaces\VisualBasic\Portable\Formatting\Rules\BaseFormattingRule.vb (2)
51Dim previousToken = startToken.GetPreviousToken(includeZeroWidth:=True) 57Dim spanStart = startToken.GetPreviousToken(includeZeroWidth:=True).Span.End
src\Workspaces\VisualBasic\Portable\Formatting\Rules\ElasticTriviaFormattingRule.vb (2)
31initializer.CloseBraceToken.GetPreviousToken(), 49initializer.CloseBraceToken.GetPreviousToken(),
src\Workspaces\VisualBasic\Portable\Formatting\Rules\NodeBasedFormattingRule.vb (24)
60xmlDocument.GetLastToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 94xmlNode.EndTag.LessThanSlashToken.GetPreviousToken(includeZeroWidth:=True)) 108xmlEmbeddedExpression.PercentGreaterThanToken.GetPreviousToken(includeZeroWidth:=True)) 124multiLineLambda.EndSubOrFunctionStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 233Dim token = endToken.GetPreviousToken(includeZeroWidth:=True) 279Dim previousToken = baseToken.GetPreviousToken(includeZeroWidth:=True) 286previousToken = previousToken.GetPreviousToken(includeZeroWidth:=True) 301Dim previousToken = xmlToken.GetPreviousToken(includeZeroWidth:=True) 315[namespace].EndNamespaceStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 322[module].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 329[class].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 336[struct].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 343[interface].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 350[enum].EndEnumStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 357[method].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 364[property].EndPropertyStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 371[event].EndEventStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 378[while].EndWhileStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 385[using].EndUsingStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 392[sync].EndSyncLockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 399[with].EndWithStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 460[select].EndSelectStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 474[do].LoopStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 487Return node.NextStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (8)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (2)
109targetToken.GetPreviousToken().IsKind(SyntaxKind.HashToken) AndAlso 110targetToken.GetPreviousToken().Parent.IsKind(SyntaxKind.BadDirectiveTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
265targetToken = targetToken.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
107Dim endToken = closeBrace.GetPreviousToken(includeZeroWidth:=True) 158endToken = closeBrace.GetPreviousToken(includeZeroWidth:=True)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (1)
107Return token.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.vb (1)
67Dim previousToken = token.GetPreviousToken(includeZeroWidth:=True)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\ModifierCollectionFacts.vb (1)
210targetToken = targetToken.GetPreviousToken()
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
AutomaticCompletion\AutomaticLineEnderCommandHandler.vb (2)
73lastToken = If(lastToken.Kind = SyntaxKind.EndOfFileToken, lastToken.GetPreviousToken(includeZeroWidth:=True), lastToken) 86Dim nonMissingToken = If(lastToken.IsMissing, lastToken.GetPreviousToken(), lastToken)
EndConstructGeneration\EndConstructCommandHandler.vb (1)
158Dim previousToken = firstToken.GetPreviousToken()
Microsoft.CodeAnalysis.VisualBasic.Features (10)
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (1)
315Dim previousToken = localDeclaration.GetFirstToken().GetPreviousToken()
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (1)
119Dim previousToken = token.GetPreviousToken()
Completion\CompletionProviders\OverrideCompletionProvider.vb (1)
132Dim previousToken = token.GetPreviousToken()
Completion\CompletionProviders\SymbolCompletionProvider.vb (1)
93Dim previousToken = token.GetPreviousToken()
Completion\CompletionProviders\XmlDocCommentCompletionProvider.vb (1)
60token.GetPreviousToken(includeSkipped:=True),
Debugging\ProximityExpressionsGetter.vb (1)
70token = parentEndBlock.EndKeyword.GetPreviousToken()
DocumentationComments\VisualBasicDocumentationCommentSnippetService.vb (1)
104Dim previousToken = firstToken.GetPreviousToken()
ExtractMethod\VisualBasicMethodExtractor.TriviaResult.vb (2)
61Return callsite.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True) 67Return method.EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)
Highlighting\KeywordHighlightingHelpers.vb (1)
86Dim previousToken = .AwaitKeyword.GetPreviousToken()
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (1)
TestSyntaxNodes.vb (1)
1989Dim listToken = CType(openParenToken.GetPreviousToken(), SyntaxToken)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (47)
Formatting\Rules\AdjustSpaceFormattingRule.vb (1)
363Return ContainsLineBreak(previousToken.LeadingTrivia) OrElse ContainsLineBreak(previousToken.GetPreviousToken(includeZeroWidth:=True).TrailingTrivia)
Formatting\Rules\BaseFormattingRule.vb (2)
51Dim previousToken = startToken.GetPreviousToken(includeZeroWidth:=True) 57Dim spanStart = startToken.GetPreviousToken(includeZeroWidth:=True).Span.End
Formatting\Rules\ElasticTriviaFormattingRule.vb (2)
31initializer.CloseBraceToken.GetPreviousToken(), 49initializer.CloseBraceToken.GetPreviousToken(),
Formatting\Rules\NodeBasedFormattingRule.vb (24)
60xmlDocument.GetLastToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 94xmlNode.EndTag.LessThanSlashToken.GetPreviousToken(includeZeroWidth:=True)) 108xmlEmbeddedExpression.PercentGreaterThanToken.GetPreviousToken(includeZeroWidth:=True)) 124multiLineLambda.EndSubOrFunctionStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 233Dim token = endToken.GetPreviousToken(includeZeroWidth:=True) 279Dim previousToken = baseToken.GetPreviousToken(includeZeroWidth:=True) 286previousToken = previousToken.GetPreviousToken(includeZeroWidth:=True) 301Dim previousToken = xmlToken.GetPreviousToken(includeZeroWidth:=True) 315[namespace].EndNamespaceStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 322[module].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 329[class].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 336[struct].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 343[interface].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 350[enum].EndEnumStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 357[method].EndBlockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 364[property].EndPropertyStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 371[event].EndEventStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 378[while].EndWhileStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 385[using].EndUsingStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 392[sync].EndSyncLockStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 399[with].EndWithStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 460[select].EndSelectStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 474[do].LoopStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)) 487Return node.NextStatement.GetFirstToken(includeZeroWidth:=True).GetPreviousToken(includeZeroWidth:=True)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
349If Not isRenameLocation AndAlso TypeOf (symbol) Is INamespaceSymbol AndAlso token.GetPreviousToken().Kind = SyntaxKind.NamespaceKeyword Then 364If isRenameLocation AndAlso token.GetPreviousToken().Kind = SyntaxKind.NamespaceKeyword Then
Simplification\Reducers\VisualBasicEscapingReducer.vb (1)
126Dim previousToken = identifier.GetPreviousToken(False, False, True, True)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ParenthesizedExpressionSyntaxExtensions.vb (1)
181Dim previousToken = node.OpenParenToken.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
696Dim previousToken = statement.GetFirstToken().GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxTokenExtensions.vb (2)
197Dim previousToken = token.GetPreviousToken(includeSkipped:=True, includeDirectives:=True, includeDocumentationComments:=True) 216token.GetPreviousToken(includeSkipped:=True),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Indentation\VisualBasicSmartTokenFormatter.vb (1)
38Dim previousToken = token.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\TokenComparer.vb (2)
25token1.GetPreviousToken().Kind = SyntaxKind.ImportsKeyword AndAlso 26token2.GetPreviousToken().Kind = SyntaxKind.ImportsKeyword Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTokenExtensions.vb (2)
109targetToken.GetPreviousToken().IsKind(SyntaxKind.HashToken) AndAlso 110targetToken.GetPreviousToken().Parent.IsKind(SyntaxKind.BadDirectiveTrivia)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContext.vb (1)
265targetToken = targetToken.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
107Dim endToken = closeBrace.GetPreviousToken(includeZeroWidth:=True) 158endToken = closeBrace.GetPreviousToken(includeZeroWidth:=True)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.Indenter.vb (1)
107Return token.GetPreviousToken()
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\VisualBasicIndentationService.vb (1)
67Dim previousToken = token.GetPreviousToken(includeZeroWidth:=True)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\ModifierCollectionFacts.vb (1)
210targetToken = targetToken.GetPreviousToken()
Microsoft.CodeAnalysis.Workspaces (30)
CodeCleanup\AbstractCodeCleanerService.cs (3)
260return nextToken.GetPreviousToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true).Span.End; 333var previousToken = startToken.GetPreviousToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true); 374previousToken = startToken.GetPreviousToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
607.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments); 670: token.GetPreviousToken(includeZeroWidth: false, includeSkipped: includeSkipped, includeDirectives: includeDirectives, includeDocumentationComments: includeDocumentationComments); 682token = token.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
72var previousToken = token.GetPreviousToken(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTreeExtensions.cs (2)
84token = token.GetPreviousToken(); 186var token = endOfFileToken.GetPreviousToken(includeSkipped: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (3)
156var previousToken = tokenData.Token.GetPreviousToken(includeZeroWidth: true); 392Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 417Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TreeData.Node.cs (2)
36var currentToken = token.GetPreviousToken(includeZeroWidth: true); 45currentToken = currentToken.GetPreviousToken(includeZeroWidth: true);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
292var previousToken = firstToken.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\BaseIndentationFormattingRule.cs (2)
159token1 = token1.GetPreviousToken(); 179token1 = token1.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (2)
133token = token.GetPreviousToken(); 139token = token.GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
86return tokenToRightOrIn.GetPreviousToken().GetAncestor<TNode>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
357var previousToken = node.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\CommonFormattingHelpers.cs (4)
93startToken = startToken.GetPreviousToken(); 100startToken = startToken.GetPreviousToken(); 297var previousToken = token.GetPreviousToken(); 362var startToken = root.FindToken(span.Start).GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (3)
179var previousToken = commaToken.GetPreviousToken(); 202: tokenOnLocation.GetPreviousToken(includeZeroWidth: true); 295? tokenToLeft.GetPreviousToken(includeZeroWidth: true)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\AddParameterEditor.cs (1)
55var previousToken = firstParameter.GetFirstToken().GetPreviousToken();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
171var previousToken = FirstStatementAffectedInInnermostBlock.GetFirstToken().GetPreviousToken();
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
CodeCleanup\CodeCleanupTests.cs (2)
350var previousToken = member.GetFirstToken().GetPreviousToken().GetPreviousToken();
CodeCleanup\Extensions.cs (1)
20var previousToken = node.GetFirstToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true).GetPreviousToken(includeZeroWidth: true, includeSkipped: true, includeDirectives: true, includeDocumentationComments: true);
Microsoft.VisualStudio.LanguageServices (1)
LanguageService\AbstractLanguageService`2.IVsLanguageTextOps.cs (1)
94var prevToken = root.FindToken(start).GetPreviousToken();
Microsoft.VisualStudio.LanguageServices.CSharp (4)
CodeModel\CSharpCodeModelService.cs (3)
3198var startToken = root.FindToken(span.Start).GetPreviousToken(); 3201startToken = startToken.GetPreviousToken(); 3207endToken = endToken.GetPreviousToken();
CodeModel\EndRegionFormattingRule.cs (1)
25var previousPreviousToken = previousToken.GetPreviousToken();
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
CodeModel\VisualBasicCodeModelService.vb (1)
3732Dim startToken = GetTokenWithoutAnnotation(root.FindToken(span.Start).GetPreviousToken(), Function(t) t.GetPreviousToken())