File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2077,7 +2077,7 @@ namespace ts.Completions {
20772077 switch ( contextToken . kind ) {
20782078 case SyntaxKind . CommaToken :
20792079 return containingNodeKind === SyntaxKind . VariableDeclaration ||
2080- containingNodeKind === SyntaxKind . VariableDeclarationList ||
2080+ isVariableDeclarationListButNotTypeArgument ( contextToken ) ||
20812081 containingNodeKind === SyntaxKind . VariableStatement ||
20822082 containingNodeKind === SyntaxKind . EnumDeclaration || // enum a { foo, |
20832083 isFunctionLikeButNotConstructor ( containingNodeKind ) ||
@@ -2209,6 +2209,11 @@ namespace ts.Completions {
22092209 return false ;
22102210 }
22112211
2212+ function isVariableDeclarationListButNotTypeArgument ( node : Node ) : boolean {
2213+ return node . parent . kind === SyntaxKind . VariableDeclarationList
2214+ && ! isPossiblyTypeArgumentPosition ( node , sourceFile , typeChecker ) ;
2215+ }
2216+
22122217 /**
22132218 * Filters out completion suggestions for named imports or exports.
22142219 *
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ ////class Foo<T1, T2> {}
4+ ////const foo = new Foo</*1*/, /*2*/,
5+ ////
6+ ////function foo<T1, T2>() {}
7+ ////const f = foo</*3*/, /*4*/,
8+
9+ verify . completions ( { marker : "1" , exact : completion . globalTypesPlus ( [ 'Foo' ] ) } ) ;
10+ verify . completions ( { marker : "2" , exact : completion . globalTypesPlus ( [ 'Foo' ] ) } ) ;
11+ verify . completions ( { marker : "3" , exact : completion . globalTypesPlus ( [ 'Foo' ] ) } ) ;
12+ verify . completions ( { marker : "4" , exact : completion . globalTypesPlus ( [ 'Foo' ] ) } ) ;
You can’t perform that action at this time.
0 commit comments