mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
fix(47081): show completion list in parenthesized object literal arguments (#47104)
This commit is contained in:
@@ -3913,9 +3913,14 @@ namespace ts.Completions {
|
||||
if (type) {
|
||||
return type;
|
||||
}
|
||||
if (isBinaryExpression(node.parent) && node.parent.operatorToken.kind === SyntaxKind.EqualsToken && node === node.parent.left) {
|
||||
const parent = walkUpParenthesizedExpressions(node.parent);
|
||||
if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.EqualsToken && node === parent.left) {
|
||||
// Object literal is assignment pattern: ({ | } = x)
|
||||
return typeChecker.getTypeAtLocation(node.parent);
|
||||
return typeChecker.getTypeAtLocation(parent);
|
||||
}
|
||||
if (isExpression(parent)) {
|
||||
// f(() => (({ | })));
|
||||
return typeChecker.getContextualType(parent);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user