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