ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / api / test / browser / extHostDiagnostics.test.ts 640 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
import assert from 'assert' ;
import { URI , UriComponents } from '../../../../base/common/uri.js' ;
import { DiagnosticCollection, ExtHostDiagnostics } from '../../common/extHostDiagnostics.js' ;
import { Diagnostic, DiagnosticSeverity, Range, DiagnosticRelatedInformation, Location } from '../../common/extHostTypes.js' ;
import { MainThreadDiagnosticsShape, IMainContext } from '../../common/extHost.protocol.js' ;
import { IMarkerData, MarkerSeverity } from '../../../../platform/markers/common/markers.js' ;
import mock
Emitter Event
NullLogService
vscode
nullExtensionDescription
ExtUri extUri
IExtHostFileSystemInfo
runWithFakedTimers
IExtHostDocumentsAndEditors
ensureNoDisposablesAreLeakedInTestSuite
override owner entries UriComponents IMarkerData
override owner
fileSystemInfoService
override extUri extUri
versionProvider uri
store
collection versionProvider extUri
collection
collection
assert collection name
assert collection
assert collection
assert collection
assert collection
assert collection
assert collection
assert collection
collection versionProvider extUri
assert collection name
collection
assert collection name
c
collection versionProvider extUri
collection c
assert c
collection
collection c
assert c
c
collection
collection c
assert c
collection
collection
collection c
assert c
assert collection
assert collection
assert collection
collection
assert collection
collection
collection versionProvider extUri
collection
array collection Diagnostic
assert array length
assert array
assert array
collection uri array vscode Diagnostic
assert array Diagnostic length
assert array Diagnostic
assert array Diagnostic
array collection Diagnostic
assert array length
collection
collection versionProvider extUri
uri
collection
uri
uri
array collection uri
assert array length
first second array
assert first message
assert second message
collection uri
assert collection uri
collection
uri
uri
assert collection uri
collection uri
assert collection uri
collection
uri
uri
uri
uri
array collection uri
assert array length
first second array
assert first message
assert second message
collection
lastEntries UriComponents IMarkerData
collection versionProvider extUri
override owner entries UriComponents IMarkerData
lastEntries entries
owner entries
uri
collection uri
assert collection uri length
assert collection uri message
assert lastEntries length
data1 lastEntries
assert data1 length
assert data1 message
lastEntries
collection uri
assert collection uri length
assert collection uri message
assert lastEntries length
data2 lastEntries
assert data2 length
assert data2 message
lastEntries
changeCount
eventCount
emitter
store emitter _ eventCount
collection versionProvider extUri
override
changeCount
emitter
uri
diag
collection uri diag
assert changeCount
assert eventCount
collection uri diag
assert changeCount
assert eventCount
collection versionProvider extUri
uri
uri2
diag
collection
uri diag diag diag
uri
uri diag
uri2 diag diag
uri2
uri2 diag
assert collection uri length
assert collection uri2 length
collection versionProvider extUri
tuples Diagnostic
i i i
uri i
diag i
tuples uri diag diag diag
tuples uri
tuples uri diag
collection tuples
i i i
uri i
assert collection uri
assert collection uri length
lastEntries UriComponents IMarkerData
collection versionProvider extUri
override owner entries UriComponents IMarkerData
lastEntries entries
owner entries
uri
diagnostics Diagnostic
i i i
diagnostics i i i
DiagnosticSeverity Warning
DiagnosticSeverity Error
collection uri diagnostics
assert collection uri length
assert lastEntries length
assert lastEntries length
assert lastEntries severity MarkerSeverity Error
assert lastEntries severity MarkerSeverity Warning
assert lastEntries severity MarkerSeverity Info
lastEntries UriComponents IMarkerData
collection versionProvider extUri
override owner entries UriComponents IMarkerData
lastEntries entries
owner entries
diag
collection
diag
diag
diag
diag
assert lastEntries length
emitter
collection versionProvider extUri emitter
diag1
diag2
diag3
p Event emitter event a
assert a length
assert a
assert a
collection
p
p Event emitter event e
assert e length
assert e
assert e
assert e
assert e
collection
diag1
diag2 diag3
p
p Event emitter event e
assert e length
assert e
assert e
collection
p
emitter
collection versionProvider extUri emitter
diag1
collection diag1
p Event emitter event e
assert e
collection
p
collection diag1
p Event emitter event e
assert e
collection
p
done
collection versionProvider extUri
override owner entries UriComponents IMarkerData
data entries
assert entries length
assert data length
diag data
assert diag relatedInformation length
assert diag relatedInformation message
assert diag relatedInformation message
diag
diag relatedInformation
collection diag
ownerHistory
diags
id
DiagnosticsShape
owner
ownerHistory owner
fileSystemInfoService
override
collection1 diags nullExtensionDescription identifier
collection2 diags nullExtensionDescription identifier
collection1
collection2
assert ownerHistory length
assert ownerHistory
assert ownerHistory
callCount
collection versionProvider extUri
override owner entries UriComponents IMarkerData
callCount
array Diagnostic
diag1
diag2
array diag1 diag2
collection array
assert callCount
collection array
assert callCount
array diag2
collection array
assert callCount
diags
fileSystemInfoService
override
collection diags nullExtensionDescription identifier
uri
diag
sparseDiagnostics Diagnostic
sparseDiagnostics diag
collection uri sparseDiagnostics
result diags uri
assert result length
resultWithPossibleHoles result vscode Diagnostic
assert resultWithPossibleHoles item item
all UriComponents IMarkerData
collection uri
extUri
override _owner entries UriComponents IMarkerData
all entries
array Diagnostic
diag1
diag2
array diag1 diag2
collection array
collection diag1
collection diag2
allVersions all tuple tuple t t modelVersionId
assert allVersions
diags
id
fileSystemInfoService
override
uri
data IMarkerData
message
startLineNumber
startColumn
endLineNumber
endColumn
severity MarkerSeverity Info
p1 Event diags onDidChangeDiagnostics
diags uri data
p1
assert diags uri length
p2 Event diags onDidChangeDiagnostics
diags uri
p2
assert diags uri length
diags
id
override extUri uri uri scheme
override
col diags nullExtensionDescription identifier
uriSensitive scheme path
uriSensitiveCaseB uriSensitive path uriSensitive path
uriInSensitive scheme path
uriInSensitiveUpper uriInSensitive path uriInSensitive path
col uriSensitive
col uriInSensitive
assert col uriSensitive length
assert col uriSensitiveCaseB length
assert col uriInSensitive length
assert col uriInSensitiveUpper length
assert diags uriSensitive length
assert diags uriSensitiveCaseB length
assert diags uriInSensitive length
assert diags uriInSensitiveUpper length
fromForEach
col uri fromForEach uri
assert fromForEach length
assert fromForEach uriSensitive
assert fromForEach uriInSensitive
{
}
from
'../../../../base/test/common/mock.js'
;
import
{
,
}
from
'../../../../base/common/event.js'
;
import
{
}
from
'../../../../platform/log/common/log.js'
;
import
type
*
as
from
'vscode'
;
import
{
}
from
'../../../services/extensions/common/extensions.js'
;
import
{
,
}
from
'../../../../base/common/resources.js'
;
import
{
}
from
'../../common/extHostFileSystemInfo.js'
;
import
{
}
from
'../../../../base/test/common/timeTravelScheduler.js'
;
import
{
}
from
'../../common/extHostDocumentsAndEditors.js'
;
import
{
}
from
'../../../../base/test/common/utils.js'
;
suite
(
'ExtHostDiagnostics'
,
(
)
=>
{
class
DiagnosticsShape
extends
mock< MainThreadDiagnosticsShape>
(
)
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
:
void
{
}
$clear
(
:
string
)
:
void
{
}
}
const
=
new
class
extends
mock< IExtHostFileSystemInfo>
(
)
{
readonly
=
;
}
;
const
=
(
:
URI
)
:
number
|
undefined
=>
{
return
undefined
;
}
;
const
=
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'disposeCheck'
,
(
)
=>
{
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
.
dispose
(
)
;
.
dispose
(
)
;
.
throws
(
(
)
=>
.
)
;
.
throws
(
(
)
=>
.
clear
(
)
)
;
.
throws
(
(
)
=>
.
delete
(
URI
.
parse
(
'aa:bb'
)
)
)
;
.
throws
(
(
)
=>
.
forEach
(
(
)
=>
{
}
)
)
;
.
throws
(
(
)
=>
.
get
(
URI
.
parse
(
'aa:bb'
)
)
)
;
.
throws
(
(
)
=>
.
has
(
URI
.
parse
(
'aa:bb'
)
)
)
;
.
throws
(
(
)
=>
.
set
(
URI
.
parse
(
'aa:bb'
)
,
[
]
)
)
;
.
throws
(
(
)
=>
.
set
(
URI
.
parse
(
'aa:bb'
)
,
undefined
!
)
)
;
}
)
;
test
(
'diagnostic collection, forEach, clear, has'
,
function
(
)
{
let
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
.
strictEqual
(
.
,
'test'
)
;
.
dispose
(
)
;
.
throws
(
(
)
=>
.
)
;
let
=
0
;
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
.
forEach
(
(
)
=>
++
)
;
.
strictEqual
(
,
0
)
;
.
set
(
URI
.
parse
(
'foo:bar'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-1'
)
,
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-2'
)
]
)
;
.
forEach
(
(
)
=>
++
)
;
.
strictEqual
(
,
1
)
;
=
0
;
.
clear
(
)
;
.
forEach
(
(
)
=>
++
)
;
.
strictEqual
(
,
0
)
;
.
set
(
URI
.
parse
(
'foo:bar1'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-1'
)
,
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-2'
)
]
)
;
.
set
(
URI
.
parse
(
'foo:bar2'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-1'
)
,
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-2'
)
]
)
;
.
forEach
(
(
)
=>
++
)
;
.
strictEqual
(
,
2
)
;
.
ok
(
.
has
(
URI
.
parse
(
'foo:bar1'
)
)
)
;
.
ok
(
.
has
(
URI
.
parse
(
'foo:bar2'
)
)
)
;
.
ok
(
!
.
has
(
URI
.
parse
(
'foo:bar3'
)
)
)
;
.
delete
(
URI
.
parse
(
'foo:bar1'
)
)
;
.
ok
(
!
.
has
(
URI
.
parse
(
'foo:bar1'
)
)
)
;
.
dispose
(
)
;
}
)
;
test
(
'diagnostic collection, immutable read'
,
function
(
)
{
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
.
set
(
URI
.
parse
(
'foo:bar'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-1'
)
,
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'message-2'
)
]
)
;
let
=
.
get
(
URI
.
parse
(
'foo:bar'
)
)
as
[
]
;
.
throws
(
(
)
=>
.
=
0
)
;
.
throws
(
(
)
=>
.
pop
(
)
)
;
.
throws
(
(
)
=>
[
0
]
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
)
,
'evil'
)
)
;
.
forEach
(
(
:
URI
,
:
readonly
.
[
]
)
:
any
=>
{
.
throws
(
(
)
=>
(
as
[
]
)
.
=
0
)
;
.
throws
(
(
)
=>
(
as
[
]
)
.
pop
(
)
)
;
.
throws
(
(
)
=>
(
as
[
]
)
[
0
]
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
)
,
'evil'
)
)
;
}
)
;
=
.
get
(
URI
.
parse
(
'foo:bar'
)
)
as
[
]
;
.
strictEqual
(
.
,
2
)
;
.
dispose
(
)
;
}
)
;
test
(
'diagnostics collection, set with dupliclated tuples'
,
function
(
)
{
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
const
=
URI
.
parse
(
'sc:hightower'
)
;
.
set
(
[
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'message-1'
)
]
]
,
[
URI
.
parse
(
'some:thing'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'something'
)
]
]
,
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'message-2'
)
]
]
,
]
)
;
let
=
.
get
(
)
;
.
strictEqual
(
.
,
2
)
;
let
[
,
]
=
;
.
strictEqual
(
.
,
'message-1'
)
;
.
strictEqual
(
.
,
'message-2'
)
;
.
delete
(
)
;
.
ok
(
!
.
has
(
)
)
;
.
set
(
[
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'message-1'
)
]
]
,
[
URI
.
parse
(
'some:thing'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'something'
)
]
]
,
[
,
undefined
!
]
]
)
;
.
ok
(
!
.
has
(
)
)
;
.
delete
(
)
;
.
ok
(
!
.
has
(
)
)
;
.
set
(
[
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'message-1'
)
]
]
,
[
URI
.
parse
(
'some:thing'
)
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'something'
)
]
]
,
[
,
undefined
!
]
,
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'message-2'
)
]
]
,
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'message-3'
)
]
]
,
]
)
;
=
.
get
(
)
;
.
strictEqual
(
.
,
2
)
;
[
,
]
=
;
.
strictEqual
(
.
,
'message-2'
)
;
.
strictEqual
(
.
,
'message-3'
)
;
.
dispose
(
)
;
}
)
;
test
(
'diagnostics collection, set tuple overrides, #11547'
,
function
(
)
{
let
!
:
[
,
[
]
]
[
]
;
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
:
void
{
=
;
return
super
.
$changeMany
(
,
)
;
}
}
,
new
Emitter
(
)
)
;
const
=
URI
.
parse
(
'sc:hightower'
)
;
.
set
(
[
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'error'
)
]
]
]
)
;
.
strictEqual
(
.
get
(
)
.
,
1
)
;
.
strictEqual
(
.
get
(
)
[
0
]
.
,
'error'
)
;
.
strictEqual
(
.
,
1
)
;
const
[
[
,
]
]
=
;
.
strictEqual
(
.
,
1
)
;
.
strictEqual
(
[
0
]
.
,
'error'
)
;
=
undefined
!
;
.
set
(
[
[
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'warning'
)
]
]
]
)
;
.
strictEqual
(
.
get
(
)
.
,
1
)
;
.
strictEqual
(
.
get
(
)
[
0
]
.
,
'warning'
)
;
.
strictEqual
(
.
,
1
)
;
const
[
[
,
]
]
=
;
.
strictEqual
(
.
,
1
)
;
.
strictEqual
(
[
0
]
.
,
'warning'
)
;
=
undefined
!
;
}
)
;
test
(
'do send message when not making a change'
,
function
(
)
{
let
=
0
;
let
=
0
;
const
=
new
Emitter< any >
(
)
;
.
add
(
.
event
(
=>
+=
1
)
)
;
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
)
{
+=
1
;
}
}
,
)
;
const
=
URI
.
parse
(
'sc:hightower'
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'ffff'
)
;
.
set
(
,
[
]
)
;
.
strictEqual
(
,
1
)
;
.
strictEqual
(
,
1
)
;
.
set
(
,
[
]
)
;
.
strictEqual
(
,
2
)
;
.
strictEqual
(
,
2
)
;
}
)
;
test
(
'diagnostics collection, tuples and undefined (small array), #15585'
,
function
(
)
{
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
const
=
URI
.
parse
(
'sc:hightower'
)
;
const
=
URI
.
parse
(
'sc:nomad'
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
'ffff'
)
;
.
set
(
[
[
,
[
,
,
]
]
,
[
,
undefined
!
]
,
[
,
[
]
]
,
[
,
[
,
]
]
,
[
,
undefined
!
]
,
[
,
[
]
]
,
]
)
;
.
strictEqual
(
.
get
(
)
.
,
1
)
;
.
strictEqual
(
.
get
(
)
.
,
1
)
;
}
)
;
test
(
'diagnostics collection, tuples and undefined (large array), #15585'
,
function
(
)
{
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
new
Emitter
(
)
)
;
const
:
[
URI
,
[
]
]
[
]
=
[
]
;
for
(
let
=
0
;
<
500
;
++
)
{
const
=
URI
.
parse
(
'sc:hightower#'
+
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
1
)
,
.
toString
(
)
)
;
.
push
(
[
,
[
,
,
]
]
)
;
.
push
(
[
,
undefined
!
]
)
;
.
push
(
[
,
[
]
]
)
;
}
.
set
(
)
;
for
(
let
=
0
;
<
500
;
++
)
{
const
=
URI
.
parse
(
'sc:hightower#'
+
)
;
.
strictEqual
(
.
has
(
)
,
true
)
;
.
strictEqual
(
.
get
(
)
.
,
1
)
;
}
}
)
;
test
(
'diagnostic capping (max per file)'
,
function
(
)
{
let
!
:
[
,
[
]
]
[
]
;
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
100
,
250
,
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
:
void
{
=
;
return
super
.
$changeMany
(
,
)
;
}
}
,
new
Emitter
(
)
)
;
const
=
URI
.
parse
(
'aa:bb'
)
;
const
:
[
]
=
[
]
;
for
(
let
=
0
;
<
500
;
++
)
{
.
push
(
new
Diagnostic
(
new
Range
(
,
0
,
+
1
,
0
)
,
` error# ${ i} `
,
<
300
?
.
:
.
)
)
;
}
.
set
(
,
)
;
.
strictEqual
(
.
get
(
)
.
,
500
)
;
.
strictEqual
(
.
,
1
)
;
.
strictEqual
(
[
0
]
[
1
]
.
,
251
)
;
.
strictEqual
(
[
0
]
[
1
]
[
0
]
.
,
.
)
;
.
strictEqual
(
[
0
]
[
1
]
[
200
]
.
,
.
)
;
.
strictEqual
(
[
0
]
[
1
]
[
250
]
.
,
.
)
;
}
)
;
test
(
'diagnostic capping (max files)'
,
function
(
)
{
let
!
:
[
,
[
]
]
[
]
;
const
=
new
DiagnosticCollection
(
'test'
,
'test'
,
2
,
1
,
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
:
void
{
=
;
return
super
.
$changeMany
(
,
)
;
}
}
,
new
Emitter
(
)
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'Hello'
)
;
.
set
(
[
[
URI
.
parse
(
'aa:bb1'
)
,
[
]
]
,
[
URI
.
parse
(
'aa:bb2'
)
,
[
]
]
,
[
URI
.
parse
(
'aa:bb3'
)
,
[
]
]
,
[
URI
.
parse
(
'aa:bb4'
)
,
[
]
]
,
]
)
;
.
strictEqual
(
.
,
3
)
;
}
)
;
test
(
'diagnostic eventing'
,
async
function
(
)
{
const
=
new
Emitter< readonly URI [ ] >
(
)
;
const
=
new
DiagnosticCollection
(
'ddd'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
)
;
const
=
new
Diagnostic
(
new
Range
(
1
,
1
,
2
,
3
)
,
'diag1'
)
;
const
=
new
Diagnostic
(
new
Range
(
1
,
1
,
2
,
3
)
,
'diag2'
)
;
const
=
new
Diagnostic
(
new
Range
(
1
,
1
,
2
,
3
)
,
'diag3'
)
;
let
=
.
toPromise
(
.
)
.
then
(
=>
{
.
strictEqual
(
.
,
1
)
;
.
strictEqual
(
[
0
]
.
toString
(
)
,
'aa:bb'
)
;
.
ok
(
URI
.
isUri
(
[
0
]
)
)
;
}
)
;
.
set
(
URI
.
parse
(
'aa:bb'
)
,
[
]
)
;
await
;
=
.
toPromise
(
.
)
.
then
(
=>
{
.
strictEqual
(
.
,
2
)
;
.
ok
(
URI
.
isUri
(
[
0
]
)
)
;
.
ok
(
URI
.
isUri
(
[
1
]
)
)
;
.
strictEqual
(
[
0
]
.
toString
(
)
,
'aa:bb'
)
;
.
strictEqual
(
[
1
]
.
toString
(
)
,
'aa:cc'
)
;
}
)
;
.
set
(
[
[
URI
.
parse
(
'aa:bb'
)
,
[
]
]
,
[
URI
.
parse
(
'aa:cc'
)
,
[
,
]
]
,
]
)
;
await
;
=
.
toPromise
(
.
)
.
then
(
=>
{
.
strictEqual
(
.
,
2
)
;
.
ok
(
URI
.
isUri
(
[
0
]
)
)
;
.
ok
(
URI
.
isUri
(
[
1
]
)
)
;
}
)
;
.
clear
(
)
;
await
;
}
)
;
test
(
'vscode.languages.onDidChangeDiagnostics Does Not Provide Document URI #49582'
,
async
function
(
)
{
const
=
new
Emitter< readonly URI [ ] >
(
)
;
const
=
new
DiagnosticCollection
(
'ddd'
,
'test'
,
100
,
100
,
,
,
new
DiagnosticsShape
(
)
,
)
;
const
=
new
Diagnostic
(
new
Range
(
1
,
1
,
2
,
3
)
,
'diag1'
)
;
.
set
(
URI
.
parse
(
'aa:bb'
)
,
[
]
)
;
let
=
.
toPromise
(
.
)
.
then
(
=>
{
.
strictEqual
(
[
0
]
.
toString
(
)
,
'aa:bb'
)
;
}
)
;
.
delete
(
URI
.
parse
(
'aa:bb'
)
)
;
await
;
.
set
(
URI
.
parse
(
'aa:bb'
)
,
[
]
)
;
=
.
toPromise
(
.
)
.
then
(
=>
{
.
strictEqual
(
[
0
]
.
toString
(
)
,
'aa:bb'
)
;
}
)
;
.
set
(
URI
.
parse
(
'aa:bb'
)
,
undefined
!
)
;
await
;
}
)
;
test
(
'diagnostics with related information'
,
function
(
)
{
const
=
new
DiagnosticCollection
(
'ddd'
,
'test'
,
100
,
100
,
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
{
const
[
[
,
]
]
=
;
.
strictEqual
(
.
,
1
)
;
.
strictEqual
(
.
,
1
)
;
const
[
]
=
;
.
strictEqual
(
.
!
.
,
2
)
;
.
strictEqual
(
.
!
[
0
]
.
,
'more1'
)
;
.
strictEqual
(
.
!
[
1
]
.
,
'more2'
)
;
done
(
)
;
}
}
,
new
Emitter< any >
(
)
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'Foo'
)
;
.
=
[
new
DiagnosticRelatedInformation
(
new
Location
(
URI
.
parse
(
'cc:dd'
)
,
new
Range
(
0
,
0
,
0
,
0
)
)
,
'more1'
)
,
new
DiagnosticRelatedInformation
(
new
Location
(
URI
.
parse
(
'cc:ee'
)
,
new
Range
(
0
,
0
,
0
,
0
)
)
,
'more2'
)
]
;
.
set
(
URI
.
parse
(
'aa:bb'
)
,
[
]
)
;
}
)
;
test
(
'vscode.languages.getDiagnostics appears to return old diagnostics in some circumstances #54359'
,
function
(
)
{
const
:
string
[
]
=
[
]
;
const
=
new
ExtHostDiagnostics
(
new
class
implements
IMainContext
{
getProxy
(
:
any
)
:
any
{
return
new
class
{
$clear
(
:
string
)
:
void
{
.
push
(
)
;
}
}
;
}
set
(
)
:
any
{
return
null
;
}
dispose
(
)
{
}
assertRegistered
(
)
:
void
{
}
drain
(
)
{
return
undefined
!
;
}
}
,
new
NullLogService
(
)
,
,
new
class
extends
mock< IExtHostDocumentsAndEditors>
(
)
{
getDocument
(
)
{
return
undefined
;
}
}
)
;
const
=
.
createDiagnosticCollection
(
.
,
'foo'
)
;
const
=
.
createDiagnosticCollection
(
.
,
'foo'
)
;
.
clear
(
)
;
.
clear
(
)
;
.
strictEqual
(
.
,
2
)
;
.
strictEqual
(
[
0
]
,
'foo'
)
;
.
strictEqual
(
[
1
]
,
'foo0'
)
;
}
)
;
test
(
'Error updating diagnostics from extension #60394'
,
function
(
)
{
let
=
0
;
const
=
new
DiagnosticCollection
(
'ddd'
,
'test'
,
100
,
100
,
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
{
+=
1
;
}
}
,
new
Emitter< any >
(
)
)
;
const
:
[
]
=
[
]
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'Foo'
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'Bar'
)
;
.
push
(
,
)
;
.
set
(
URI
.
parse
(
'test:me'
)
,
)
;
.
strictEqual
(
,
1
)
;
.
set
(
URI
.
parse
(
'test:me'
)
,
)
;
.
strictEqual
(
,
2
)
;
.
push
(
)
;
.
set
(
URI
.
parse
(
'test:me'
)
,
)
;
.
strictEqual
(
,
3
)
;
}
)
;
test
(
'getDiagnostics does not tolerate sparse diagnostic arrays'
,
function
(
)
{
const
=
new
ExtHostDiagnostics
(
new
class
implements
IMainContext
{
getProxy
(
)
:
any
{
return
new
DiagnosticsShape
(
)
;
}
set
(
)
:
any
{
return
null
;
}
dispose
(
)
:
void
{
}
assertRegistered
(
)
:
void
{
}
drain
(
)
{
return
undefined
!
;
}
}
,
new
NullLogService
(
)
,
,
new
class
extends
mock< IExtHostDocumentsAndEditors>
(
)
{
getDocument
(
)
{
return
undefined
;
}
}
)
;
const
=
.
createDiagnosticCollection
(
.
,
'sparse'
)
;
const
=
URI
.
parse
(
'sparse:uri'
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
)
,
'holey'
)
;
const
:
[
]
=
new
Array
(
3
)
;
[
1
]
=
;
.
set
(
,
)
;
const
=
.
getDiagnostics
(
)
;
.
strictEqual
(
.
,
1
)
;
const
=
[
...
]
as
(
.
|
undefined
)
[
]
;
.
strictEqual
(
.
some
(
=>
===
undefined
)
,
false
)
;
}
)
;
test
(
'Version id is set whenever possible'
,
function
(
)
{
const
:
[
,
[
]
]
[
]
=
[
]
;
const
=
new
DiagnosticCollection
(
'ddd'
,
'test'
,
100
,
100
,
=>
{
return
7
;
}
,
,
new
class
extends
DiagnosticsShape
{
$changeMany
(
:
string
,
:
[
,
[
]
]
[
]
)
{
.
push
(
...
)
;
}
}
,
new
Emitter< any >
(
)
)
;
const
:
[
]
=
[
]
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'Foo'
)
;
const
=
new
Diagnostic
(
new
Range
(
0
,
0
,
1
,
1
)
,
'Bar'
)
;
.
push
(
,
)
;
.
set
(
URI
.
parse
(
'test:one'
)
,
)
;
.
set
(
URI
.
parse
(
'test:two'
)
,
[
]
)
;
.
set
(
URI
.
parse
(
'test:three'
)
,
[
]
)
;
const
=
.
map
(
=>
[
1
]
.
map
(
=>
.
)
)
.
flat
(
)
;
.
deepStrictEqual
(
,
[
7
,
7
,
7
,
7
]
)
;
}
)
;
test
(
'Diagnostics created by tasks aren\'t accessible to extensions #47292'
,
async
function
(
)
{
return
runWithFakedTimers
(
{
}
,
async
function
(
)
{
const
=
new
ExtHostDiagnostics
(
new
class
implements
IMainContext
{
getProxy
(
:
any
)
:
any
{
return
{
}
;
}
set
(
)
:
any
{
return
null
;
}
dispose
(
)
{
}
assertRegistered
(
)
:
void
{
}
drain
(
)
{
return
undefined
!
;
}
}
,
new
NullLogService
(
)
,
,
new
class
extends
mock< IExtHostDocumentsAndEditors>
(
)
{
getDocument
(
)
{
return
undefined
;
}
}
)
;
const
=
URI
.
parse
(
'foo:bar'
)
;
const
:
[
]
=
[
{
:
'message'
,
:
1
,
:
1
,
:
1
,
:
1
,
:
.
}
]
;
const
=
.
toPromise
(
.
)
;
.
$acceptMarkersChange
(
[
[
,
]
]
)
;
await
;
.
strictEqual
(
.
getDiagnostics
(
)
.
,
1
)
;
const
=
.
toPromise
(
.
)
;
.
$acceptMarkersChange
(
[
[
,
[
]
]
]
)
;
await
;
.
strictEqual
(
.
getDiagnostics
(
)
.
,
0
)
;
}
)
;
}
)
;
test
(
'languages.getDiagnostics doesn\'t handle case insensitivity correctly #128198'
,
function
(
)
{
const
=
new
ExtHostDiagnostics
(
new
class
implements
IMainContext
{
getProxy
(
:
any
)
:
any
{
return
new
DiagnosticsShape
(
)
;
}
set
(
)
:
any
{
return
null
;
}
dispose
(
)
{
}
assertRegistered
(
)
:
void
{
}
drain
(
)
{
return
undefined
!
;
}
}
,
new
NullLogService
(
)
,
new
class
extends
mock< IExtHostFileSystemInfo>
(
)
{
readonly
=
new
ExtUri
(
=>
.
===
'insensitive'
)
;
}
,
new
class
extends
mock< IExtHostDocumentsAndEditors>
(
)
{
getDocument
(
)
{
return
undefined
;
}
}
)
;
const
=
.
createDiagnosticCollection
(
.
)
;
const
=
URI
.
from
(
{
:
'foo'
,
:
'/SOME/path'
}
)
;
const
=
.
with
(
{
:
.
.
toUpperCase
(
)
}
)
;
const
=
URI
.
from
(
{
:
'insensitive'
,
:
'/SOME/path'
}
)
;
const
=
.
with
(
{
:
.
.
toUpperCase
(
)
}
)
;
.
set
(
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
)
,
'sensitive'
)
]
)
;
.
set
(
,
[
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
0
)
,
'insensitive'
)
]
)
;
.
strictEqual
(
.
get
(
)
?.
,
1
)
;
.
strictEqual
(
.
get
(
)
?.
,
0
)
;
.
strictEqual
(
.
get
(
)
?.
,
1
)
;
.
strictEqual
(
.
get
(
)
?.
,
1
)
;
.
strictEqual
(
.
getDiagnostics
(
)
?.
,
1
)
;
.
strictEqual
(
.
getDiagnostics
(
)
?.
,
0
)
;
.
strictEqual
(
.
getDiagnostics
(
)
?.
,
1
)
;
.
strictEqual
(
.
getDiagnostics
(
)
?.
,
1
)
;
const
:
URI
[
]
=
[
]
;
.
forEach
(
=>
.
push
(
)
)
;
.
strictEqual
(
.
,
2
)
;
.
strictEqual
(
[
0
]
.
toString
(
)
,
.
toString
(
)
)
;
.
strictEqual
(
[
1
]
.
toString
(
)
,
.
toString
(
)
)
;
}
)
;
}
)
;