src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
86currentParent = currentParent.Parent;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (89)
134if (current is { Parent.Parent: RecordDeclarationSyntax })
144Debug.Assert(current.Parent.IsKind(SyntaxKind.VariableDeclaration));
146switch (current.Parent.Parent!.Kind())
154current = current.Parent;
159if (current.Parent is (kind: SyntaxKind.PropertyDeclaration or SyntaxKind.IndexerDeclaration))
168Debug.Assert(current.Parent.IsKind(SyntaxKind.CompilationUnit));
169declarations = new(current.Parent);
173current = current.Parent;
322node = node.Parent!;
325partnerStatement = partnerStatement.Parent;
399ParameterListSyntax parameters => parameters.Parent!,
415current = current.Parent;
432AccessorDeclarationSyntax { Parent.Parent: IndexerDeclarationSyntax { ParameterList: var list } } => list,
433ArrowExpressionClauseSyntax { Parent: { } memberDecl } => GetDeclarationParameterList(memberDecl),
444(oldBody.Parent.IsKind(SyntaxKind.LocalFunctionStatement) && newBody.Parent.IsKind(SyntaxKind.LocalFunctionStatement)))
465var parent = body.Parent!;
468return parent.IsKind(SyntaxKind.ArrowExpressionClause) && parent.Parent.IsKind(SyntaxKind.LocalFunctionStatement) ? parent.Parent : parent;
666case SyntaxKind.ParameterList when node.Parent is TypeDeclarationSyntax typeDeclaration:
702var parent = statement.Parent;
794if (oldStatement.Parent is UsingStatementSyntax oldUsing)
796return newStatement.Parent is UsingStatementSyntax newUsing &&
937=> node is CompilationUnitSyntax ? null : node.Parent!.FirstAncestorOrSelf<BaseTypeDeclarationSyntax>();
943=> declaration.Parent is TypeDeclarationSyntax { ParameterList: var parameterList } && parameterList == declaration;
1026Contract.ThrowIfNull(declaration.Parent);
1027var recordType = (INamedTypeSymbol?)model.GetDeclaredSymbol(declaration.Parent, cancellationToken);
1029return recordType.InstanceConstructors.Single(ctor => ctor.DeclaringSyntaxReferences is [var syntaxRef] && syntaxRef.GetSyntax(cancellationToken) == declaration.Parent);
1124if (oldNode is ParameterSyntax { Parent.Parent: RecordDeclarationSyntax } ||
1125newNode is ParameterSyntax { Parent.Parent: RecordDeclarationSyntax })
1321Debug.Assert(node.Parent.IsKind(SyntaxKind.AccessorList));
1323if (HasEdit(editMap, node.Parent, editKind) && !HasEdit(editMap, node.Parent.Parent, editKind))
1422Contract.ThrowIfNull(node.Parent);
1423node = node.Parent;
1449if (declaration is BaseParameterListSyntax and not { Parent: TypeDeclarationSyntax })
1451declaration = declaration.Parent;
1457=> node is TypeParameterSyntax ? node.Parent!.Parent! : node!.Parent!;
1676return TryGetDiagnosticSpanImpl(node.Parent!, editKind);
1739return TryGetDiagnosticSpanImpl(node.Parent!, editKind);
1758return TryGetDiagnosticSpanImpl(node.Parent!, editKind);
1882return TryGetDiagnosticSpanImpl(queryBody.Clauses.FirstOrDefault() ?? queryBody.Parent!, editKind);
2055return TryGetDisplayNameImpl(node.Parent!, editKind);
2086if (node.Parent!.Parent!.IsKind(SyntaxKind.PropertyDeclaration))
2092RoslynDebug.Assert(node.Parent.Parent.IsKind(SyntaxKind.IndexerDeclaration));
2098if (node.Parent!.Parent!.IsKind(SyntaxKind.PropertyDeclaration))
2104RoslynDebug.Assert(node.Parent.Parent.IsKind(SyntaxKind.IndexerDeclaration));
2113return node.Parent!.Kind() switch
2131return node.Parent is TypeDeclarationSyntax ? FeaturesResources.constructor : null;
2274RoslynDebug.Assert(((LocalDeclarationStatementSyntax)node.Parent!.Parent!).AwaitKeyword.IsKind(SyntaxKind.AwaitKeyword));
2418if (node.IsParentKind(SyntaxKind.CompilationUnit) || node.Parent.IsParentKind(SyntaxKind.CompilationUnit))
2444if (oldNode.IsParentKind(SyntaxKind.CompilationUnit) || oldNode.Parent.IsParentKind(SyntaxKind.CompilationUnit))
2467if (newNode.IsParentKind(SyntaxKind.CompilationUnit) || newNode.Parent.IsParentKind(SyntaxKind.CompilationUnit))
2602RoslynDebug.Assert(current.Parent is object);
2603RoslynDebug.Assert(current.Parent.Kind() == SyntaxKind.TryStatement);
2604current = current.Parent;
2622Debug.Assert(current.Parent != null);
2623current = current.Parent;
2707tryStatement = (TryStatementSyntax)node.Parent!;
2748RoslynDebug.Assert(node.Parent is object);
2749switch (node.Parent.Kind())
2768node = node.Parent;
2802return awaitExpression.Parent!.Parent!.Parent == containingStatementPart;
2807return awaitExpression.Parent!.Parent!.Parent!.Parent == containingStatementPart;
2875if (oldActiveStatement.Parent!.Parent!.Parent is not SwitchStatementSyntax oldSwitch)
2881var newSwitch = (SwitchStatementSyntax)newActiveStatement.Parent!.Parent!.Parent!;
2971node = node.Parent;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\CSharpTriviaFormatter.DocumentationCommentExteriorCommentRewriter.cs (1)
86currentParent = currentParent.Parent;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (1)
56? attributeNode.Parent
CodeFixes\GenerateEndConstruct\GenerateEndConstructCodeFixProvider.vb (11)
83If endStatement.Parent.Kind = SyntaxKind.PropertyBlock Then
87Function(c) GeneratePropertyEndConstructAsync(context.Document, DirectCast(endStatement.Parent, PropertyBlockSyntax), c),
94If endStatement?.Parent?.Parent.Kind = SyntaxKind.PropertyBlock Then
98Function(c) GeneratePropertyEndConstructAsync(context.Document, DirectCast(endStatement.Parent.Parent, PropertyBlockSyntax), c),
119Dim begin = GetBeginStatement(node.Parent)
216Dim nextNode = endStatement.Parent.GetLastToken().GetNextToken().Parent
221Dim updatedParent = DirectCast(endStatement.Parent, EnumBlockSyntax).WithEndEnumStatement(SyntaxFactory.EndEnumStatement())
222Dim updatedDocument = Await document.ReplaceNodeAsync(endStatement.Parent, updatedParent.WithAdditionalAnnotations(Formatter.Annotation), cancellationToken).ConfigureAwait(False)
251Dim insertionPoint = GetBeginStatement(endStatement.Parent).FullSpan.End
EditAndContinue\DeclarationBody\VisualBasicLambdaBody.vb (18)
18Debug.Assert(TypeOf node.Parent Is LambdaExpressionSyntax OrElse TypeOf node Is ExpressionSyntax)
36Return If(TypeOf _node.Parent Is LambdaExpressionSyntax, _node.Parent, _node)
45Return model.AnalyzeDataFlow(If(TryCast(_node.Parent, LambdaExpressionSyntax), _node)).CapturedInside
67If TypeOf _node.Parent Is LambdaExpressionSyntax Then
69Dim comparer = New SyntaxComparer(_node.Parent, newLambdaBody._node.Parent, _node.Parent.ChildNodes(), newLambdaBody._node.Parent.ChildNodes(), matchingLambdas:=True, compareStatementSyntax:=True)
70Return comparer.ComputeMatch(_node.Parent, newLambdaBody._node.Parent, knownMatches)
73Dim comparer = New SyntaxComparer(_node.Parent, newLambdaBody._node.Parent, {_node}, {newLambdaBody._node}, matchingLambdas:=False, compareStatementSyntax:=True)
74Return comparer.ComputeMatch(_node.Parent, newLambdaBody._node.Parent, knownMatches)
81If TypeOf _node.Parent Is LambdaExpressionSyntax Then
82Dim oldSingleLineLambda = TryCast(_node.Parent, SingleLineLambdaExpressionSyntax)
83Dim newSingleLineLambda = TryCast(newLambdaBody._node.Parent, SingleLineLambdaExpressionSyntax)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (60)
62If Not current.Parent.IsKind(SyntaxKind.PropertyBlock) Then
68If current.Parent.IsKind(SyntaxKind.FieldDeclaration) Then
81If current.Parent.Parent.IsKind(SyntaxKind.FieldDeclaration) Then
87current = current.Parent
106If declaration.Kind = SyntaxKind.ModifiedIdentifier AndAlso declaration.Parent.Kind = SyntaxKind.VariableDeclarator Then
107Dim variableDeclarator = CType(declaration.Parent, VariableDeclaratorSyntax)
157While node.Span.Length < span.Length AndAlso node.Parent.SpanStart = position
158node = node.Parent
159partnerStatement = partnerStatement?.Parent
168node = node.Parent
170partnerStatement = partnerStatement.Parent
178node.Parent.IsKind(SyntaxKind.VariableDeclarator) AndAlso
179DirectCast(node.Parent, VariableDeclaratorSyntax).Names.Count = 1 Then
180node = node.Parent
201node = node.Parent
240Return (DirectCast(declaration.Parent, PropertyBlockSyntax).PropertyStatement.ParameterList,
372Dim parent = statement.Parent
439AreEquivalentIgnoringLambdaBodies(DirectCast(oldStatement.Parent, VariableDeclaratorSyntax).AsClause,
440DirectCast(newStatement.Parent, VariableDeclaratorSyntax).AsClause)
464Return modifiedIdentifier.Parent.IsKind(SyntaxKind.VariableDeclarator) AndAlso
465DirectCast(modifiedIdentifier.Parent, VariableDeclaratorSyntax).Names.Count > 1
482Return node.Parent.FirstAncestorOrSelf(Of TypeBlockSyntax)() ' TODO: EnbumBlock?
488Debug.Assert(declaration.Parent.IsKind(SyntaxKind.VariableDeclarator) OrElse
489declaration.Parent.IsKind(SyntaxKind.Parameter))
491If Not declaration.Parent.IsKind(SyntaxKind.VariableDeclarator) Then
495Dim declarator = DirectCast(declaration.Parent, VariableDeclaratorSyntax)
658Dim ctor = TryCast(symbol.DeclaringSyntaxReferences(0).GetSyntax(cancellationToken).Parent, ConstructorBlockSyntax)
961Return If(node.IsKind(SyntaxKind.ModifiedIdentifier), node.Parent.Parent.Parent, node.Parent.Parent)
1186Return TryGetDiagnosticSpanImpl(node.Parent, editKind)
1299Return TryGetDiagnosticSpanImpl(node.Parent, editKind)
1521Return TryGetDisplayNameImpl(node.Parent, editKind)
1678Return TryGetDisplayNameImpl(node.Parent, editKind)
1835If node.Parent.IsParentKind(SyntaxKind.AttributesStatement) Then
1871If oldNode.Parent.IsParentKind(SyntaxKind.AttributesStatement) Then
1893If newNode.Parent.IsParentKind(SyntaxKind.AttributesStatement) Then
1916edit.OldNode.Parent.IsKind(SyntaxKind.VariableDeclarator) Then
1918If HasEdit(editMap, edit.OldNode.Parent.Parent, EditKind.Delete) Then
1924edit.NewNode.Parent.IsKind(SyntaxKind.VariableDeclarator) Then
1926If HasEdit(editMap, edit.NewNode.Parent.Parent, EditKind.Insert) Then
2071Debug.Assert(node.Parent.Kind = SyntaxKind.TryBlock)
2072node = node.Parent
2085Debug.Assert(node.Parent IsNot Nothing)
2086node = node.Parent
2146Return DirectCast(node.Parent, TryBlockSyntax).Span
2192Select Case node.Parent.Kind()
2207node = node.Parent
2240Return awaitExpression.Parent.Parent Is containingStatementPart
2248Return awaitExpression.Parent.Parent Is containingStatementPart
2253Return awaitExpression.Parent.Parent.Parent Is containingStatementPart
GenerateType\VisualBasicGenerateTypeService.vb (54)
57expression.Parent.IsParentKind(SyntaxKind.TypeParameterMultipleConstraintClause) Then
59Dim typeConstraint = DirectCast(expression.Parent, TypeConstraintSyntax)
60Dim constraintClause = DirectCast(typeConstraint.Parent, TypeParameterMultipleConstraintClauseSyntax)
100nameOrMemberAccessExpression = DirectCast(simpleName.Parent, ExpressionSyntax)
110If TypeOf nameOrMemberAccessExpression.Parent Is BinaryExpressionSyntax Then
147simpleName.Parent Is token.Parent Then
155If nameOrMemberAccessExpression.Parent.IsKind(SyntaxKind.InvocationExpression) Then
163Dim parent = TryCast(simpleName.Parent, QualifiedNameSyntax)
195If simpleName.Parent IsNot Nothing AndAlso TypeOf simpleName.Parent IsNot QualifiedNameSyntax Then
205If nameOrMemberAccessExpression.Parent IsNot Nothing AndAlso TypeOf nameOrMemberAccessExpression.Parent Is QualifiedNameSyntax Then
229nameOrMemberAccessExpression.Parent.IsParentKind(SyntaxKind.Parameter) AndAlso
230nameOrMemberAccessExpression.Parent.Parent.IsParentKind(SyntaxKind.ParameterList) AndAlso
231(nameOrMemberAccessExpression.Parent.Parent.Parent.IsParentKind(SyntaxKind.AddHandlerAccessorStatement) OrElse
232nameOrMemberAccessExpression.Parent.Parent.Parent.IsParentKind(SyntaxKind.RemoveHandlerAccessorStatement)) Then
246If (nameOrMemberAccessExpression.IsKind(SyntaxKind.SimpleMemberAccessExpression) OrElse (nameOrMemberAccessExpression.Parent IsNot Nothing AndAlso nameOrMemberAccessExpression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression))) _
253outerMostMemberAccessExpression = DirectCast(nameOrMemberAccessExpression.Parent, ExpressionSyntax)
265If TypeOf nameOrMemberAccessExpression.Parent Is ObjectCreationExpressionSyntax Then
266Dim objectCreationExpressionOpt = DirectCast(nameOrMemberAccessExpression.Parent, ObjectCreationExpressionSyntax)
314nameOrMemberAccessExpression.Parent.IsParentKind(SyntaxKind.VariableDeclarator) Then
315variableDeclarator = DirectCast(nameOrMemberAccessExpression.Parent.Parent, VariableDeclaratorSyntax)
337ElseIf TypeOf nameOrMemberAccessExpression.Parent Is CastExpressionSyntax Then
341Dim expressionToBeCasted = DirectCast(nameOrMemberAccessExpression.Parent, CastExpressionSyntax).Expression
433DirectCast(enclosingNamespace.Parent, NamespaceBlockSyntax).EndNamespaceStatement.GetLocation())
536If TypeOf expression.Parent Is InheritsStatementSyntax Then
537If expression.Parent.Parent IsNot Nothing AndAlso TypeOf expression.Parent.Parent Is InterfaceBlockSyntax Then
544ElseIf TypeOf expression.Parent Is ImplementsStatementSyntax Then
561node.Parent IsNot Nothing AndAlso
562TypeOf node.Parent Is TypeBlockSyntax Then
564Return IsAllContainingTypeBlocksPublic(node.Parent)
568node.Parent IsNot Nothing AndAlso TypeOf node.Parent Is TypeStatementSyntax AndAlso
569node.Parent.Parent IsNot Nothing AndAlso TypeOf node.Parent.Parent Is TypeBlockSyntax Then
570Return IsAllContainingTypeBlocksPublic(node.Parent.Parent)
574node.Parent IsNot Nothing AndAlso TypeOf node.Parent Is TypeBlockSyntax Then
579node.Parent IsNot Nothing AndAlso TypeOf node.Parent Is TypeBlockSyntax Then
583node = node.Parent
676Dim fieldInitializer = TryCast(propIdentifierName.Parent, NamedFieldInitializerSyntax)
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (7)
58Return DirectCast(declaration.Parent, DeclarationStatementSyntax)
150Dim parentExpression = If(nameNode.IsRightSideOfDot(), DirectCast(nameNode.Parent, ExpressionSyntax), nameNode)
151Dim root = If(parentExpression.IsParentKind(SyntaxKind.InvocationExpression), parentExpression.Parent, parentExpression)
179Dim parentExpression = If(nameNode.IsRightSideOfDot(), DirectCast(nameNode.Parent, ExpressionSyntax), nameNode)
181Not parentExpression.Parent.IsParentKind(SyntaxKind.ExpressionStatement) Then
190parentExpression.Parent.Parent,
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\VisualBasicGenerateConstructorService.vb (12)
52TryCast(node.Parent, MemberAccessExpressionSyntax).IsConstructorInitializer() AndAlso
53node.Parent.Parent.Kind = SyntaxKind.InvocationExpression
64Dim memberAccess = DirectCast(simpleName.Parent, MemberAccessExpressionSyntax)
65Dim invocation = DirectCast(memberAccess.Parent, InvocationExpressionSyntax)
100Dim name = If(simpleName.IsRightSideOfQualifiedName(), DirectCast(simpleName.Parent, NameSyntax), simpleName)
102If TypeOf name.Parent Is ObjectCreationExpressionSyntax Then
103Dim objectCreationExpression = DirectCast(name.Parent, ObjectCreationExpressionSyntax)
135Dim name = If(simpleName.IsRightSideOfQualifiedName(), DirectCast(simpleName.Parent, NameSyntax), simpleName)
137If TypeOf name.Parent Is AttributeSyntax Then
138Dim attribute = DirectCast(name.Parent, AttributeSyntax)
174Dim constructorStatements = constructor.DeclaringSyntaxReferences(0).GetSyntax(cancellationToken).Parent.GetStatements()
CodeGeneration\VisualBasicSyntaxGenerator.vb (31)
1826If IsChildOf(declaration.Parent, SyntaxKind.FieldDeclaration) And GetDeclarationCount(declaration.Parent.Parent) > 1 Then
1828ElseIf IsChildOf(declaration.Parent, SyntaxKind.LocalDeclarationStatement) And GetDeclarationCount(declaration.Parent.Parent) > 1 Then
1833Dim list = TryCast(declaration.Parent, AttributeListSyntax)
1894Return GetFullDeclaration(declaration.Parent)
1898Return declaration.Parent
1901If declaration.Parent IsNot Nothing Then
1902Return declaration.Parent
1906If declaration.Parent IsNot Nothing Then
1907Return declaration.Parent
1922Dim list = TryCast(declaration.Parent, AttributeListSyntax)
1928Dim stmt = TryCast(declaration.Parent, ImportsStatementSyntax)
2107Dim vd = TryCast(declaration.Parent, VariableDeclaratorSyntax)
2190Dim vd = TryCast(declaration.Parent, VariableDeclaratorSyntax)
3421Return AreSimilarExceptForSubDeclarations(decl1.Parent, decl2.Parent)
3451Return SyntaxFactory.AreEquivalent(vd1.AsClause, vd2.AsClause) AndAlso SyntaxFactory.AreEquivalent(vd2.Initializer, vd1.Initializer) AndAlso AreSimilarExceptForSubDeclarations(decl1.Parent, decl2.Parent)
3614Dim vd = TryCast(node.Parent, VariableDeclaratorSyntax)
3620If IsChildOfVariableDeclaration(node) AndAlso GetDeclarationCount(node.Parent) = 1 Then
3622Return RemoveNodeInternal(root, node.Parent, options)
3626Dim attrStmt = TryCast(attrList.Parent, AttributesStatementSyntax)
3632Dim attrList = TryCast(node.Parent, AttributeListSyntax)
3638If IsChildOf(node, SyntaxKind.ArgumentList) AndAlso IsChildOf(node.Parent, SyntaxKind.Attribute) Then
3639Dim argList = DirectCast(node.Parent, ArgumentListSyntax)
3647Dim imps = DirectCast(node.Parent, ImportsStatementSyntax)
3650Return RemoveNodeInternal(root, node.Parent, options)
3653Dim parent = node.Parent
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (33)
16expression = DirectCast(expression.Parent, ExpressionSyntax)
38(expression.IsParentKind(SyntaxKind.QualifiedName) AndAlso DirectCast(expression.Parent, QualifiedNameSyntax).Left Is expression) OrElse
39(expression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression) AndAlso DirectCast(expression.Parent, MemberAccessExpressionSyntax).Expression Is expression)
59DirectCast(expression.Parent, MemberAccessExpressionSyntax).Name Is expression
64Return TypeOf expression?.Parent Is MemberAccessExpressionSyntax AndAlso
65DirectCast(expression.Parent, MemberAccessExpressionSyntax).Name Is expression
81DirectCast(expression.Parent, QualifiedNameSyntax).Right Is expression
87DirectCast(expression.Parent, QualifiedNameSyntax).Left Is expression
156Dim unaryParent = TryCast(expression.WalkUpParentheses().Parent, UnaryExpressionSyntax)
279Dim simpleArgument = TryCast(expression?.Parent, SimpleArgumentSyntax)
290Dim argumentList = TryCast(simpleArgument.Parent, ArgumentListSyntax)
293Dim parent = argumentList.Parent
328expression = TryCast(expression.Parent, ExpressionSyntax)
337Dim assignmentStatement = DirectCast(expression.Parent, AssignmentStatementSyntax)
344expression.Parent.IsParentKind(SyntaxKind.SimpleArgument) Then
372expression = TryCast(expression.Parent, ExpressionSyntax)
380If TypeOf expression.Parent Is AssignmentStatementSyntax Then
381Dim assignmentStatement = DirectCast(expression.Parent, AssignmentStatementSyntax)
392If TypeOf expression.Parent Is MemberAccessExpressionSyntax Then
393Dim memberAccess = DirectCast(expression.Parent, MemberAccessExpressionSyntax)
498If TypeOf expression.Parent Is InvocationExpressionSyntax Then
551If TypeOf expression.Parent Is BinaryExpressionSyntax OrElse
552TypeOf expression.Parent Is AssignmentStatementSyntax OrElse
553TypeOf expression.Parent Is WhileOrUntilClauseSyntax OrElse
554TypeOf expression.Parent Is SingleLineLambdaExpressionSyntax OrElse
555TypeOf expression.Parent Is AwaitExpressionSyntax Then
572If TypeOf expression.Parent Is ExpressionRangeVariableSyntax AndAlso
573TypeOf expression.Parent.Parent Is QueryClauseSyntax Then
574Dim rangeVariable = DirectCast(expression.Parent, ExpressionRangeVariableSyntax)
575Dim selectClause = TryCast(rangeVariable.Parent, SelectClauseSyntax)
584Dim queryExpression = TryCast(selectClause.Parent, QueryExpressionSyntax)
589Dim aggregateClause = TryCast(selectClause.Parent, AggregateClauseSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (24)
19node.Parent.IsKind(kind)
25IsKind(node.Parent, kind1, kind2)
31IsKind(node.Parent, kind1, kind2, kind3)
681singleLineIf = DirectCast(executableBlock.Parent, SingleLineIfStatementSyntax)
730current = singleLineIf.Parent
788DirectCast(node.Parent, AssignmentStatementSyntax).Left Is node
794node.Parent.IsAnyAssignmentStatement() AndAlso
795DirectCast(node.Parent, AssignmentStatementSyntax).Left Is node
807node.Parent.IsCompoundAssignmentStatement() AndAlso
808DirectCast(node.Parent, AssignmentStatementSyntax).Left Is node
986node = DirectCast(node.Parent, ExpressionSyntax)
995TypeOf node.Parent IsNot ConditionalAccessExpressionSyntax
997node = TryCast(node.Parent, ExpressionSyntax)
1027If TypeOf node?.Parent Is ConditionalAccessExpressionSyntax AndAlso
1028DirectCast(node.Parent, ConditionalAccessExpressionSyntax).Expression Is node Then
1030node = DirectCast(node.Parent, ExpressionSyntax)
1033If TypeOf node?.Parent Is ConditionalAccessExpressionSyntax AndAlso
1034DirectCast(node.Parent, ConditionalAccessExpressionSyntax).WhenNotNull Is node Then
1036node = DirectCast(node.Parent, ExpressionSyntax)
1053While TypeOf node?.Parent Is ConditionalAccessExpressionSyntax
1054Dim conditionalParent = DirectCast(node.Parent, ConditionalAccessExpressionSyntax)
1098current = current.Parent
1221Dim parent As SyntaxNode = node.Parent
1262Dim parent As SyntaxNode = node.Parent
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (26)
57Dim parent = node.Parent
158Function(nameColonEquals As NameColonEqualsSyntax) InferTypeInArgumentList(TryCast(nameColonEquals.Parent.Parent, ArgumentListSyntax), DirectCast(nameColonEquals.Parent, ArgumentSyntax)),
177Return If(parameterList.Parent IsNot Nothing,
178InferTypeInLambda(TryCast(parameterList.Parent.Parent, LambdaExpressionSyntax)),
184If TypeOf argument.Parent Is ArgumentListSyntax Then
186DirectCast(argument.Parent, ArgumentListSyntax), argument, previousToken)
189If TypeOf argument.Parent Is TupleExpressionSyntax Then
191DirectCast(argument.Parent, TupleExpressionSyntax),
231If argumentList.Parent IsNot Nothing Then
236Dim invocation = TryCast(argumentList.Parent, InvocationExpressionSyntax)
274ElseIf invocation.Parent.IsKind(SyntaxKind.ConditionalAccessExpression) Then
275targetExpression = DirectCast(invocation.Parent, ConditionalAccessExpressionSyntax).Expression
291Dim creation = TryCast(argumentList.Parent, ObjectCreationExpressionSyntax)
316Dim attribute = TryCast(argumentList.Parent, AttributeSyntax)
602Dim variableDeclarator = DirectCast(equalsValue.Parent, VariableDeclaratorSyntax)
626Dim propertySyntax = CType(equalsValue.Parent, PropertyStatementSyntax)
798If TypeOf switchStatementSyntax.Parent Is SelectBlockSyntax Then
799Dim firstCase = DirectCast(switchStatementSyntax.Parent, SelectBlockSyntax).CaseBlocks.SelectMany(Function(c) c.CaseStatement.Cases).OfType(Of SimpleCaseClauseSyntax).FirstOrDefault()
912memberAccessExpression.Parent.IsParentKind(SyntaxKind.AwaitExpression) Then
913Return InferTypes(DirectCast(memberAccessExpression.Parent, ExpressionSyntax))
932Dim invocation = DirectCast(memberAccessExpression.Parent, InvocationExpressionSyntax)
1064Dim objectInitializer = TryCast(collectionInitializer.Parent, ObjectCollectionInitializerSyntax)
1065Dim objectCreation = TryCast(objectInitializer?.Parent, ObjectCreationExpressionSyntax)