@@ -2985,8 +2985,8 @@ namespace ts {
2985
2985
}
2986
2986
2987
2987
function tryGetGlobalSymbols ( ) : boolean {
2988
- let containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion ( contextToken ) ;
2989
- if ( containingObjectLiteral ) {
2988
+ let containingObjectLiteral = < ObjectLiteralExpression > getContainingObjectLiteralOrBindingPatternIfApplicableForCompletion ( contextToken ) ;
2989
+ if ( containingObjectLiteral && containingObjectLiteral . kind === SyntaxKind . ObjectLiteralExpression ) {
2990
2990
// Object literal expression, look up possible property names from contextual type
2991
2991
isMemberCompletion = true ;
2992
2992
isNewIdentifierLocation = true ;
@@ -3187,16 +3187,16 @@ namespace ts {
3187
3187
return false ;
3188
3188
}
3189
3189
3190
- function getContainingObjectLiteralApplicableForCompletion ( contextToken : Node ) : ObjectLiteralExpression {
3190
+ function getContainingObjectLiteralOrBindingPatternIfApplicableForCompletion ( contextToken : Node ) : ObjectLiteralExpression | BindingPattern {
3191
3191
// The locations in an object literal expression that
3192
3192
// are applicable for completion are property name definition locations.
3193
3193
if ( contextToken ) {
3194
3194
switch ( contextToken . kind ) {
3195
3195
case SyntaxKind . OpenBraceToken : // let x = { |
3196
3196
case SyntaxKind . CommaToken : // let x = { a: 0, |
3197
3197
let parent = contextToken . parent ;
3198
- if ( parent && parent . kind === SyntaxKind . ObjectLiteralExpression ) {
3199
- return < ObjectLiteralExpression > parent ;
3198
+ if ( parent && ( parent . kind === SyntaxKind . ObjectLiteralExpression || parent . kind === SyntaxKind . ObjectBindingPattern ) ) {
3199
+ return < ObjectLiteralExpression | BindingPattern > parent ;
3200
3200
}
3201
3201
break ;
3202
3202
}
0 commit comments