5
5
//// * /**/
6
6
//// */
7
7
8
+ // cannot run fourslash test these cases because it doesn't recognize the marker
9
+ //** /*invalidMarker1*/*/
10
+ //
11
+ //** /*invalidMarker2*/*/
12
+ //
8
13
9
- // jsdoc tags are listed when there is more than one whitespace after "*"
14
+ // 1x - jsdoc tags are listed when there is more than one whitespace after "*"
10
15
/////**
11
- //// * /*1 */
16
+ //// * /*10 */
12
17
//// */
13
18
////
14
19
/////**
15
- //// * link to {/*2 */
20
+ //// * /*11 */
16
21
//// */
17
22
////
18
23
19
- // before the fix, jsdoc tag names was listed (but no longer appears
20
- // jsdoc tag names are still listed after the fix.
21
- // however this behavior does not by getCompletionData.insideComment.hasDocComment clause
22
- /////**@/*3*/ */
24
+ // 2x - also, if there is more than one whitespace at the beginning of the line.
25
+ /////**
26
+ //// /*20*/
27
+ //// */
23
28
////
24
29
/////**
25
- //// * @type {@/*4 */
30
+ //// /*21 */
26
31
//// */
27
32
////
28
33
/////**
29
- //// *@/*5 */
34
+ //// /*22 */
30
35
//// */
31
36
////
32
37
33
- // before the fix, jsdoc tags was listed but no longer appears
38
+ // 3x - jsdoc tag names will be listed
39
+ /////** @/*30*/ */
40
+ ////
41
+ /////** @/*31*/ */
42
+ ////
34
43
/////**
35
- //// +/*6 */
44
+ //// * @/*32 */
36
45
//// */
37
46
////
38
47
/////**
39
- //// */*7*/
48
+ //// * @/*33*/
49
+ //// */
50
+ ////
51
+ /////**
52
+ //// @/*34*/
53
+ //// */
54
+ ////
55
+ /////**
56
+ //// @/*35*/
57
+ //// */
58
+ ////
59
+ /////**
60
+ //// * @pa /*36*/
40
61
//// */
41
62
////
42
63
43
- // jsdoc tag names will be listed
64
+ // 4x - jsdoc tag name completions should not occur
65
+ /////**@/*40*/ */
66
+ ////
67
+ /////**
68
+ //// *@/*41*/
69
+ //// */
70
+ ////
44
71
/////**
45
- //// * @/*8*/
72
+ //// * @type {@/*42*/
73
+ //// */
74
+ ////
75
+ /////**
76
+ //// +@/*43*/
77
+ //// */
78
+ ////
79
+ /////** some description @/*44*/ */
80
+ ////
81
+ /////**
82
+ //// * ### jsdoc @/*45*/
83
+ //// */
84
+ ////
85
+
86
+ // 5x - jsdoc tag completions should not occur
87
+ /////**
88
+ //// */*50*/
46
89
//// */
47
90
////
48
91
49
- // before the fix, jsdoc tag names was listed but no longer appears
92
+ // also, can support the inline jsdoc tags
50
93
/////**
51
- //// +@/*9 */
94
+ //// * link to {/*70 */
52
95
//// */
53
96
////
54
97
/////**
55
- //// * ### jsdoc @/*10 */
98
+ //// * link to { @/*71 */
56
99
//// */
57
100
////
58
101
@@ -64,39 +107,115 @@ verify.completions({ marker: "", includes: { name: "@property", text: "@property
64
107
//
65
108
test . markerNames ( ) . forEach ( marker => {
66
109
if ( marker ) {
110
+ let completionOpt : FourSlashInterface . CompletionsOptions ;
67
111
const n = + marker ;
68
112
switch ( n ) {
69
- case 1 :
70
- // case 2:
71
- verify . completions ( { marker, includes : [ "@abstract" , "@access" ] } ) ;
113
+ /* https://coderwall.com/p/zbc2zw/the-comment-toggle-trick
114
+
115
+ // - - - - - -
116
+ // before fix
117
+ // - - - - - -
118
+
119
+ // jsdoc tags will be listed when there is more than one whitespace after "*"
120
+ case 10: case 11:
121
+ // also, if there is more than one whitespace at the beginning of the line.
122
+ case 20: case 21: case 22:
123
+
124
+ // 5x - jsdoc tag completions should not occur
125
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
126
+ // jsdoc tags will be listed but this does not the expected behavior
127
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
128
+ case 50:
129
+ completionOpt = { marker, includes: ["@abstract", "@access"] };
72
130
break;
73
- case 3 :
74
- // case 4:
75
- case 5 :
76
- verify . completions ( {
131
+
132
+ // 3x - jsdoc tag names will be listed
133
+ case 30: case 31: case 32: case 33: case 34: case 35: case 36:
134
+
135
+ // 4x - jsdoc tag name completions should not occur
136
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
137
+ // jsdoc tag names will be listed but this does not the expected behavior
138
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
139
+ case 40: case 41: case 42: case 43: case 44: case 45:
140
+
141
+ // does not the expected behavior... because ts.JsDoc@jsDocTagNames is missing inline jsdoc tag name
142
+ // In other words, inline jsdoc tag is interpreted as not intending to support
143
+ case 71:
144
+ completionOpt = {
77
145
marker,
78
146
triggerCharacter: "@",
79
- includes : [ "abstract " , "access " ]
80
- } ) ;
147
+ includes: ["package ", "param "]
148
+ };
81
149
break;
82
- case 6 : case 7 :
83
- verify . completions ( { marker, exact : [ ] } ) ;
150
+ /*/
151
+
152
+ // - - - - - -
153
+ // after fix
154
+ // - - - - - -
155
+
156
+ // jsdoc tags will be listed when there is more than one whitespace after "*"
157
+ case 10 : case 11 :
158
+ // also, if there is more than one whitespace at the beginning of the line.
159
+ case 20 : case 21 : case 22 :
160
+
161
+ // // also, can support the inline jsdoc tags
162
+ // case 70:
163
+ completionOpt = { marker, includes : [
164
+ "@abstract" , "@access" ,
165
+ // "@link"
166
+ ] } ;
84
167
break ;
85
- case 8 :
86
- verify . completions ( {
168
+
169
+ // 3x - jsdoc tag names will be listed
170
+ case 30 : case 31 : case 32 : case 33 : case 34 : case 35 :
171
+
172
+ // 4x - jsdoc tag name completions should not occur
173
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
174
+ // this behavior does not by getCompletionData.insideComment.hasDocComment clause
175
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
176
+ case 40 : case 41 : case 42 :
177
+
178
+ // // also, can support the inline jsdoc tags
179
+ // case 71:
180
+ completionOpt = {
87
181
marker,
88
182
triggerCharacter : "@" ,
89
183
includes : [ "abstract" , "access" ]
90
- } ) ;
184
+ } ;
91
185
break ;
92
- case 9 : case 10 :
93
- verify . completions ( {
186
+
187
+ // 4x - jsdoc tag name completions should not occur
188
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
189
+ // before the fix, jsdoc tag names was listed but no longer appears
190
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
191
+ case 43 : case 44 : case 45 :
192
+ completionOpt = {
94
193
marker,
95
194
triggerCharacter : "@" ,
96
195
exact : [ ]
97
- } ) ;
196
+ } ;
197
+ break ;
198
+
199
+ // 5x - jsdoc tag completions should not occur
200
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
201
+ // before the fix, jsdoc tags was listed but no longer appears
202
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
203
+ case 50 :
204
+ completionOpt = { marker, exact : [ ] } ;
98
205
break ;
99
- default : break ;
206
+ //*/
207
+
208
+ default :
209
+ break ;
210
+ }
211
+ if ( completionOpt ) {
212
+ // verify.completions(completionOpt);
213
+ try {
214
+ verify . completions ( completionOpt ) ;
215
+ } catch ( e ) {
216
+ console . log ( e . message ) ;
217
+ console . log ( "please switch the code of src/services/completions.ts#getCompletionData" ) ;
218
+ }
100
219
}
101
220
}
102
221
} ) ;
0 commit comments