1 write to SyntaxTree
Microsoft.CodeAnalysis.Workspaces (1)
SyntaxContext.cs (1)
89this.SyntaxTree = semanticModel.SyntaxTree;
147 references to SyntaxTree
Microsoft.CodeAnalysis.CSharp.Features (76)
Completion\CompletionProviders\ImportCompletion\ImportCompletionProviderHelper.cs (1)
30var location = context.LeftToken.Parent ?? context.SyntaxTree.GetRoot(cancellationToken);
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (1)
47var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\AsyncKeywordRecommender.cs (3)
35|| context.SyntaxTree.IsLambdaDeclarationContext(position, otherModifier: SyntaxKind.StaticKeyword, cancellationToken) 36|| context.SyntaxTree.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken); 42|| context.SyntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken)
Completion\KeywordRecommenders\BoolKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ByteKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\CatchKeywordRecommender.cs (1)
18=> context.SyntaxTree.IsCatchOrFinallyContext(position, context.LeftToken);
Completion\KeywordRecommenders\CharKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
35var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ConstKeywordRecommender.cs (1)
46context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, s_validGlobalModifiers, cancellationToken) ||
Completion\KeywordRecommenders\DecimalKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DefaultKeywordRecommender.cs (1)
26context.SyntaxTree.IsTypeParameterConstraintStartContext(position, context.LeftToken);
Completion\KeywordRecommenders\DefineKeywordRecommender.cs (1)
20context.SyntaxTree.IsBeforeFirstToken(position, cancellationToken);
Completion\KeywordRecommenders\DelegateKeywordRecommender.cs (1)
52context.SyntaxTree.IsExpressionContext(
Completion\KeywordRecommenders\DoubleKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
37var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
43var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (2)
52var syntaxTree = context.SyntaxTree; 62context.SyntaxTree.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken);
Completion\KeywordRecommenders\FinallyKeywordRecommender.cs (1)
18=> context.SyntaxTree.IsCatchOrFinallyContext(position, context.LeftToken);
Completion\KeywordRecommenders\FixedKeywordRecommender.cs (1)
36(context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\FloatKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\FromKeywordRecommender.cs (1)
19var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\GlobalKeywordRecommender.cs (1)
21var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\InKeywordRecommender.cs (3)
22var syntaxTree = context.SyntaxTree; 36if (context.SyntaxTree.IsParameterModifierContext( 46context.SyntaxTree.IsPossibleExtensionMethodContext(context.LeftToken))
Completion\KeywordRecommenders\InternalKeywordRecommender.cs (1)
41if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\IntKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\JoinKeywordRecommender.cs (1)
18=> context.SyntaxTree.IsValidContextForJoinClause(position, context.LeftToken);
Completion\KeywordRecommenders\LoadKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\LongKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ManagedKeywordRecommender.cs (1)
18=> context.SyntaxTree.IsFunctionPointerCallingConventionContext(context.TargetToken);
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
22var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\NewKeywordRecommender.cs (2)
79context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) || 95if (context.SyntaxTree.IsTypeParameterConstraintStartContext(context.Position, context.LeftToken))
Completion\KeywordRecommenders\NotnullKeywordRecommender.cs (1)
16return context.SyntaxTree.IsTypeParameterConstraintContext(position, context.LeftToken)
Completion\KeywordRecommenders\ObjectKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\OutKeywordRecommender.cs (2)
19var syntaxTree = context.SyntaxTree; 32return context.SyntaxTree.IsParameterModifierContext(
Completion\KeywordRecommenders\ParamsKeywordRecommender.cs (1)
18=> context.SyntaxTree.IsParamsModifierContext(position, context.LeftToken, cancellationToken);
Completion\KeywordRecommenders\PrivateKeywordRecommender.cs (2)
23(context.IsGlobalStatementContext && context.SyntaxTree.IsScript()) || 42if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\PublicKeywordRecommender.cs (1)
28if (context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (1)
35context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\ReferenceKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\RefKeywordRecommender.cs (3)
80var syntaxTree = context.SyntaxTree; 93if (context.SyntaxTree.IsParameterModifierContext( 103context.SyntaxTree.IsPossibleExtensionMethodContext(context.LeftToken))
Completion\KeywordRecommenders\ReturnKeywordRecommender.cs (1)
32(context.SyntaxTree.IsScript() && context.IsTypeAttributeContext(cancellationToken)) ||
Completion\KeywordRecommenders\SByteKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ScopedKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ShortKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (3)
87context.SyntaxTree.IsLambdaDeclarationContext(position, otherModifier: SyntaxKind.AsyncKeyword, cancellationToken) || 88context.SyntaxTree.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken); 94context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, s_validGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\StringKeywordRecommender.cs (1)
27var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
33var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (2)
64if (context.SyntaxTree.IsParameterModifierContext( 72context.SyntaxTree.IsPossibleExtensionMethodContext(context.LeftToken))
Completion\KeywordRecommenders\UIntKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\ULongKeywordRecommender.cs (1)
23var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UndefKeywordRecommender.cs (1)
20var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UnmanagedKeywordRecommender.cs (2)
19return context.SyntaxTree.IsTypeParameterConstraintContext(position, context.LeftToken) || 20context.SyntaxTree.IsFunctionPointerCallingConventionContext(context.TargetToken);
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (1)
70var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UShortKeywordRecommender.cs (1)
30var syntaxTree = context.SyntaxTree;
Completion\KeywordRecommenders\UsingKeywordRecommender.cs (1)
172((CompilationUnitSyntax)context.SyntaxTree.GetRoot(cancellationToken)).Externs.Count > 0)
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (5)
44var syntaxTree = context.SyntaxTree; 57context.SyntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) || 58context.SyntaxTree.IsLocalFunctionDeclarationContext(position, cancellationToken); 65context.SyntaxTree.IsDefaultExpressionContext(context.Position, context.LeftToken); 109=> context.SyntaxTree.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\VolatileKeywordRecommender.cs (2)
33(context.IsGlobalStatementContext && context.SyntaxTree.IsScript()) || 34context.SyntaxTree.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Microsoft.CodeAnalysis.CSharp.Workspaces (12)
CSharpSyntaxContext.cs (10)
326this.SyntaxTree.IsTypeDeclarationContext( 341return this.SyntaxTree.IsTypeDeclarationContext(this.Position, this, validModifiers, validTypeDeclarations, canBePartial, cancellationToken); 352var modifiers = SyntaxTree.GetPrecedingModifiers(positionBeforeRecordKeyword, cancellationToken); 371if (SyntaxTree.IsMemberDeclarationContext( 401return this.SyntaxTree.IsMemberDeclarationContext(this.Position, this, validModifiers, validTypeDeclarations, canBePartial, cancellationToken); 405=> IsGlobalStatementContext && SyntaxTree.Options.Kind is SourceCodeKind.Regular; 430var leftToken = this.SyntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken); 440return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken); 442else if (SyntaxTree.IsScript() 447return SyntaxTree.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken);
Recommendations\CSharpRecommendationServiceRunner.cs (2)
86_context.SyntaxTree.IsDefiniteCastTypeContext(_context.Position, _context.LeftToken)) 178var syntaxTree = _context.SyntaxTree;
Microsoft.CodeAnalysis.Features (4)
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
237var syntaxTree = syntaxContext.SyntaxTree;
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
50var newExpression = GetObjectCreationNewExpression(context.SyntaxTree, position, cancellationToken);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
109.Any(node => !(node.SyntaxTree == context.SyntaxTree && node.Span.IntersectsWith(context.Position)));
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
350return syntaxFacts.IsInInactiveRegion(syntaxContext.SyntaxTree, syntaxContext.Position, cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.Features (48)
Completion\CompletionProviders\CompletionListTagCompletionProvider.vb (2)
36If syntaxContext.SyntaxTree.IsObjectCreationTypeContext(position, cancellationToken) OrElse 37syntaxContext.SyntaxTree.IsInNonUserCode(position, cancellationToken) Then
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
47If syntaxContext.SyntaxTree.IsInNonUserCode(syntaxContext.Position, cancellationToken) Then
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (2)
47If context.SyntaxTree.IsInNonUserCode(position, cancellationToken) OrElse 48context.SyntaxTree.IsInSkippedText(position, cancellationToken) Then
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (2)
63If context.SyntaxTree.IsInNonUserCode(position, cancellationToken) OrElse 64context.SyntaxTree.IsInSkippedText(position, cancellationToken) Then
Completion\CompletionProviders\ImportCompletionProvider\ImportCompletionProviderHelper.vb (1)
18Dim Location = If(syntaxContext.LeftToken.Parent, Await syntaxContext.SyntaxTree.GetRootAsync(token).ConfigureAwait(False))
Completion\KeywordRecommenders\Declarations\ImportsKeywordRecommender.vb (2)
28If context.SyntaxTree.HasCompilationUnitRoot Then 31Dim compilationUnit = DirectCast(context.SyntaxTree.GetRoot(cancellationToken), CompilationUnitSyntax)
Completion\KeywordRecommenders\Declarations\InKeywordRecommender.vb (1)
60Return context.SyntaxTree.IsFollowingCompleteExpression(Of SimpleAsClauseSyntax)(
Completion\KeywordRecommenders\Declarations\ModuleKeywordRecommender.vb (1)
22If context.SyntaxTree.IsDeclarationContextWithinTypeBlocks(context.Position, context.TargetToken, True, cancellationToken, SyntaxKind.CompilationUnit, SyntaxKind.NamespaceBlock) Then
Completion\KeywordRecommenders\Declarations\NamespaceKeywordRecommender.vb (1)
22If context.SyntaxTree.IsDeclarationContextWithinTypeBlocks(context.Position, context.TargetToken, False, cancellationToken, SyntaxKind.CompilationUnit, SyntaxKind.NamespaceBlock) Then
Completion\KeywordRecommenders\Declarations\OperatorKeywordRecommender.vb (1)
21If context.SyntaxTree.IsDeclarationContextWithinTypeBlocks(context.Position, context.TargetToken, True, cancellationToken, SyntaxKind.ClassBlock, SyntaxKind.StructureBlock) AndAlso
Completion\KeywordRecommenders\Expressions\BinaryOperatorKeywordRecommender.vb (7)
85If context.SyntaxTree.IsFollowingCompleteExpression(Of JoinConditionSyntax)( 96If context.SyntaxTree.IsFollowingCompleteExpression(Of ExpressionRangeVariableSyntax)( 103If context.SyntaxTree.IsFollowingCompleteExpression(Of UnaryExpressionSyntax)(context.Position, context.TargetToken, 135If context.SyntaxTree.IsFollowingCompleteExpression(Of AddRemoveHandlerStatementSyntax)( 143If context.SyntaxTree.IsFollowingCompleteExpression(Of ForStatementSyntax)(context.Position, context.TargetToken, Function(forStatement) forStatement.FromValue, cancellationToken) Then 147Return context.SyntaxTree.IsFollowingCompleteExpression(Of ExpressionSyntax)(context.Position, context.TargetToken, 149If context.SyntaxTree.IsExpressionContext(e.SpanStart, cancellationToken, context.SemanticModel) Then
Completion\KeywordRecommenders\Expressions\LambdaKeywordRecommender.vb (1)
27If context.SyntaxTree.IsExpressionContext(targetToken.SpanStart, cancellationToken, context.SemanticModel) Then
Completion\KeywordRecommenders\PreprocessorDirectives\ConstDirectiveKeywordRecommender.vb (1)
21Return If(context.IsPreprocessorStartContext AndAlso Not context.SyntaxTree.IsEnumMemberNameContext(context),
Completion\KeywordRecommenders\PreprocessorDirectives\ElseDirectiveKeywordRecommender.vb (1)
22Dim innermostKind = context.SyntaxTree.GetInnermostIfPreprocessorKind(context.Position, cancellationToken)
Completion\KeywordRecommenders\PreprocessorDirectives\ElseIfDirectiveKeywordRecommender.vb (1)
22Dim innermostKind = context.SyntaxTree.GetInnermostIfPreprocessorKind(context.Position, cancellationToken)
Completion\KeywordRecommenders\PreprocessorDirectives\EndIfDirectiveKeywordRecommender.vb (2)
24Dim innermostKind = context.SyntaxTree.GetInnermostIfPreprocessorKind(context.Position, cancellationToken) 35Dim innermostKind = context.SyntaxTree.GetInnermostIfPreprocessorKind(context.Position, cancellationToken)
Completion\KeywordRecommenders\PreprocessorDirectives\EndRegionDirectiveKeywordRecommender.vb (2)
25Dim directives = context.SyntaxTree.GetStartDirectives(cancellationToken) 36Dim directives = context.SyntaxTree.GetStartDirectives(cancellationToken)
Completion\KeywordRecommenders\PreprocessorDirectives\IfDirectiveKeywordRecommender.vb (1)
21Return If(context.IsPreprocessorStartContext AndAlso Not context.SyntaxTree.IsEnumMemberNameContext(context),
Completion\KeywordRecommenders\PreprocessorDirectives\ReferenceDirectiveKeywordRecommender.vb (2)
21Return If(context.IsPreprocessorStartContext AndAlso context.SyntaxTree.IsScript() AndAlso Not context.SyntaxTree.IsEnumMemberNameContext(context),
Completion\KeywordRecommenders\PreprocessorDirectives\RegionDirectiveKeywordRecommender.vb (1)
21Return If(context.IsPreprocessorStartContext AndAlso Not context.SyntaxTree.IsEnumMemberNameContext(context),
Completion\KeywordRecommenders\PreprocessorDirectives\WarningDirectiveKeywordRecommender.vb (1)
18If context.IsPreprocessorStartContext AndAlso Not context.SyntaxTree.IsEnumMemberNameContext(context) Then
Completion\KeywordRecommenders\Queries\AscendingDescendingKeywordRecommender.vb (1)
23Return If(context.SyntaxTree.IsFollowingCompleteExpression(Of OrderingSyntax)(context.Position, context.TargetToken, Function(orderingSyntax) orderingSyntax.Expression, cancellationToken),
Completion\KeywordRecommenders\Queries\EqualsKeywordRecommender.vb (1)
22Return If(context.SyntaxTree.IsFollowingCompleteExpression(Of JoinConditionSyntax)(context.Position, context.TargetToken, Function(joinCondition) joinCondition.Left, cancellationToken),
Completion\KeywordRecommenders\Queries\GroupByKeywordRecommender.vb (1)
27context.SyntaxTree.IsFollowingCompleteExpression(Of GroupByClauseSyntax)(
Completion\KeywordRecommenders\Queries\IntoKeywordRecommender.vb (2)
23If context.SyntaxTree.IsFollowingCompleteExpression(Of GroupByClauseSyntax)( 29If context.SyntaxTree.IsFollowingCompleteExpression(Of GroupJoinClauseSyntax)(
Completion\KeywordRecommenders\Queries\OnKeywordRecommender.vb (2)
22If context.SyntaxTree.IsFollowingCompleteExpression(Of JoinClauseSyntax)(context.Position, context.TargetToken, Function(joinQuery) joinQuery.JoinedVariables.LastCollectionExpression, cancellationToken) OrElse 23context.SyntaxTree.IsFollowingCompleteExpression(Of JoinConditionSyntax)(context.Position, context.TargetToken, Function(joinCondition) joinCondition.Right, cancellationToken) Then
Completion\KeywordRecommenders\Statements\StepKeywordRecommender.vb (1)
22If context.SyntaxTree.IsFollowingCompleteExpression(Of ForStatementSyntax)(
Completion\KeywordRecommenders\Statements\ThenKeywordRecommender.vb (2)
22Dim isFollowingIfStatement = context.SyntaxTree.IsFollowingCompleteExpression(Of IfStatementSyntax)( 30context.SyntaxTree.IsFollowingCompleteExpression(Of IfDirectiveTriviaSyntax)(
Completion\KeywordRecommenders\Statements\ToKeywordRecommender.vb (3)
28If context.SyntaxTree.IsFollowingCompleteExpression(Of SimpleCaseClauseSyntax)(context.Position, context.TargetToken, Function(c) c.Value, cancellationToken) OrElse 29context.SyntaxTree.IsFollowingCompleteExpression(Of RangeCaseClauseSyntax)(context.Position, context.TargetToken, Function(c) c.LowerBound, cancellationToken) Then 34If context.SyntaxTree.IsFollowingCompleteExpression(Of ForStatementSyntax)(context.Position, context.TargetToken, Function(forStatement) forStatement.FromValue, cancellationToken) Then
Completion\KeywordRecommenders\Statements\WhenKeywordRecommender.vb (1)
32If context.SyntaxTree.IsFollowingCompleteExpression(Of SimpleAsClauseSyntax)(context.Position, context.TargetToken,
Microsoft.CodeAnalysis.VisualBasic.Workspaces (7)
Recommendations\VisualBasicRecommendationServiceRunner.vb (5)
31If _context.SyntaxTree.IsInNonUserCode(_context.Position, _cancellationToken) OrElse 32_context.SyntaxTree.IsInSkippedText(_context.Position, _cancellationToken) Then 45ElseIf _context.SyntaxTree.IsQueryIntoClauseContext(_context.Position, _context.TargetToken, _cancellationToken) Then 53ElseIf _context.SyntaxTree.IsLabelContext(_context.Position, _context.TargetToken, _cancellationToken) Then 55ElseIf _context.SyntaxTree.IsRaiseEventContext(_context.Position, _context.TargetToken, _cancellationToken) Then
VisualBasicSyntaxContext.vb (2)
331Return SyntaxTree.IsFollowingCompleteExpression( 351Return SyntaxTree.IsFollowingCompleteExpression(Of JoinClauseSyntax)(