94 references to SyntaxTree
Microsoft.CodeAnalysis.CSharp.Features (78)
Completion\KeywordRecommenders\AbstractSpecialTypePreselectingKeywordRecommender.cs (1)
43
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\AllowsKeywordRecommender.cs (1)
28
if (context.
SyntaxTree
.IsTypeParameterConstraintStartContext(context.Position, context.LeftToken))
Completion\KeywordRecommenders\AsyncKeywordRecommender.cs (3)
30
|| context.
SyntaxTree
.IsLambdaDeclarationContext(position, otherModifier: SyntaxKind.StaticKeyword, cancellationToken)
31
|| context.
SyntaxTree
.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken);
37
|| context.
SyntaxTree
.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken)
Completion\KeywordRecommenders\BoolKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ByteKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\CatchKeywordRecommender.cs (1)
13
=> context.
SyntaxTree
.IsCatchOrFinallyContext(position, context.LeftToken);
Completion\KeywordRecommenders\CharKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ClassKeywordRecommender.cs (1)
31
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ConstKeywordRecommender.cs (1)
41
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, s_validGlobalModifiers, cancellationToken) ||
Completion\KeywordRecommenders\DecimalKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\DefaultKeywordRecommender.cs (1)
20
context.
SyntaxTree
.IsTypeParameterConstraintStartContext(position, context.LeftToken);
Completion\KeywordRecommenders\DefineKeywordRecommender.cs (1)
15
context.
SyntaxTree
.IsBeforeFirstToken(position, cancellationToken);
Completion\KeywordRecommenders\DelegateKeywordRecommender.cs (2)
44
if (context.
SyntaxTree
.IsUsingStaticContext(position, cancellationToken))
60
context.
SyntaxTree
.IsExpressionContext(
Completion\KeywordRecommenders\DoubleKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\DynamicKeywordRecommender.cs (1)
37
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\EventKeywordRecommender.cs (1)
38
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (2)
47
var syntaxTree = context.
SyntaxTree
;
57
context.
SyntaxTree
.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken);
Completion\KeywordRecommenders\FinallyKeywordRecommender.cs (1)
13
=> context.
SyntaxTree
.IsCatchOrFinallyContext(position, context.LeftToken);
Completion\KeywordRecommenders\FixedKeywordRecommender.cs (1)
35
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\FloatKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\FromKeywordRecommender.cs (1)
14
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\GlobalKeywordRecommender.cs (1)
16
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\InKeywordRecommender.cs (3)
17
var syntaxTree = context.
SyntaxTree
;
31
if (context.
SyntaxTree
.IsParameterModifierContext(
41
context.
SyntaxTree
.IsPossibleExtensionMethodContext(context.LeftToken))
Completion\KeywordRecommenders\InternalKeywordRecommender.cs (1)
36
if (context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\IntKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\JoinKeywordRecommender.cs (1)
13
=> context.
SyntaxTree
.IsValidContextForJoinClause(position, context.LeftToken);
Completion\KeywordRecommenders\LoadKeywordRecommender.cs (1)
15
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\LongKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ManagedKeywordRecommender.cs (1)
13
=> context.
SyntaxTree
.IsFunctionPointerCallingConventionContext(context.TargetToken);
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (1)
17
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\NewKeywordRecommender.cs (2)
73
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
89
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)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\OutKeywordRecommender.cs (2)
14
var syntaxTree = context.
SyntaxTree
;
27
return context.
SyntaxTree
.IsParameterModifierContext(
Completion\KeywordRecommenders\ParamsKeywordRecommender.cs (1)
13
=> context.
SyntaxTree
.IsParamsModifierContext(position, context.LeftToken, cancellationToken);
Completion\KeywordRecommenders\PrivateKeywordRecommender.cs (2)
18
(context.IsGlobalStatementContext && context.
SyntaxTree
.IsScript()) ||
37
if (context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\PublicKeywordRecommender.cs (1)
23
if (context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\ReadOnlyKeywordRecommender.cs (1)
32
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\ReferenceKeywordRecommender.cs (1)
15
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\RefKeywordRecommender.cs (3)
80
var syntaxTree = context.
SyntaxTree
;
165
if (context.
SyntaxTree
.IsParameterModifierContext(
175
context.
SyntaxTree
.IsPossibleExtensionMethodContext(context.LeftToken))
Completion\KeywordRecommenders\ReturnKeywordRecommender.cs (1)
28
(context.
SyntaxTree
.IsScript() && context.IsTypeAttributeContext(cancellationToken)) ||
Completion\KeywordRecommenders\SByteKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ScopedKeywordRecommender.cs (1)
15
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ShortKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\StaticKeywordRecommender.cs (3)
84
context.
SyntaxTree
.IsLambdaDeclarationContext(position, otherModifier: SyntaxKind.AsyncKeyword, cancellationToken) ||
85
context.
SyntaxTree
.IsLocalFunctionDeclarationContext(position, s_validLocalFunctionModifiers, cancellationToken);
91
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, s_validGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\StringKeywordRecommender.cs (1)
20
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\StructKeywordRecommender.cs (1)
43
if (context.
SyntaxTree
.IsTypeParameterConstraintStartContext(context.Position, context.LeftToken))
Completion\KeywordRecommenders\ThisKeywordRecommender.cs (2)
38
if (context.
SyntaxTree
.IsParameterModifierContext(
48
context.
SyntaxTree
.IsPossibleExtensionMethodContext(context.LeftToken))
Completion\KeywordRecommenders\UIntKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\ULongKeywordRecommender.cs (1)
18
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\UndefKeywordRecommender.cs (1)
15
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\UnmanagedKeywordRecommender.cs (2)
14
return context.
SyntaxTree
.IsTypeParameterConstraintContext(position, context.LeftToken) ||
15
context.
SyntaxTree
.IsFunctionPointerCallingConventionContext(context.TargetToken);
Completion\KeywordRecommenders\UnsafeKeywordRecommender.cs (1)
66
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\UShortKeywordRecommender.cs (1)
25
var syntaxTree = context.
SyntaxTree
;
Completion\KeywordRecommenders\UsingKeywordRecommender.cs (1)
167
((CompilationUnitSyntax)context.
SyntaxTree
.GetRoot(cancellationToken)).Externs.Count > 0)
Completion\KeywordRecommenders\VoidKeywordRecommender.cs (5)
39
var syntaxTree = context.
SyntaxTree
;
53
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
54
context.
SyntaxTree
.IsLocalFunctionDeclarationContext(position, cancellationToken);
61
context.
SyntaxTree
.IsDefaultExpressionContext(context.Position, context.LeftToken);
112
=> context.
SyntaxTree
.IsGlobalMemberDeclarationContext(position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Completion\KeywordRecommenders\VolatileKeywordRecommender.cs (2)
28
(context.IsGlobalStatementContext && context.
SyntaxTree
.IsScript()) ||
29
context.
SyntaxTree
.IsGlobalMemberDeclarationContext(context.Position, SyntaxKindSet.AllGlobalMemberModifiers, cancellationToken) ||
Snippets\AbstractCSharpAutoPropertySnippetProvider.cs (1)
38
return context.SyntaxContext.
SyntaxTree
.IsMemberDeclarationContext(context.Position, (CSharpSyntaxContext)context.SyntaxContext,
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
81
_context.
SyntaxTree
.IsDefiniteCastTypeContext(_context.Position, _context.LeftToken))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\CSharpSyntaxContext.cs (10)
314
this.
SyntaxTree
.IsTypeDeclarationContext(
329
return this.
SyntaxTree
.IsTypeDeclarationContext(this.Position, this, validModifiers, validTypeDeclarations, canBePartial, cancellationToken);
340
var modifiers =
SyntaxTree
.GetPrecedingModifiers(positionBeforeRecordKeyword, cancellationToken);
362
if (
SyntaxTree
.IsMemberDeclarationContext(
408
return this.
SyntaxTree
.IsMemberDeclarationContext(this.Position, this, validModifiers, validTypeDeclarations, canBePartial, cancellationToken);
412
=> IsGlobalStatementContext &&
SyntaxTree
.Options.Kind is SourceCodeKind.Regular;
437
var leftToken = this.
SyntaxTree
.FindTokenOnLeftOfPosition(position, cancellationToken);
447
return
SyntaxTree
.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken);
449
else if (
SyntaxTree
.IsScript()
454
return
SyntaxTree
.IsGlobalStatementContext(targetToken.SpanStart, cancellationToken);
Microsoft.CodeAnalysis.Features (5)
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
266
var syntaxTree = syntaxContext.
SyntaxTree
;
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
50
var newExpression = GetObjectCreationNewExpression(context.
SyntaxTree
, position, cancellationToken);
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
107
.Any(node => !(node.SyntaxTree == context.
SyntaxTree
&& node.Span.IntersectsWith(context.Position)));
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
471
return syntaxFacts.IsInInactiveRegion(syntaxContext.
SyntaxTree
, syntaxContext.Position, cancellationToken)
Snippets\SnippetProviders\AbstractSnippetProvider.cs (1)
58
var syntaxTree = context.SyntaxContext.
SyntaxTree
;