Skip to content

Commit 2961bc3

Browse files
authored
Merge pull request #30384 from Microsoft/completionsInTypeParameter
Add extends of type parameter as type only location for completions
2 parents 3426167 + 526eda8 commit 2961bc3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/services/completions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,9 @@ namespace ts.Completions {
11291129

11301130
case SyntaxKind.AsKeyword:
11311131
return parentKind === SyntaxKind.AsExpression;
1132+
1133+
case SyntaxKind.ExtendsKeyword:
1134+
return parentKind === SyntaxKind.TypeParameter;
11321135
}
11331136
}
11341137
return false;

tests/cases/fourslash/completionListInTypeParameterOfClassExpression1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
////var C4 = class D<T extends /*4*/>{}
88

99
verify.completions({ marker: ["0", "1", "2", "3"], exact: undefined });
10-
verify.completions({ marker: "4", exact: ["D", ...completion.globalsPlus(["C0", "C1", "C2", "C3", "C4"])] });
10+
verify.completions({ marker: "4", exact: ["D", "T", ...completion.globalTypes] });

0 commit comments

Comments
 (0)