1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // @Filename : foo.tsx
4
+ //// declare namespace JSX {
5
+ //// interface Element { }
6
+ //// interface IntrinsicElements {
7
+ //// foo: {
8
+ //// prop_a: boolean;
9
+ //// prop_b: string;
10
+ //// prop_c: any;
11
+ //// prop_d: { p1: string; }
12
+ //// prop_e: string | undefined;
13
+ //// prop_f: boolean | undefined;
14
+ //// prop_g: { p1: string; } | undefined;
15
+ //// prop_h?: string;
16
+ //// prop_i?: boolean;
17
+ //// prop_j?: { p1: string; };
18
+ //// }
19
+ //// }
20
+ //// }
21
+ ////
22
+ //// <foo [|prop_/**/|] />
23
+
24
+ verify . completions ( {
25
+ marker : "" ,
26
+ exact : [
27
+ {
28
+ name : "prop_a" ,
29
+ insertText : "prop_a={$1}" ,
30
+ replacementSpan : test . ranges ( ) [ 0 ] ,
31
+ isSnippet : true ,
32
+ } ,
33
+ {
34
+ name : "prop_b" ,
35
+ insertText : "prop_b={$1}" ,
36
+ replacementSpan : test . ranges ( ) [ 0 ] ,
37
+ isSnippet : true ,
38
+ } ,
39
+ {
40
+ name : "prop_c" ,
41
+ insertText : "prop_c={$1}" ,
42
+ replacementSpan : test . ranges ( ) [ 0 ] ,
43
+ isSnippet : true ,
44
+ } ,
45
+ {
46
+ name : "prop_d" ,
47
+ insertText : "prop_d={$1}" ,
48
+ replacementSpan : test . ranges ( ) [ 0 ] ,
49
+ isSnippet : true ,
50
+ } ,
51
+ {
52
+ name : "prop_e" ,
53
+ insertText : "prop_e={$1}" ,
54
+ replacementSpan : test . ranges ( ) [ 0 ] ,
55
+ isSnippet : true ,
56
+ } ,
57
+ {
58
+ name : "prop_f" ,
59
+ insertText : "prop_f={$1}" ,
60
+ replacementSpan : test . ranges ( ) [ 0 ] ,
61
+ isSnippet : true ,
62
+ } ,
63
+ {
64
+ name : "prop_g" ,
65
+ insertText : "prop_g={$1}" ,
66
+ replacementSpan : test . ranges ( ) [ 0 ] ,
67
+ isSnippet : true ,
68
+ } ,
69
+ {
70
+ name : "prop_h" ,
71
+ insertText : "prop_h={$1}" ,
72
+ replacementSpan : test . ranges ( ) [ 0 ] ,
73
+ isSnippet : true ,
74
+ sortText : completion . SortText . OptionalMember ,
75
+ } ,
76
+ {
77
+ name : "prop_i" ,
78
+ insertText : "prop_i={$1}" ,
79
+ replacementSpan : test . ranges ( ) [ 0 ] ,
80
+ isSnippet : true ,
81
+ sortText : completion . SortText . OptionalMember ,
82
+ } ,
83
+ {
84
+ name : "prop_j" ,
85
+ insertText : "prop_j={$1}" ,
86
+ replacementSpan : test . ranges ( ) [ 0 ] ,
87
+ isSnippet : true ,
88
+ sortText : completion . SortText . OptionalMember ,
89
+ }
90
+ ] ,
91
+ preferences : {
92
+ jsxSnippetCompletion : "braces"
93
+ }
94
+ } ) ;
0 commit comments