Skip to content

Commit

Permalink
Merge pull request #30384 from Microsoft/completionsInTypeParameter
Browse files Browse the repository at this point in the history
Add extends of type parameter as type only location for completions
  • Loading branch information
sheetalkamat committed Mar 14, 2019
2 parents 3426167 + 526eda8 commit 2961bc3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,9 @@ namespace ts.Completions {

case SyntaxKind.AsKeyword:
return parentKind === SyntaxKind.AsExpression;

case SyntaxKind.ExtendsKeyword:
return parentKind === SyntaxKind.TypeParameter;
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] });

0 comments on commit 2961bc3

Please sign in to comment.