File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -1532,6 +1532,7 @@ namespace ts.Completions {
1532
1532
if ( contextToken ) {
1533
1533
const parent = contextToken . parent ;
1534
1534
switch ( contextToken . kind ) {
1535
+ case SyntaxKind . GreaterThanToken : // End of a type argument list
1535
1536
case SyntaxKind . LessThanSlashToken :
1536
1537
case SyntaxKind . SlashToken :
1537
1538
case SyntaxKind . Identifier :
@@ -1540,6 +1541,10 @@ namespace ts.Completions {
1540
1541
case SyntaxKind . JsxAttribute :
1541
1542
case SyntaxKind . JsxSpreadAttribute :
1542
1543
if ( parent && ( parent . kind === SyntaxKind . JsxSelfClosingElement || parent . kind === SyntaxKind . JsxOpeningElement ) ) {
1544
+ if ( contextToken . kind === SyntaxKind . GreaterThanToken ) {
1545
+ const precedingToken = findPrecedingToken ( contextToken . pos , sourceFile , /*startNode*/ undefined ) ;
1546
+ if ( ! ( parent as JsxOpeningLikeElement ) . typeArguments || ( precedingToken && precedingToken . kind === SyntaxKind . SlashToken ) ) break ;
1547
+ }
1543
1548
return < JsxOpeningLikeElement > parent ;
1544
1549
}
1545
1550
else if ( parent . kind === SyntaxKind . JsxAttribute ) {
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // @jsx : preserve
4
+ // @skipLibCheck : true
5
+ // @Filename : file.tsx
6
+ //// declare module JSX {
7
+ //// interface Element { }
8
+ //// interface IntrinsicElements {
9
+ //// }
10
+ //// interface ElementAttributesProperty { props; }
11
+ //// }
12
+ ////
13
+ ////class Table<P> {
14
+ //// constructor(public props: P) {}
15
+ //// }
16
+ ////
17
+ ////type Props = { widthInCol: number; text: string; };
18
+ ////
19
+ /////**
20
+ //// * @param width {number} Table width in px
21
+ //// */
22
+ ////function createTable(width) {
23
+ //// return <Table<Props> /*1*/ />
24
+ //// }
25
+ ////
26
+ ////createTable(800);
27
+
28
+ verify . completions ( {
29
+ marker : "1" ,
30
+ includes : [ "widthInCol" , "text" ]
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments