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 {
2077
2077
switch ( contextToken . kind ) {
2078
2078
case SyntaxKind . CommaToken :
2079
2079
return containingNodeKind === SyntaxKind . VariableDeclaration ||
2080
- containingNodeKind === SyntaxKind . VariableDeclarationList ||
2080
+ isVariableDeclarationListButNotTypeArgument ( contextToken ) ||
2081
2081
containingNodeKind === SyntaxKind . VariableStatement ||
2082
2082
containingNodeKind === SyntaxKind . EnumDeclaration || // enum a { foo, |
2083
2083
isFunctionLikeButNotConstructor ( containingNodeKind ) ||
@@ -2209,6 +2209,11 @@ namespace ts.Completions {
2209
2209
return false ;
2210
2210
}
2211
2211
2212
+ function isVariableDeclarationListButNotTypeArgument ( node : Node ) : boolean {
2213
+ return node . parent . kind === SyntaxKind . VariableDeclarationList
2214
+ && ! isPossiblyTypeArgumentPosition ( node , sourceFile , typeChecker ) ;
2215
+ }
2216
+
2212
2217
/**
2213
2218
* Filters out completion suggestions for named imports or exports.
2214
2219
*
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