@@ -47,19 +47,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
4747
4848 Protected Overrides Function GetTypeSymbolOfExpression(semanticModel As SemanticModel, potentialAwaitableExpression As SyntaxNode, cancellationToken As CancellationToken) As ITypeSymbol
4949 Dim memberAccessExpression = TryCast (potentialAwaitableExpression, MemberAccessExpressionSyntax)?.Expression
50- If memberAccessExpression IsNot Nothing Then
51- Dim symbolInfo = semanticModel.GetSymbolInfo(memberAccessExpression.WalkDownParentheses(), cancellationToken)
52- Dim symbol = symbolInfo.Symbol
53- If TypeOf symbol Is ITypeSymbol Then ' e.g. Task.$$
54- Return Nothing
55- End If
56-
57- Return If (symbol?.GetSymbolType(),
58- If (symbol?.GetMemberType(),
59- semanticModel.GetTypeInfo(memberAccessExpression, cancellationToken).Type))
50+ If memberAccessExpression Is Nothing Then
51+ Return Nothing
6052 End If
6153
62- Return Nothing
54+ Dim symbol = semanticModel.GetSymbolInfo(memberAccessExpression.WalkDownParentheses(), cancellationToken).Symbol
55+ Return If ( TypeOf symbol Is ITypeSymbol, Nothing , semanticModel.GetTypeInfo(memberAccessExpression, cancellationToken).Type)
6356 End Function
6457
6558 Protected Overrides Function GetExpressionToPlaceAwaitInFrontOf(syntaxTree As SyntaxTree, position As Integer , cancellationToken As CancellationToken) As SyntaxNode
@@ -69,13 +62,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
6962 End If
7063
7164 Dim memberAccess = TryCast (dotToken.Value.Parent, MemberAccessExpressionSyntax)
72- If memberAccess IsNot Nothing Then
73- If memberAccess.Expression.GetParentConditionalAccessExpression() Is Nothing Then
74- Return memberAccess
75- End If
65+ If memberAccess Is Nothing Then
66+ Return Nothing
67+ End If
68+
69+ If memberAccess.Expression.GetParentConditionalAccessExpression() IsNot Nothing Then
70+ Return Nothing
7671 End If
7772
78- Return Nothing
73+ Return memberAccess
7974 End Function
8075
8176 Protected Overrides Function GetDotTokenLeftOfPosition(syntaxTree As SyntaxTree, position As Integer , cancellationToken As CancellationToken) As SyntaxToken?
0 commit comments