mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 06:35:35 -05:00
fix(31909): show suggestions for second type argument of generic (#36024)
This commit is contained in:
@@ -2077,7 +2077,7 @@ namespace ts.Completions {
|
||||
switch (contextToken.kind) {
|
||||
case SyntaxKind.CommaToken:
|
||||
return containingNodeKind === SyntaxKind.VariableDeclaration ||
|
||||
containingNodeKind === SyntaxKind.VariableDeclarationList ||
|
||||
isVariableDeclarationListButNotTypeArgument(contextToken) ||
|
||||
containingNodeKind === SyntaxKind.VariableStatement ||
|
||||
containingNodeKind === SyntaxKind.EnumDeclaration || // enum a { foo, |
|
||||
isFunctionLikeButNotConstructor(containingNodeKind) ||
|
||||
@@ -2209,6 +2209,11 @@ namespace ts.Completions {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isVariableDeclarationListButNotTypeArgument(node: Node): boolean {
|
||||
return node.parent.kind === SyntaxKind.VariableDeclarationList
|
||||
&& !isPossiblyTypeArgumentPosition(node, sourceFile, typeChecker);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters out completion suggestions for named imports or exports.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user