diff --git a/src/Workspaces/CSharp/Portable/Extensions/ContextQuery/CSharpSyntaxContext.cs b/src/Workspaces/CSharp/Portable/Extensions/ContextQuery/CSharpSyntaxContext.cs index e4caf9cf608673ffb1c0bdacd3145a149957a0d5..bdaec593da3e179b1e1ee5ac9108b17d75e915dd 100644 --- a/src/Workspaces/CSharp/Portable/Extensions/ContextQuery/CSharpSyntaxContext.cs +++ b/src/Workspaces/CSharp/Portable/Extensions/ContextQuery/CSharpSyntaxContext.cs @@ -48,7 +48,6 @@ internal sealed class CSharpSyntaxContext : SyntaxContext public readonly bool IsCrefContext; public readonly bool IsCatchFilterContext; public readonly bool IsDestructorTypeContext; - public readonly bool IsAfterFirstDotOfDotDot; private CSharpSyntaxContext( Workspace workspace, @@ -100,7 +99,6 @@ internal sealed class CSharpSyntaxContext : SyntaxContext bool isDestructorTypeContext, bool isPossibleTupleContext, bool isPatternContext, - bool isAfterFirstDotOfDotDot, CancellationToken cancellationToken) : base(workspace, semanticModel, position, leftToken, targetToken, isTypeContext, isNamespaceContext, isNamespaceDeclarationNameContext, @@ -140,7 +138,6 @@ internal sealed class CSharpSyntaxContext : SyntaxContext this.IsCrefContext = isCrefContext; this.IsCatchFilterContext = isCatchFilterContext; this.IsDestructorTypeContext = isDestructorTypeContext; - this.IsAfterFirstDotOfDotDot = isAfterFirstDotOfDotDot; } public static CSharpSyntaxContext CreateContext(Workspace workspace, SemanticModel semanticModel, int position, CancellationToken cancellationToken) @@ -228,7 +225,7 @@ private static CSharpSyntaxContext CreateContextWorker(Workspace workspace, Sema isInImportsDirective: IsLeftSideOfUsingAliasDirective(leftToken, cancellationToken), isLabelContext: syntaxTree.IsLabelContext(position, cancellationToken), isTypeArgumentOfConstraintContext: syntaxTree.IsTypeArgumentOfConstraintClause(position, cancellationToken), - isRightOfDotOrArrowOrColonColon: syntaxTree.IsRightOfDotOrArrowOrColonColon(position, cancellationToken), + isRightOfDotOrArrowOrColonColon: isAfterFirstDotOfDotDot || syntaxTree.IsRightOfDotOrArrowOrColonColon(position, cancellationToken), isIsOrAsOrSwitchExpressionContext: syntaxTree.IsIsOrAsOrSwitchExpressionContext(semanticModel, position, leftToken, cancellationToken), isObjectCreationTypeContext: syntaxTree.IsObjectCreationTypeContext(position, leftToken, cancellationToken), isDefiniteCastTypeContext: syntaxTree.IsDefiniteCastTypeContext(position, leftToken, cancellationToken), @@ -251,7 +248,6 @@ private static CSharpSyntaxContext CreateContextWorker(Workspace workspace, Sema isDestructorTypeContext: isDestructorTypeContext, isPossibleTupleContext: syntaxTree.IsPossibleTupleContext(leftToken, position), isPatternContext: syntaxTree.IsPatternContext(leftToken, position), - isAfterFirstDotOfDotDot: isAfterFirstDotOfDotDot, cancellationToken: cancellationToken); } diff --git a/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs b/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs index 413ee1729658ff64cdcab5319f452cd19318d673..20eabc818263c37865e81902e8518ba2dce70fca 100644 --- a/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs +++ b/src/Workspaces/CSharp/Portable/Recommendations/CSharpRecommendationService.cs @@ -66,7 +66,6 @@ internal class CSharpRecommendationService : AbstractRecommendationService } else if (context.IsAnyExpressionContext || context.IsStatementContext || - context.IsAfterFirstDotOfDotDot || context.SyntaxTree.IsDefiniteCastTypeContext(context.Position, context.LeftToken, cancellationToken)) { // GitHub #717: With automatic brace completion active, typing '(i' produces "(i)", which gets parsed as @@ -110,6 +109,10 @@ internal class CSharpRecommendationService : AbstractRecommendationService { return GetSymbolsOffOfExpression(context, ((MemberAccessExpressionSyntax)node).Expression, cancellationToken); } + else if (node.Kind() == SyntaxKind.RangeExpression) + { + return GetSymbolsOffOfExpression(context, ((RangeExpressionSyntax)node).LeftOperand, cancellationToken); + } else if (node.Kind() == SyntaxKind.PointerMemberAccessExpression) { return GetSymbolsOffOfDereferencedExpression(context, ((MemberAccessExpressionSyntax)node).Expression, cancellationToken);