Merge pull request #30384 from Microsoft/completionsInTypeParameter

Add extends of type parameter as type only location for completions
This commit is contained in:
Sheetal Nandi 2019-03-13 18:07:31 -07:00 committed by GitHub
commit 2961bc3fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -1129,6 +1129,9 @@ namespace ts.Completions {
case SyntaxKind.AsKeyword:
return parentKind === SyntaxKind.AsExpression;
case SyntaxKind.ExtendsKeyword:
return parentKind === SyntaxKind.TypeParameter;
}
}
return false;

View File

@ -7,4 +7,4 @@
////var C4 = class D<T extends /*4*/>{}
verify.completions({ marker: ["0", "1", "2", "3"], exact: undefined });
verify.completions({ marker: "4", exact: ["D", ...completion.globalsPlus(["C0", "C1", "C2", "C3", "C4"])] });
verify.completions({ marker: "4", exact: ["D", "T", ...completion.globalTypes] });