Avoid provide hints for binding patterns (#44961)

* Avoid provide hints for binding patterns

* Rename as 56
This commit is contained in:
Wenlu Wang
2021-07-31 00:43:20 +08:00
committed by GitHub
parent 0f6e6efde0
commit 8cdcec4454
2 changed files with 45 additions and 1 deletions

View File

@@ -121,8 +121,12 @@ namespace ts.InlayHints {
}
function visitVariableLikeDeclaration(decl: VariableDeclaration | PropertyDeclaration) {
if (!decl.initializer || isBindingPattern(decl.name)) {
return;
}
const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(decl);
if (effectiveTypeAnnotation || !decl.initializer) {
if (effectiveTypeAnnotation) {
return;
}