@kusto/monaco-kusto 4.1.8 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/release/dev/kustoMode.js +1953 -1570
- package/release/dev/kustoWorker.js +1974 -1561
- package/release/dev/monaco.contribution.js +19 -16
- package/release/esm/_deps/vscode-languageserver-types/main.js +1908 -1527
- package/release/esm/commandFormatter.js +5 -3
- package/release/esm/commandHighlighter.js +9 -5
- package/release/esm/languageFeatures.js +32 -31
- package/release/esm/languageService/kustoLanguageService.js +53 -22
- package/release/esm/monaco.contribution.js +5 -8
- package/release/esm/monaco.d.ts +3 -0
- package/release/min/kustoMode.js +3 -3
- package/release/min/kustoWorker.js +6 -6
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/monaco.d.ts +3 -0
|
@@ -68,1545 +68,1927 @@ define('vs/language/kusto/languageService/schema',["require", "exports"], functi
|
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
(function (factory) {
|
|
72
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
73
|
-
var v = factory(require, exports);
|
|
74
|
-
if (v !== undefined) module.exports = v;
|
|
75
|
-
}
|
|
76
|
-
else if (typeof define === "function" && define.amd) {
|
|
77
|
-
define('vscode-languageserver-types/main',["require", "exports"], factory);
|
|
78
|
-
}
|
|
79
|
-
})(function (require, exports) {
|
|
80
|
-
/* --------------------------------------------------------------------------------------------
|
|
81
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
82
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
83
|
-
* ------------------------------------------------------------------------------------------ */
|
|
84
|
-
'use strict';
|
|
85
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
-
function
|
|
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
|
-
function
|
|
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
|
-
return
|
|
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
|
-
return
|
|
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
|
-
function
|
|
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
|
-
function
|
|
542
|
-
var
|
|
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
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
this.
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
var
|
|
1004
|
-
if (
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
*
|
|
1028
|
-
*/
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
*
|
|
1101
|
-
*
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
*
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
*
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
*
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1204
|
-
*
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
*
|
|
1218
|
-
*/
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
*
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
*
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
*
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
})(
|
|
1336
|
-
/**
|
|
1337
|
-
* The
|
|
1338
|
-
* [
|
|
1339
|
-
*/
|
|
1340
|
-
var
|
|
1341
|
-
(function (
|
|
1342
|
-
/**
|
|
1343
|
-
* Creates a new
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
*
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
71
|
+
(function (factory) {
|
|
72
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
73
|
+
var v = factory(require, exports);
|
|
74
|
+
if (v !== undefined) module.exports = v;
|
|
75
|
+
}
|
|
76
|
+
else if (typeof define === "function" && define.amd) {
|
|
77
|
+
define('vscode-languageserver-types/main',["require", "exports"], factory);
|
|
78
|
+
}
|
|
79
|
+
})(function (require, exports) {
|
|
80
|
+
/* --------------------------------------------------------------------------------------------
|
|
81
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
82
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
83
|
+
* ------------------------------------------------------------------------------------------ */
|
|
84
|
+
'use strict';
|
|
85
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
|
+
exports.TextDocument = exports.EOL = exports.SelectionRange = exports.DocumentLink = exports.FormattingOptions = exports.CodeLens = exports.CodeAction = exports.CodeActionContext = exports.CodeActionKind = exports.DocumentSymbol = exports.SymbolInformation = exports.SymbolTag = exports.SymbolKind = exports.DocumentHighlight = exports.DocumentHighlightKind = exports.SignatureInformation = exports.ParameterInformation = exports.Hover = exports.MarkedString = exports.CompletionList = exports.CompletionItem = exports.InsertTextMode = exports.InsertReplaceEdit = exports.CompletionItemTag = exports.InsertTextFormat = exports.CompletionItemKind = exports.MarkupContent = exports.MarkupKind = exports.TextDocumentItem = exports.OptionalVersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier = exports.TextDocumentIdentifier = exports.WorkspaceChange = exports.WorkspaceEdit = exports.DeleteFile = exports.RenameFile = exports.CreateFile = exports.TextDocumentEdit = exports.AnnotatedTextEdit = exports.ChangeAnnotationIdentifier = exports.ChangeAnnotation = exports.TextEdit = exports.Command = exports.Diagnostic = exports.CodeDescription = exports.DiagnosticTag = exports.DiagnosticSeverity = exports.DiagnosticRelatedInformation = exports.FoldingRange = exports.FoldingRangeKind = exports.ColorPresentation = exports.ColorInformation = exports.Color = exports.LocationLink = exports.Location = exports.Range = exports.Position = exports.uinteger = exports.integer = void 0;
|
|
87
|
+
var integer;
|
|
88
|
+
(function (integer) {
|
|
89
|
+
integer.MIN_VALUE = -2147483648;
|
|
90
|
+
integer.MAX_VALUE = 2147483647;
|
|
91
|
+
})(integer = exports.integer || (exports.integer = {}));
|
|
92
|
+
var uinteger;
|
|
93
|
+
(function (uinteger) {
|
|
94
|
+
uinteger.MIN_VALUE = 0;
|
|
95
|
+
uinteger.MAX_VALUE = 2147483647;
|
|
96
|
+
})(uinteger = exports.uinteger || (exports.uinteger = {}));
|
|
97
|
+
/**
|
|
98
|
+
* The Position namespace provides helper functions to work with
|
|
99
|
+
* [Position](#Position) literals.
|
|
100
|
+
*/
|
|
101
|
+
var Position;
|
|
102
|
+
(function (Position) {
|
|
103
|
+
/**
|
|
104
|
+
* Creates a new Position literal from the given line and character.
|
|
105
|
+
* @param line The position's line.
|
|
106
|
+
* @param character The position's character.
|
|
107
|
+
*/
|
|
108
|
+
function create(line, character) {
|
|
109
|
+
if (line === Number.MAX_VALUE) {
|
|
110
|
+
line = uinteger.MAX_VALUE;
|
|
111
|
+
}
|
|
112
|
+
if (character === Number.MAX_VALUE) {
|
|
113
|
+
character = uinteger.MAX_VALUE;
|
|
114
|
+
}
|
|
115
|
+
return { line: line, character: character };
|
|
116
|
+
}
|
|
117
|
+
Position.create = create;
|
|
118
|
+
/**
|
|
119
|
+
* Checks whether the given literal conforms to the [Position](#Position) interface.
|
|
120
|
+
*/
|
|
121
|
+
function is(value) {
|
|
122
|
+
var candidate = value;
|
|
123
|
+
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
|
|
124
|
+
}
|
|
125
|
+
Position.is = is;
|
|
126
|
+
})(Position = exports.Position || (exports.Position = {}));
|
|
127
|
+
/**
|
|
128
|
+
* The Range namespace provides helper functions to work with
|
|
129
|
+
* [Range](#Range) literals.
|
|
130
|
+
*/
|
|
131
|
+
var Range;
|
|
132
|
+
(function (Range) {
|
|
133
|
+
function create(one, two, three, four) {
|
|
134
|
+
if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
|
|
135
|
+
return { start: Position.create(one, two), end: Position.create(three, four) };
|
|
136
|
+
}
|
|
137
|
+
else if (Position.is(one) && Position.is(two)) {
|
|
138
|
+
return { start: one, end: two };
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
Range.create = create;
|
|
145
|
+
/**
|
|
146
|
+
* Checks whether the given literal conforms to the [Range](#Range) interface.
|
|
147
|
+
*/
|
|
148
|
+
function is(value) {
|
|
149
|
+
var candidate = value;
|
|
150
|
+
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
|
151
|
+
}
|
|
152
|
+
Range.is = is;
|
|
153
|
+
})(Range = exports.Range || (exports.Range = {}));
|
|
154
|
+
/**
|
|
155
|
+
* The Location namespace provides helper functions to work with
|
|
156
|
+
* [Location](#Location) literals.
|
|
157
|
+
*/
|
|
158
|
+
var Location;
|
|
159
|
+
(function (Location) {
|
|
160
|
+
/**
|
|
161
|
+
* Creates a Location literal.
|
|
162
|
+
* @param uri The location's uri.
|
|
163
|
+
* @param range The location's range.
|
|
164
|
+
*/
|
|
165
|
+
function create(uri, range) {
|
|
166
|
+
return { uri: uri, range: range };
|
|
167
|
+
}
|
|
168
|
+
Location.create = create;
|
|
169
|
+
/**
|
|
170
|
+
* Checks whether the given literal conforms to the [Location](#Location) interface.
|
|
171
|
+
*/
|
|
172
|
+
function is(value) {
|
|
173
|
+
var candidate = value;
|
|
174
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
|
175
|
+
}
|
|
176
|
+
Location.is = is;
|
|
177
|
+
})(Location = exports.Location || (exports.Location = {}));
|
|
178
|
+
/**
|
|
179
|
+
* The LocationLink namespace provides helper functions to work with
|
|
180
|
+
* [LocationLink](#LocationLink) literals.
|
|
181
|
+
*/
|
|
182
|
+
var LocationLink;
|
|
183
|
+
(function (LocationLink) {
|
|
184
|
+
/**
|
|
185
|
+
* Creates a LocationLink literal.
|
|
186
|
+
* @param targetUri The definition's uri.
|
|
187
|
+
* @param targetRange The full range of the definition.
|
|
188
|
+
* @param targetSelectionRange The span of the symbol definition at the target.
|
|
189
|
+
* @param originSelectionRange The span of the symbol being defined in the originating source file.
|
|
190
|
+
*/
|
|
191
|
+
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
|
192
|
+
return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
|
|
193
|
+
}
|
|
194
|
+
LocationLink.create = create;
|
|
195
|
+
/**
|
|
196
|
+
* Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
|
|
197
|
+
*/
|
|
198
|
+
function is(value) {
|
|
199
|
+
var candidate = value;
|
|
200
|
+
return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
|
|
201
|
+
&& (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
|
|
202
|
+
&& (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
|
203
|
+
}
|
|
204
|
+
LocationLink.is = is;
|
|
205
|
+
})(LocationLink = exports.LocationLink || (exports.LocationLink = {}));
|
|
206
|
+
/**
|
|
207
|
+
* The Color namespace provides helper functions to work with
|
|
208
|
+
* [Color](#Color) literals.
|
|
209
|
+
*/
|
|
210
|
+
var Color;
|
|
211
|
+
(function (Color) {
|
|
212
|
+
/**
|
|
213
|
+
* Creates a new Color literal.
|
|
214
|
+
*/
|
|
215
|
+
function create(red, green, blue, alpha) {
|
|
216
|
+
return {
|
|
217
|
+
red: red,
|
|
218
|
+
green: green,
|
|
219
|
+
blue: blue,
|
|
220
|
+
alpha: alpha,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
Color.create = create;
|
|
224
|
+
/**
|
|
225
|
+
* Checks whether the given literal conforms to the [Color](#Color) interface.
|
|
226
|
+
*/
|
|
227
|
+
function is(value) {
|
|
228
|
+
var candidate = value;
|
|
229
|
+
return Is.numberRange(candidate.red, 0, 1)
|
|
230
|
+
&& Is.numberRange(candidate.green, 0, 1)
|
|
231
|
+
&& Is.numberRange(candidate.blue, 0, 1)
|
|
232
|
+
&& Is.numberRange(candidate.alpha, 0, 1);
|
|
233
|
+
}
|
|
234
|
+
Color.is = is;
|
|
235
|
+
})(Color = exports.Color || (exports.Color = {}));
|
|
236
|
+
/**
|
|
237
|
+
* The ColorInformation namespace provides helper functions to work with
|
|
238
|
+
* [ColorInformation](#ColorInformation) literals.
|
|
239
|
+
*/
|
|
240
|
+
var ColorInformation;
|
|
241
|
+
(function (ColorInformation) {
|
|
242
|
+
/**
|
|
243
|
+
* Creates a new ColorInformation literal.
|
|
244
|
+
*/
|
|
245
|
+
function create(range, color) {
|
|
246
|
+
return {
|
|
247
|
+
range: range,
|
|
248
|
+
color: color,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
ColorInformation.create = create;
|
|
252
|
+
/**
|
|
253
|
+
* Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
|
|
254
|
+
*/
|
|
255
|
+
function is(value) {
|
|
256
|
+
var candidate = value;
|
|
257
|
+
return Range.is(candidate.range) && Color.is(candidate.color);
|
|
258
|
+
}
|
|
259
|
+
ColorInformation.is = is;
|
|
260
|
+
})(ColorInformation = exports.ColorInformation || (exports.ColorInformation = {}));
|
|
261
|
+
/**
|
|
262
|
+
* The Color namespace provides helper functions to work with
|
|
263
|
+
* [ColorPresentation](#ColorPresentation) literals.
|
|
264
|
+
*/
|
|
265
|
+
var ColorPresentation;
|
|
266
|
+
(function (ColorPresentation) {
|
|
267
|
+
/**
|
|
268
|
+
* Creates a new ColorInformation literal.
|
|
269
|
+
*/
|
|
270
|
+
function create(label, textEdit, additionalTextEdits) {
|
|
271
|
+
return {
|
|
272
|
+
label: label,
|
|
273
|
+
textEdit: textEdit,
|
|
274
|
+
additionalTextEdits: additionalTextEdits,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
ColorPresentation.create = create;
|
|
278
|
+
/**
|
|
279
|
+
* Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
|
|
280
|
+
*/
|
|
281
|
+
function is(value) {
|
|
282
|
+
var candidate = value;
|
|
283
|
+
return Is.string(candidate.label)
|
|
284
|
+
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
|
285
|
+
&& (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
|
286
|
+
}
|
|
287
|
+
ColorPresentation.is = is;
|
|
288
|
+
})(ColorPresentation = exports.ColorPresentation || (exports.ColorPresentation = {}));
|
|
289
|
+
/**
|
|
290
|
+
* Enum of known range kinds
|
|
291
|
+
*/
|
|
292
|
+
var FoldingRangeKind;
|
|
293
|
+
(function (FoldingRangeKind) {
|
|
294
|
+
/**
|
|
295
|
+
* Folding range for a comment
|
|
296
|
+
*/
|
|
297
|
+
FoldingRangeKind["Comment"] = "comment";
|
|
298
|
+
/**
|
|
299
|
+
* Folding range for a imports or includes
|
|
300
|
+
*/
|
|
301
|
+
FoldingRangeKind["Imports"] = "imports";
|
|
302
|
+
/**
|
|
303
|
+
* Folding range for a region (e.g. `#region`)
|
|
304
|
+
*/
|
|
305
|
+
FoldingRangeKind["Region"] = "region";
|
|
306
|
+
})(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
|
|
307
|
+
/**
|
|
308
|
+
* The folding range namespace provides helper functions to work with
|
|
309
|
+
* [FoldingRange](#FoldingRange) literals.
|
|
310
|
+
*/
|
|
311
|
+
var FoldingRange;
|
|
312
|
+
(function (FoldingRange) {
|
|
313
|
+
/**
|
|
314
|
+
* Creates a new FoldingRange literal.
|
|
315
|
+
*/
|
|
316
|
+
function create(startLine, endLine, startCharacter, endCharacter, kind) {
|
|
317
|
+
var result = {
|
|
318
|
+
startLine: startLine,
|
|
319
|
+
endLine: endLine
|
|
320
|
+
};
|
|
321
|
+
if (Is.defined(startCharacter)) {
|
|
322
|
+
result.startCharacter = startCharacter;
|
|
323
|
+
}
|
|
324
|
+
if (Is.defined(endCharacter)) {
|
|
325
|
+
result.endCharacter = endCharacter;
|
|
326
|
+
}
|
|
327
|
+
if (Is.defined(kind)) {
|
|
328
|
+
result.kind = kind;
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
FoldingRange.create = create;
|
|
333
|
+
/**
|
|
334
|
+
* Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.
|
|
335
|
+
*/
|
|
336
|
+
function is(value) {
|
|
337
|
+
var candidate = value;
|
|
338
|
+
return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
|
|
339
|
+
&& (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
|
|
340
|
+
&& (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
|
|
341
|
+
&& (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
|
342
|
+
}
|
|
343
|
+
FoldingRange.is = is;
|
|
344
|
+
})(FoldingRange = exports.FoldingRange || (exports.FoldingRange = {}));
|
|
345
|
+
/**
|
|
346
|
+
* The DiagnosticRelatedInformation namespace provides helper functions to work with
|
|
347
|
+
* [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.
|
|
348
|
+
*/
|
|
349
|
+
var DiagnosticRelatedInformation;
|
|
350
|
+
(function (DiagnosticRelatedInformation) {
|
|
351
|
+
/**
|
|
352
|
+
* Creates a new DiagnosticRelatedInformation literal.
|
|
353
|
+
*/
|
|
354
|
+
function create(location, message) {
|
|
355
|
+
return {
|
|
356
|
+
location: location,
|
|
357
|
+
message: message
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
DiagnosticRelatedInformation.create = create;
|
|
361
|
+
/**
|
|
362
|
+
* Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.
|
|
363
|
+
*/
|
|
364
|
+
function is(value) {
|
|
365
|
+
var candidate = value;
|
|
366
|
+
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
|
367
|
+
}
|
|
368
|
+
DiagnosticRelatedInformation.is = is;
|
|
369
|
+
})(DiagnosticRelatedInformation = exports.DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = {}));
|
|
370
|
+
/**
|
|
371
|
+
* The diagnostic's severity.
|
|
372
|
+
*/
|
|
373
|
+
var DiagnosticSeverity;
|
|
374
|
+
(function (DiagnosticSeverity) {
|
|
375
|
+
/**
|
|
376
|
+
* Reports an error.
|
|
377
|
+
*/
|
|
378
|
+
DiagnosticSeverity.Error = 1;
|
|
379
|
+
/**
|
|
380
|
+
* Reports a warning.
|
|
381
|
+
*/
|
|
382
|
+
DiagnosticSeverity.Warning = 2;
|
|
383
|
+
/**
|
|
384
|
+
* Reports an information.
|
|
385
|
+
*/
|
|
386
|
+
DiagnosticSeverity.Information = 3;
|
|
387
|
+
/**
|
|
388
|
+
* Reports a hint.
|
|
389
|
+
*/
|
|
390
|
+
DiagnosticSeverity.Hint = 4;
|
|
391
|
+
})(DiagnosticSeverity = exports.DiagnosticSeverity || (exports.DiagnosticSeverity = {}));
|
|
392
|
+
/**
|
|
393
|
+
* The diagnostic tags.
|
|
394
|
+
*
|
|
395
|
+
* @since 3.15.0
|
|
396
|
+
*/
|
|
397
|
+
var DiagnosticTag;
|
|
398
|
+
(function (DiagnosticTag) {
|
|
399
|
+
/**
|
|
400
|
+
* Unused or unnecessary code.
|
|
401
|
+
*
|
|
402
|
+
* Clients are allowed to render diagnostics with this tag faded out instead of having
|
|
403
|
+
* an error squiggle.
|
|
404
|
+
*/
|
|
405
|
+
DiagnosticTag.Unnecessary = 1;
|
|
406
|
+
/**
|
|
407
|
+
* Deprecated or obsolete code.
|
|
408
|
+
*
|
|
409
|
+
* Clients are allowed to rendered diagnostics with this tag strike through.
|
|
410
|
+
*/
|
|
411
|
+
DiagnosticTag.Deprecated = 2;
|
|
412
|
+
})(DiagnosticTag = exports.DiagnosticTag || (exports.DiagnosticTag = {}));
|
|
413
|
+
/**
|
|
414
|
+
* The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
|
|
415
|
+
*
|
|
416
|
+
* @since 3.16.0
|
|
417
|
+
*/
|
|
418
|
+
var CodeDescription;
|
|
419
|
+
(function (CodeDescription) {
|
|
420
|
+
function is(value) {
|
|
421
|
+
var candidate = value;
|
|
422
|
+
return candidate !== undefined && candidate !== null && Is.string(candidate.href);
|
|
423
|
+
}
|
|
424
|
+
CodeDescription.is = is;
|
|
425
|
+
})(CodeDescription = exports.CodeDescription || (exports.CodeDescription = {}));
|
|
426
|
+
/**
|
|
427
|
+
* The Diagnostic namespace provides helper functions to work with
|
|
428
|
+
* [Diagnostic](#Diagnostic) literals.
|
|
429
|
+
*/
|
|
430
|
+
var Diagnostic;
|
|
431
|
+
(function (Diagnostic) {
|
|
432
|
+
/**
|
|
433
|
+
* Creates a new Diagnostic literal.
|
|
434
|
+
*/
|
|
435
|
+
function create(range, message, severity, code, source, relatedInformation) {
|
|
436
|
+
var result = { range: range, message: message };
|
|
437
|
+
if (Is.defined(severity)) {
|
|
438
|
+
result.severity = severity;
|
|
439
|
+
}
|
|
440
|
+
if (Is.defined(code)) {
|
|
441
|
+
result.code = code;
|
|
442
|
+
}
|
|
443
|
+
if (Is.defined(source)) {
|
|
444
|
+
result.source = source;
|
|
445
|
+
}
|
|
446
|
+
if (Is.defined(relatedInformation)) {
|
|
447
|
+
result.relatedInformation = relatedInformation;
|
|
448
|
+
}
|
|
449
|
+
return result;
|
|
450
|
+
}
|
|
451
|
+
Diagnostic.create = create;
|
|
452
|
+
/**
|
|
453
|
+
* Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.
|
|
454
|
+
*/
|
|
455
|
+
function is(value) {
|
|
456
|
+
var _a;
|
|
457
|
+
var candidate = value;
|
|
458
|
+
return Is.defined(candidate)
|
|
459
|
+
&& Range.is(candidate.range)
|
|
460
|
+
&& Is.string(candidate.message)
|
|
461
|
+
&& (Is.number(candidate.severity) || Is.undefined(candidate.severity))
|
|
462
|
+
&& (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
|
|
463
|
+
&& (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))
|
|
464
|
+
&& (Is.string(candidate.source) || Is.undefined(candidate.source))
|
|
465
|
+
&& (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
|
|
466
|
+
}
|
|
467
|
+
Diagnostic.is = is;
|
|
468
|
+
})(Diagnostic = exports.Diagnostic || (exports.Diagnostic = {}));
|
|
469
|
+
/**
|
|
470
|
+
* The Command namespace provides helper functions to work with
|
|
471
|
+
* [Command](#Command) literals.
|
|
472
|
+
*/
|
|
473
|
+
var Command;
|
|
474
|
+
(function (Command) {
|
|
475
|
+
/**
|
|
476
|
+
* Creates a new Command literal.
|
|
477
|
+
*/
|
|
478
|
+
function create(title, command) {
|
|
479
|
+
var args = [];
|
|
480
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
481
|
+
args[_i - 2] = arguments[_i];
|
|
482
|
+
}
|
|
483
|
+
var result = { title: title, command: command };
|
|
484
|
+
if (Is.defined(args) && args.length > 0) {
|
|
485
|
+
result.arguments = args;
|
|
486
|
+
}
|
|
487
|
+
return result;
|
|
488
|
+
}
|
|
489
|
+
Command.create = create;
|
|
490
|
+
/**
|
|
491
|
+
* Checks whether the given literal conforms to the [Command](#Command) interface.
|
|
492
|
+
*/
|
|
493
|
+
function is(value) {
|
|
494
|
+
var candidate = value;
|
|
495
|
+
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
|
496
|
+
}
|
|
497
|
+
Command.is = is;
|
|
498
|
+
})(Command = exports.Command || (exports.Command = {}));
|
|
499
|
+
/**
|
|
500
|
+
* The TextEdit namespace provides helper function to create replace,
|
|
501
|
+
* insert and delete edits more easily.
|
|
502
|
+
*/
|
|
503
|
+
var TextEdit;
|
|
504
|
+
(function (TextEdit) {
|
|
505
|
+
/**
|
|
506
|
+
* Creates a replace text edit.
|
|
507
|
+
* @param range The range of text to be replaced.
|
|
508
|
+
* @param newText The new text.
|
|
509
|
+
*/
|
|
510
|
+
function replace(range, newText) {
|
|
511
|
+
return { range: range, newText: newText };
|
|
512
|
+
}
|
|
513
|
+
TextEdit.replace = replace;
|
|
514
|
+
/**
|
|
515
|
+
* Creates a insert text edit.
|
|
516
|
+
* @param position The position to insert the text at.
|
|
517
|
+
* @param newText The text to be inserted.
|
|
518
|
+
*/
|
|
519
|
+
function insert(position, newText) {
|
|
520
|
+
return { range: { start: position, end: position }, newText: newText };
|
|
521
|
+
}
|
|
522
|
+
TextEdit.insert = insert;
|
|
523
|
+
/**
|
|
524
|
+
* Creates a delete text edit.
|
|
525
|
+
* @param range The range of text to be deleted.
|
|
526
|
+
*/
|
|
527
|
+
function del(range) {
|
|
528
|
+
return { range: range, newText: '' };
|
|
529
|
+
}
|
|
530
|
+
TextEdit.del = del;
|
|
531
|
+
function is(value) {
|
|
532
|
+
var candidate = value;
|
|
533
|
+
return Is.objectLiteral(candidate)
|
|
534
|
+
&& Is.string(candidate.newText)
|
|
535
|
+
&& Range.is(candidate.range);
|
|
536
|
+
}
|
|
537
|
+
TextEdit.is = is;
|
|
538
|
+
})(TextEdit = exports.TextEdit || (exports.TextEdit = {}));
|
|
539
|
+
var ChangeAnnotation;
|
|
540
|
+
(function (ChangeAnnotation) {
|
|
541
|
+
function create(label, needsConfirmation, description) {
|
|
542
|
+
var result = { label: label };
|
|
543
|
+
if (needsConfirmation !== undefined) {
|
|
544
|
+
result.needsConfirmation = needsConfirmation;
|
|
545
|
+
}
|
|
546
|
+
if (description !== undefined) {
|
|
547
|
+
result.description = description;
|
|
548
|
+
}
|
|
549
|
+
return result;
|
|
550
|
+
}
|
|
551
|
+
ChangeAnnotation.create = create;
|
|
552
|
+
function is(value) {
|
|
553
|
+
var candidate = value;
|
|
554
|
+
return candidate !== undefined && Is.objectLiteral(candidate) && Is.string(candidate.label) &&
|
|
555
|
+
(Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
|
|
556
|
+
(Is.string(candidate.description) || candidate.description === undefined);
|
|
557
|
+
}
|
|
558
|
+
ChangeAnnotation.is = is;
|
|
559
|
+
})(ChangeAnnotation = exports.ChangeAnnotation || (exports.ChangeAnnotation = {}));
|
|
560
|
+
var ChangeAnnotationIdentifier;
|
|
561
|
+
(function (ChangeAnnotationIdentifier) {
|
|
562
|
+
function is(value) {
|
|
563
|
+
var candidate = value;
|
|
564
|
+
return typeof candidate === 'string';
|
|
565
|
+
}
|
|
566
|
+
ChangeAnnotationIdentifier.is = is;
|
|
567
|
+
})(ChangeAnnotationIdentifier = exports.ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = {}));
|
|
568
|
+
var AnnotatedTextEdit;
|
|
569
|
+
(function (AnnotatedTextEdit) {
|
|
570
|
+
/**
|
|
571
|
+
* Creates an annotated replace text edit.
|
|
572
|
+
*
|
|
573
|
+
* @param range The range of text to be replaced.
|
|
574
|
+
* @param newText The new text.
|
|
575
|
+
* @param annotation The annotation.
|
|
576
|
+
*/
|
|
577
|
+
function replace(range, newText, annotation) {
|
|
578
|
+
return { range: range, newText: newText, annotationId: annotation };
|
|
579
|
+
}
|
|
580
|
+
AnnotatedTextEdit.replace = replace;
|
|
581
|
+
/**
|
|
582
|
+
* Creates an annotated insert text edit.
|
|
583
|
+
*
|
|
584
|
+
* @param position The position to insert the text at.
|
|
585
|
+
* @param newText The text to be inserted.
|
|
586
|
+
* @param annotation The annotation.
|
|
587
|
+
*/
|
|
588
|
+
function insert(position, newText, annotation) {
|
|
589
|
+
return { range: { start: position, end: position }, newText: newText, annotationId: annotation };
|
|
590
|
+
}
|
|
591
|
+
AnnotatedTextEdit.insert = insert;
|
|
592
|
+
/**
|
|
593
|
+
* Creates an annotated delete text edit.
|
|
594
|
+
*
|
|
595
|
+
* @param range The range of text to be deleted.
|
|
596
|
+
* @param annotation The annotation.
|
|
597
|
+
*/
|
|
598
|
+
function del(range, annotation) {
|
|
599
|
+
return { range: range, newText: '', annotationId: annotation };
|
|
600
|
+
}
|
|
601
|
+
AnnotatedTextEdit.del = del;
|
|
602
|
+
function is(value) {
|
|
603
|
+
var candidate = value;
|
|
604
|
+
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
605
|
+
}
|
|
606
|
+
AnnotatedTextEdit.is = is;
|
|
607
|
+
})(AnnotatedTextEdit = exports.AnnotatedTextEdit || (exports.AnnotatedTextEdit = {}));
|
|
608
|
+
/**
|
|
609
|
+
* The TextDocumentEdit namespace provides helper function to create
|
|
610
|
+
* an edit that manipulates a text document.
|
|
611
|
+
*/
|
|
612
|
+
var TextDocumentEdit;
|
|
613
|
+
(function (TextDocumentEdit) {
|
|
614
|
+
/**
|
|
615
|
+
* Creates a new `TextDocumentEdit`
|
|
616
|
+
*/
|
|
617
|
+
function create(textDocument, edits) {
|
|
618
|
+
return { textDocument: textDocument, edits: edits };
|
|
619
|
+
}
|
|
620
|
+
TextDocumentEdit.create = create;
|
|
621
|
+
function is(value) {
|
|
622
|
+
var candidate = value;
|
|
623
|
+
return Is.defined(candidate)
|
|
624
|
+
&& OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
|
|
625
|
+
&& Array.isArray(candidate.edits);
|
|
626
|
+
}
|
|
627
|
+
TextDocumentEdit.is = is;
|
|
628
|
+
})(TextDocumentEdit = exports.TextDocumentEdit || (exports.TextDocumentEdit = {}));
|
|
629
|
+
var CreateFile;
|
|
630
|
+
(function (CreateFile) {
|
|
631
|
+
function create(uri, options, annotation) {
|
|
632
|
+
var result = {
|
|
633
|
+
kind: 'create',
|
|
634
|
+
uri: uri
|
|
635
|
+
};
|
|
636
|
+
if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
|
|
637
|
+
result.options = options;
|
|
638
|
+
}
|
|
639
|
+
if (annotation !== undefined) {
|
|
640
|
+
result.annotationId = annotation;
|
|
641
|
+
}
|
|
642
|
+
return result;
|
|
643
|
+
}
|
|
644
|
+
CreateFile.create = create;
|
|
645
|
+
function is(value) {
|
|
646
|
+
var candidate = value;
|
|
647
|
+
return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
|
|
648
|
+
((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
649
|
+
}
|
|
650
|
+
CreateFile.is = is;
|
|
651
|
+
})(CreateFile = exports.CreateFile || (exports.CreateFile = {}));
|
|
652
|
+
var RenameFile;
|
|
653
|
+
(function (RenameFile) {
|
|
654
|
+
function create(oldUri, newUri, options, annotation) {
|
|
655
|
+
var result = {
|
|
656
|
+
kind: 'rename',
|
|
657
|
+
oldUri: oldUri,
|
|
658
|
+
newUri: newUri
|
|
659
|
+
};
|
|
660
|
+
if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
|
|
661
|
+
result.options = options;
|
|
662
|
+
}
|
|
663
|
+
if (annotation !== undefined) {
|
|
664
|
+
result.annotationId = annotation;
|
|
665
|
+
}
|
|
666
|
+
return result;
|
|
667
|
+
}
|
|
668
|
+
RenameFile.create = create;
|
|
669
|
+
function is(value) {
|
|
670
|
+
var candidate = value;
|
|
671
|
+
return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
|
|
672
|
+
((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
673
|
+
}
|
|
674
|
+
RenameFile.is = is;
|
|
675
|
+
})(RenameFile = exports.RenameFile || (exports.RenameFile = {}));
|
|
676
|
+
var DeleteFile;
|
|
677
|
+
(function (DeleteFile) {
|
|
678
|
+
function create(uri, options, annotation) {
|
|
679
|
+
var result = {
|
|
680
|
+
kind: 'delete',
|
|
681
|
+
uri: uri
|
|
682
|
+
};
|
|
683
|
+
if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
|
|
684
|
+
result.options = options;
|
|
685
|
+
}
|
|
686
|
+
if (annotation !== undefined) {
|
|
687
|
+
result.annotationId = annotation;
|
|
688
|
+
}
|
|
689
|
+
return result;
|
|
690
|
+
}
|
|
691
|
+
DeleteFile.create = create;
|
|
692
|
+
function is(value) {
|
|
693
|
+
var candidate = value;
|
|
694
|
+
return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
|
|
695
|
+
((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
696
|
+
}
|
|
697
|
+
DeleteFile.is = is;
|
|
698
|
+
})(DeleteFile = exports.DeleteFile || (exports.DeleteFile = {}));
|
|
699
|
+
var WorkspaceEdit;
|
|
700
|
+
(function (WorkspaceEdit) {
|
|
701
|
+
function is(value) {
|
|
702
|
+
var candidate = value;
|
|
703
|
+
return candidate &&
|
|
704
|
+
(candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
|
|
705
|
+
(candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
|
|
706
|
+
if (Is.string(change.kind)) {
|
|
707
|
+
return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
return TextDocumentEdit.is(change);
|
|
711
|
+
}
|
|
712
|
+
}));
|
|
713
|
+
}
|
|
714
|
+
WorkspaceEdit.is = is;
|
|
715
|
+
})(WorkspaceEdit = exports.WorkspaceEdit || (exports.WorkspaceEdit = {}));
|
|
716
|
+
var TextEditChangeImpl = /** @class */ (function () {
|
|
717
|
+
function TextEditChangeImpl(edits, changeAnnotations) {
|
|
718
|
+
this.edits = edits;
|
|
719
|
+
this.changeAnnotations = changeAnnotations;
|
|
720
|
+
}
|
|
721
|
+
TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
|
|
722
|
+
var edit;
|
|
723
|
+
var id;
|
|
724
|
+
if (annotation === undefined) {
|
|
725
|
+
edit = TextEdit.insert(position, newText);
|
|
726
|
+
}
|
|
727
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
728
|
+
id = annotation;
|
|
729
|
+
edit = AnnotatedTextEdit.insert(position, newText, annotation);
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
733
|
+
id = this.changeAnnotations.manage(annotation);
|
|
734
|
+
edit = AnnotatedTextEdit.insert(position, newText, id);
|
|
735
|
+
}
|
|
736
|
+
this.edits.push(edit);
|
|
737
|
+
if (id !== undefined) {
|
|
738
|
+
return id;
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
|
|
742
|
+
var edit;
|
|
743
|
+
var id;
|
|
744
|
+
if (annotation === undefined) {
|
|
745
|
+
edit = TextEdit.replace(range, newText);
|
|
746
|
+
}
|
|
747
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
748
|
+
id = annotation;
|
|
749
|
+
edit = AnnotatedTextEdit.replace(range, newText, annotation);
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
753
|
+
id = this.changeAnnotations.manage(annotation);
|
|
754
|
+
edit = AnnotatedTextEdit.replace(range, newText, id);
|
|
755
|
+
}
|
|
756
|
+
this.edits.push(edit);
|
|
757
|
+
if (id !== undefined) {
|
|
758
|
+
return id;
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
TextEditChangeImpl.prototype.delete = function (range, annotation) {
|
|
762
|
+
var edit;
|
|
763
|
+
var id;
|
|
764
|
+
if (annotation === undefined) {
|
|
765
|
+
edit = TextEdit.del(range);
|
|
766
|
+
}
|
|
767
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
768
|
+
id = annotation;
|
|
769
|
+
edit = AnnotatedTextEdit.del(range, annotation);
|
|
770
|
+
}
|
|
771
|
+
else {
|
|
772
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
773
|
+
id = this.changeAnnotations.manage(annotation);
|
|
774
|
+
edit = AnnotatedTextEdit.del(range, id);
|
|
775
|
+
}
|
|
776
|
+
this.edits.push(edit);
|
|
777
|
+
if (id !== undefined) {
|
|
778
|
+
return id;
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
TextEditChangeImpl.prototype.add = function (edit) {
|
|
782
|
+
this.edits.push(edit);
|
|
783
|
+
};
|
|
784
|
+
TextEditChangeImpl.prototype.all = function () {
|
|
785
|
+
return this.edits;
|
|
786
|
+
};
|
|
787
|
+
TextEditChangeImpl.prototype.clear = function () {
|
|
788
|
+
this.edits.splice(0, this.edits.length);
|
|
789
|
+
};
|
|
790
|
+
TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
|
|
791
|
+
if (value === undefined) {
|
|
792
|
+
throw new Error("Text edit change is not configured to manage change annotations.");
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
return TextEditChangeImpl;
|
|
796
|
+
}());
|
|
797
|
+
/**
|
|
798
|
+
* A helper class
|
|
799
|
+
*/
|
|
800
|
+
var ChangeAnnotations = /** @class */ (function () {
|
|
801
|
+
function ChangeAnnotations(annotations) {
|
|
802
|
+
this._annotations = annotations === undefined ? Object.create(null) : annotations;
|
|
803
|
+
this._counter = 0;
|
|
804
|
+
this._size = 0;
|
|
805
|
+
}
|
|
806
|
+
ChangeAnnotations.prototype.all = function () {
|
|
807
|
+
return this._annotations;
|
|
808
|
+
};
|
|
809
|
+
Object.defineProperty(ChangeAnnotations.prototype, "size", {
|
|
810
|
+
get: function () {
|
|
811
|
+
return this._size;
|
|
812
|
+
},
|
|
813
|
+
enumerable: false,
|
|
814
|
+
configurable: true
|
|
815
|
+
});
|
|
816
|
+
ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
|
|
817
|
+
var id;
|
|
818
|
+
if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
|
|
819
|
+
id = idOrAnnotation;
|
|
820
|
+
}
|
|
821
|
+
else {
|
|
822
|
+
id = this.nextId();
|
|
823
|
+
annotation = idOrAnnotation;
|
|
824
|
+
}
|
|
825
|
+
if (this._annotations[id] !== undefined) {
|
|
826
|
+
throw new Error("Id " + id + " is already in use.");
|
|
827
|
+
}
|
|
828
|
+
if (annotation === undefined) {
|
|
829
|
+
throw new Error("No annotation provided for id " + id);
|
|
830
|
+
}
|
|
831
|
+
this._annotations[id] = annotation;
|
|
832
|
+
this._size++;
|
|
833
|
+
return id;
|
|
834
|
+
};
|
|
835
|
+
ChangeAnnotations.prototype.nextId = function () {
|
|
836
|
+
this._counter++;
|
|
837
|
+
return this._counter.toString();
|
|
838
|
+
};
|
|
839
|
+
return ChangeAnnotations;
|
|
840
|
+
}());
|
|
841
|
+
/**
|
|
842
|
+
* A workspace change helps constructing changes to a workspace.
|
|
843
|
+
*/
|
|
844
|
+
var WorkspaceChange = /** @class */ (function () {
|
|
845
|
+
function WorkspaceChange(workspaceEdit) {
|
|
846
|
+
var _this = this;
|
|
847
|
+
this._textEditChanges = Object.create(null);
|
|
848
|
+
if (workspaceEdit !== undefined) {
|
|
849
|
+
this._workspaceEdit = workspaceEdit;
|
|
850
|
+
if (workspaceEdit.documentChanges) {
|
|
851
|
+
this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
|
|
852
|
+
workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
853
|
+
workspaceEdit.documentChanges.forEach(function (change) {
|
|
854
|
+
if (TextDocumentEdit.is(change)) {
|
|
855
|
+
var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
|
|
856
|
+
_this._textEditChanges[change.textDocument.uri] = textEditChange;
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
else if (workspaceEdit.changes) {
|
|
861
|
+
Object.keys(workspaceEdit.changes).forEach(function (key) {
|
|
862
|
+
var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
|
863
|
+
_this._textEditChanges[key] = textEditChange;
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
this._workspaceEdit = {};
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
Object.defineProperty(WorkspaceChange.prototype, "edit", {
|
|
872
|
+
/**
|
|
873
|
+
* Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal
|
|
874
|
+
* use to be returned from a workspace edit operation like rename.
|
|
875
|
+
*/
|
|
876
|
+
get: function () {
|
|
877
|
+
this.initDocumentChanges();
|
|
878
|
+
if (this._changeAnnotations !== undefined) {
|
|
879
|
+
if (this._changeAnnotations.size === 0) {
|
|
880
|
+
this._workspaceEdit.changeAnnotations = undefined;
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
return this._workspaceEdit;
|
|
887
|
+
},
|
|
888
|
+
enumerable: false,
|
|
889
|
+
configurable: true
|
|
890
|
+
});
|
|
891
|
+
WorkspaceChange.prototype.getTextEditChange = function (key) {
|
|
892
|
+
if (OptionalVersionedTextDocumentIdentifier.is(key)) {
|
|
893
|
+
this.initDocumentChanges();
|
|
894
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
895
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
896
|
+
}
|
|
897
|
+
var textDocument = { uri: key.uri, version: key.version };
|
|
898
|
+
var result = this._textEditChanges[textDocument.uri];
|
|
899
|
+
if (!result) {
|
|
900
|
+
var edits = [];
|
|
901
|
+
var textDocumentEdit = {
|
|
902
|
+
textDocument: textDocument,
|
|
903
|
+
edits: edits
|
|
904
|
+
};
|
|
905
|
+
this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
|
906
|
+
result = new TextEditChangeImpl(edits, this._changeAnnotations);
|
|
907
|
+
this._textEditChanges[textDocument.uri] = result;
|
|
908
|
+
}
|
|
909
|
+
return result;
|
|
910
|
+
}
|
|
911
|
+
else {
|
|
912
|
+
this.initChanges();
|
|
913
|
+
if (this._workspaceEdit.changes === undefined) {
|
|
914
|
+
throw new Error('Workspace edit is not configured for normal text edit changes.');
|
|
915
|
+
}
|
|
916
|
+
var result = this._textEditChanges[key];
|
|
917
|
+
if (!result) {
|
|
918
|
+
var edits = [];
|
|
919
|
+
this._workspaceEdit.changes[key] = edits;
|
|
920
|
+
result = new TextEditChangeImpl(edits);
|
|
921
|
+
this._textEditChanges[key] = result;
|
|
922
|
+
}
|
|
923
|
+
return result;
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
WorkspaceChange.prototype.initDocumentChanges = function () {
|
|
927
|
+
if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
|
|
928
|
+
this._changeAnnotations = new ChangeAnnotations();
|
|
929
|
+
this._workspaceEdit.documentChanges = [];
|
|
930
|
+
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
WorkspaceChange.prototype.initChanges = function () {
|
|
934
|
+
if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
|
|
935
|
+
this._workspaceEdit.changes = Object.create(null);
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
|
|
939
|
+
this.initDocumentChanges();
|
|
940
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
941
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
942
|
+
}
|
|
943
|
+
var annotation;
|
|
944
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
945
|
+
annotation = optionsOrAnnotation;
|
|
946
|
+
}
|
|
947
|
+
else {
|
|
948
|
+
options = optionsOrAnnotation;
|
|
949
|
+
}
|
|
950
|
+
var operation;
|
|
951
|
+
var id;
|
|
952
|
+
if (annotation === undefined) {
|
|
953
|
+
operation = CreateFile.create(uri, options);
|
|
954
|
+
}
|
|
955
|
+
else {
|
|
956
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
957
|
+
operation = CreateFile.create(uri, options, id);
|
|
958
|
+
}
|
|
959
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
960
|
+
if (id !== undefined) {
|
|
961
|
+
return id;
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
|
|
965
|
+
this.initDocumentChanges();
|
|
966
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
967
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
968
|
+
}
|
|
969
|
+
var annotation;
|
|
970
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
971
|
+
annotation = optionsOrAnnotation;
|
|
972
|
+
}
|
|
973
|
+
else {
|
|
974
|
+
options = optionsOrAnnotation;
|
|
975
|
+
}
|
|
976
|
+
var operation;
|
|
977
|
+
var id;
|
|
978
|
+
if (annotation === undefined) {
|
|
979
|
+
operation = RenameFile.create(oldUri, newUri, options);
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
983
|
+
operation = RenameFile.create(oldUri, newUri, options, id);
|
|
984
|
+
}
|
|
985
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
986
|
+
if (id !== undefined) {
|
|
987
|
+
return id;
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
|
|
991
|
+
this.initDocumentChanges();
|
|
992
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
993
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
994
|
+
}
|
|
995
|
+
var annotation;
|
|
996
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
997
|
+
annotation = optionsOrAnnotation;
|
|
998
|
+
}
|
|
999
|
+
else {
|
|
1000
|
+
options = optionsOrAnnotation;
|
|
1001
|
+
}
|
|
1002
|
+
var operation;
|
|
1003
|
+
var id;
|
|
1004
|
+
if (annotation === undefined) {
|
|
1005
|
+
operation = DeleteFile.create(uri, options);
|
|
1006
|
+
}
|
|
1007
|
+
else {
|
|
1008
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
1009
|
+
operation = DeleteFile.create(uri, options, id);
|
|
1010
|
+
}
|
|
1011
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
1012
|
+
if (id !== undefined) {
|
|
1013
|
+
return id;
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
return WorkspaceChange;
|
|
1017
|
+
}());
|
|
1018
|
+
exports.WorkspaceChange = WorkspaceChange;
|
|
1019
|
+
/**
|
|
1020
|
+
* The TextDocumentIdentifier namespace provides helper functions to work with
|
|
1021
|
+
* [TextDocumentIdentifier](#TextDocumentIdentifier) literals.
|
|
1022
|
+
*/
|
|
1023
|
+
var TextDocumentIdentifier;
|
|
1024
|
+
(function (TextDocumentIdentifier) {
|
|
1025
|
+
/**
|
|
1026
|
+
* Creates a new TextDocumentIdentifier literal.
|
|
1027
|
+
* @param uri The document's uri.
|
|
1028
|
+
*/
|
|
1029
|
+
function create(uri) {
|
|
1030
|
+
return { uri: uri };
|
|
1031
|
+
}
|
|
1032
|
+
TextDocumentIdentifier.create = create;
|
|
1033
|
+
/**
|
|
1034
|
+
* Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.
|
|
1035
|
+
*/
|
|
1036
|
+
function is(value) {
|
|
1037
|
+
var candidate = value;
|
|
1038
|
+
return Is.defined(candidate) && Is.string(candidate.uri);
|
|
1039
|
+
}
|
|
1040
|
+
TextDocumentIdentifier.is = is;
|
|
1041
|
+
})(TextDocumentIdentifier = exports.TextDocumentIdentifier || (exports.TextDocumentIdentifier = {}));
|
|
1042
|
+
/**
|
|
1043
|
+
* The VersionedTextDocumentIdentifier namespace provides helper functions to work with
|
|
1044
|
+
* [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.
|
|
1045
|
+
*/
|
|
1046
|
+
var VersionedTextDocumentIdentifier;
|
|
1047
|
+
(function (VersionedTextDocumentIdentifier) {
|
|
1048
|
+
/**
|
|
1049
|
+
* Creates a new VersionedTextDocumentIdentifier literal.
|
|
1050
|
+
* @param uri The document's uri.
|
|
1051
|
+
* @param uri The document's text.
|
|
1052
|
+
*/
|
|
1053
|
+
function create(uri, version) {
|
|
1054
|
+
return { uri: uri, version: version };
|
|
1055
|
+
}
|
|
1056
|
+
VersionedTextDocumentIdentifier.create = create;
|
|
1057
|
+
/**
|
|
1058
|
+
* Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.
|
|
1059
|
+
*/
|
|
1060
|
+
function is(value) {
|
|
1061
|
+
var candidate = value;
|
|
1062
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
|
|
1063
|
+
}
|
|
1064
|
+
VersionedTextDocumentIdentifier.is = is;
|
|
1065
|
+
})(VersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = {}));
|
|
1066
|
+
/**
|
|
1067
|
+
* The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
|
|
1068
|
+
* [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) literals.
|
|
1069
|
+
*/
|
|
1070
|
+
var OptionalVersionedTextDocumentIdentifier;
|
|
1071
|
+
(function (OptionalVersionedTextDocumentIdentifier) {
|
|
1072
|
+
/**
|
|
1073
|
+
* Creates a new OptionalVersionedTextDocumentIdentifier literal.
|
|
1074
|
+
* @param uri The document's uri.
|
|
1075
|
+
* @param uri The document's text.
|
|
1076
|
+
*/
|
|
1077
|
+
function create(uri, version) {
|
|
1078
|
+
return { uri: uri, version: version };
|
|
1079
|
+
}
|
|
1080
|
+
OptionalVersionedTextDocumentIdentifier.create = create;
|
|
1081
|
+
/**
|
|
1082
|
+
* Checks whether the given literal conforms to the [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) interface.
|
|
1083
|
+
*/
|
|
1084
|
+
function is(value) {
|
|
1085
|
+
var candidate = value;
|
|
1086
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
|
|
1087
|
+
}
|
|
1088
|
+
OptionalVersionedTextDocumentIdentifier.is = is;
|
|
1089
|
+
})(OptionalVersionedTextDocumentIdentifier = exports.OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = {}));
|
|
1090
|
+
/**
|
|
1091
|
+
* The TextDocumentItem namespace provides helper functions to work with
|
|
1092
|
+
* [TextDocumentItem](#TextDocumentItem) literals.
|
|
1093
|
+
*/
|
|
1094
|
+
var TextDocumentItem;
|
|
1095
|
+
(function (TextDocumentItem) {
|
|
1096
|
+
/**
|
|
1097
|
+
* Creates a new TextDocumentItem literal.
|
|
1098
|
+
* @param uri The document's uri.
|
|
1099
|
+
* @param languageId The document's language identifier.
|
|
1100
|
+
* @param version The document's version number.
|
|
1101
|
+
* @param text The document's text.
|
|
1102
|
+
*/
|
|
1103
|
+
function create(uri, languageId, version, text) {
|
|
1104
|
+
return { uri: uri, languageId: languageId, version: version, text: text };
|
|
1105
|
+
}
|
|
1106
|
+
TextDocumentItem.create = create;
|
|
1107
|
+
/**
|
|
1108
|
+
* Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.
|
|
1109
|
+
*/
|
|
1110
|
+
function is(value) {
|
|
1111
|
+
var candidate = value;
|
|
1112
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
|
|
1113
|
+
}
|
|
1114
|
+
TextDocumentItem.is = is;
|
|
1115
|
+
})(TextDocumentItem = exports.TextDocumentItem || (exports.TextDocumentItem = {}));
|
|
1116
|
+
/**
|
|
1117
|
+
* Describes the content type that a client supports in various
|
|
1118
|
+
* result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
|
|
1119
|
+
*
|
|
1120
|
+
* Please note that `MarkupKinds` must not start with a `$`. This kinds
|
|
1121
|
+
* are reserved for internal usage.
|
|
1122
|
+
*/
|
|
1123
|
+
var MarkupKind;
|
|
1124
|
+
(function (MarkupKind) {
|
|
1125
|
+
/**
|
|
1126
|
+
* Plain text is supported as a content format
|
|
1127
|
+
*/
|
|
1128
|
+
MarkupKind.PlainText = 'plaintext';
|
|
1129
|
+
/**
|
|
1130
|
+
* Markdown is supported as a content format
|
|
1131
|
+
*/
|
|
1132
|
+
MarkupKind.Markdown = 'markdown';
|
|
1133
|
+
})(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
|
|
1134
|
+
(function (MarkupKind) {
|
|
1135
|
+
/**
|
|
1136
|
+
* Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.
|
|
1137
|
+
*/
|
|
1138
|
+
function is(value) {
|
|
1139
|
+
var candidate = value;
|
|
1140
|
+
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
|
1141
|
+
}
|
|
1142
|
+
MarkupKind.is = is;
|
|
1143
|
+
})(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
|
|
1144
|
+
var MarkupContent;
|
|
1145
|
+
(function (MarkupContent) {
|
|
1146
|
+
/**
|
|
1147
|
+
* Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.
|
|
1148
|
+
*/
|
|
1149
|
+
function is(value) {
|
|
1150
|
+
var candidate = value;
|
|
1151
|
+
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
|
1152
|
+
}
|
|
1153
|
+
MarkupContent.is = is;
|
|
1154
|
+
})(MarkupContent = exports.MarkupContent || (exports.MarkupContent = {}));
|
|
1155
|
+
/**
|
|
1156
|
+
* The kind of a completion entry.
|
|
1157
|
+
*/
|
|
1158
|
+
var CompletionItemKind;
|
|
1159
|
+
(function (CompletionItemKind) {
|
|
1160
|
+
CompletionItemKind.Text = 1;
|
|
1161
|
+
CompletionItemKind.Method = 2;
|
|
1162
|
+
CompletionItemKind.Function = 3;
|
|
1163
|
+
CompletionItemKind.Constructor = 4;
|
|
1164
|
+
CompletionItemKind.Field = 5;
|
|
1165
|
+
CompletionItemKind.Variable = 6;
|
|
1166
|
+
CompletionItemKind.Class = 7;
|
|
1167
|
+
CompletionItemKind.Interface = 8;
|
|
1168
|
+
CompletionItemKind.Module = 9;
|
|
1169
|
+
CompletionItemKind.Property = 10;
|
|
1170
|
+
CompletionItemKind.Unit = 11;
|
|
1171
|
+
CompletionItemKind.Value = 12;
|
|
1172
|
+
CompletionItemKind.Enum = 13;
|
|
1173
|
+
CompletionItemKind.Keyword = 14;
|
|
1174
|
+
CompletionItemKind.Snippet = 15;
|
|
1175
|
+
CompletionItemKind.Color = 16;
|
|
1176
|
+
CompletionItemKind.File = 17;
|
|
1177
|
+
CompletionItemKind.Reference = 18;
|
|
1178
|
+
CompletionItemKind.Folder = 19;
|
|
1179
|
+
CompletionItemKind.EnumMember = 20;
|
|
1180
|
+
CompletionItemKind.Constant = 21;
|
|
1181
|
+
CompletionItemKind.Struct = 22;
|
|
1182
|
+
CompletionItemKind.Event = 23;
|
|
1183
|
+
CompletionItemKind.Operator = 24;
|
|
1184
|
+
CompletionItemKind.TypeParameter = 25;
|
|
1185
|
+
})(CompletionItemKind = exports.CompletionItemKind || (exports.CompletionItemKind = {}));
|
|
1186
|
+
/**
|
|
1187
|
+
* Defines whether the insert text in a completion item should be interpreted as
|
|
1188
|
+
* plain text or a snippet.
|
|
1189
|
+
*/
|
|
1190
|
+
var InsertTextFormat;
|
|
1191
|
+
(function (InsertTextFormat) {
|
|
1192
|
+
/**
|
|
1193
|
+
* The primary text to be inserted is treated as a plain string.
|
|
1194
|
+
*/
|
|
1195
|
+
InsertTextFormat.PlainText = 1;
|
|
1196
|
+
/**
|
|
1197
|
+
* The primary text to be inserted is treated as a snippet.
|
|
1198
|
+
*
|
|
1199
|
+
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
|
1200
|
+
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
|
1201
|
+
* the end of the snippet. Placeholders with equal identifiers are linked,
|
|
1202
|
+
* that is typing in one will update others too.
|
|
1203
|
+
*
|
|
1204
|
+
* See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
|
|
1205
|
+
*/
|
|
1206
|
+
InsertTextFormat.Snippet = 2;
|
|
1207
|
+
})(InsertTextFormat = exports.InsertTextFormat || (exports.InsertTextFormat = {}));
|
|
1208
|
+
/**
|
|
1209
|
+
* Completion item tags are extra annotations that tweak the rendering of a completion
|
|
1210
|
+
* item.
|
|
1211
|
+
*
|
|
1212
|
+
* @since 3.15.0
|
|
1213
|
+
*/
|
|
1214
|
+
var CompletionItemTag;
|
|
1215
|
+
(function (CompletionItemTag) {
|
|
1216
|
+
/**
|
|
1217
|
+
* Render a completion as obsolete, usually using a strike-out.
|
|
1218
|
+
*/
|
|
1219
|
+
CompletionItemTag.Deprecated = 1;
|
|
1220
|
+
})(CompletionItemTag = exports.CompletionItemTag || (exports.CompletionItemTag = {}));
|
|
1221
|
+
/**
|
|
1222
|
+
* The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
|
|
1223
|
+
*
|
|
1224
|
+
* @since 3.16.0
|
|
1225
|
+
*/
|
|
1226
|
+
var InsertReplaceEdit;
|
|
1227
|
+
(function (InsertReplaceEdit) {
|
|
1228
|
+
/**
|
|
1229
|
+
* Creates a new insert / replace edit
|
|
1230
|
+
*/
|
|
1231
|
+
function create(newText, insert, replace) {
|
|
1232
|
+
return { newText: newText, insert: insert, replace: replace };
|
|
1233
|
+
}
|
|
1234
|
+
InsertReplaceEdit.create = create;
|
|
1235
|
+
/**
|
|
1236
|
+
* Checks whether the given literal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface.
|
|
1237
|
+
*/
|
|
1238
|
+
function is(value) {
|
|
1239
|
+
var candidate = value;
|
|
1240
|
+
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
|
|
1241
|
+
}
|
|
1242
|
+
InsertReplaceEdit.is = is;
|
|
1243
|
+
})(InsertReplaceEdit = exports.InsertReplaceEdit || (exports.InsertReplaceEdit = {}));
|
|
1244
|
+
/**
|
|
1245
|
+
* How whitespace and indentation is handled during completion
|
|
1246
|
+
* item insertion.
|
|
1247
|
+
*
|
|
1248
|
+
* @since 3.16.0
|
|
1249
|
+
*/
|
|
1250
|
+
var InsertTextMode;
|
|
1251
|
+
(function (InsertTextMode) {
|
|
1252
|
+
/**
|
|
1253
|
+
* The insertion or replace strings is taken as it is. If the
|
|
1254
|
+
* value is multi line the lines below the cursor will be
|
|
1255
|
+
* inserted using the indentation defined in the string value.
|
|
1256
|
+
* The client will not apply any kind of adjustments to the
|
|
1257
|
+
* string.
|
|
1258
|
+
*/
|
|
1259
|
+
InsertTextMode.asIs = 1;
|
|
1260
|
+
/**
|
|
1261
|
+
* The editor adjusts leading whitespace of new lines so that
|
|
1262
|
+
* they match the indentation up to the cursor of the line for
|
|
1263
|
+
* which the item is accepted.
|
|
1264
|
+
*
|
|
1265
|
+
* Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
|
|
1266
|
+
* multi line completion item is indented using 2 tabs and all
|
|
1267
|
+
* following lines inserted will be indented using 2 tabs as well.
|
|
1268
|
+
*/
|
|
1269
|
+
InsertTextMode.adjustIndentation = 2;
|
|
1270
|
+
})(InsertTextMode = exports.InsertTextMode || (exports.InsertTextMode = {}));
|
|
1271
|
+
/**
|
|
1272
|
+
* The CompletionItem namespace provides functions to deal with
|
|
1273
|
+
* completion items.
|
|
1274
|
+
*/
|
|
1275
|
+
var CompletionItem;
|
|
1276
|
+
(function (CompletionItem) {
|
|
1277
|
+
/**
|
|
1278
|
+
* Create a completion item and seed it with a label.
|
|
1279
|
+
* @param label The completion item's label
|
|
1280
|
+
*/
|
|
1281
|
+
function create(label) {
|
|
1282
|
+
return { label: label };
|
|
1283
|
+
}
|
|
1284
|
+
CompletionItem.create = create;
|
|
1285
|
+
})(CompletionItem = exports.CompletionItem || (exports.CompletionItem = {}));
|
|
1286
|
+
/**
|
|
1287
|
+
* The CompletionList namespace provides functions to deal with
|
|
1288
|
+
* completion lists.
|
|
1289
|
+
*/
|
|
1290
|
+
var CompletionList;
|
|
1291
|
+
(function (CompletionList) {
|
|
1292
|
+
/**
|
|
1293
|
+
* Creates a new completion list.
|
|
1294
|
+
*
|
|
1295
|
+
* @param items The completion items.
|
|
1296
|
+
* @param isIncomplete The list is not complete.
|
|
1297
|
+
*/
|
|
1298
|
+
function create(items, isIncomplete) {
|
|
1299
|
+
return { items: items ? items : [], isIncomplete: !!isIncomplete };
|
|
1300
|
+
}
|
|
1301
|
+
CompletionList.create = create;
|
|
1302
|
+
})(CompletionList = exports.CompletionList || (exports.CompletionList = {}));
|
|
1303
|
+
var MarkedString;
|
|
1304
|
+
(function (MarkedString) {
|
|
1305
|
+
/**
|
|
1306
|
+
* Creates a marked string from plain text.
|
|
1307
|
+
*
|
|
1308
|
+
* @param plainText The plain text.
|
|
1309
|
+
*/
|
|
1310
|
+
function fromPlainText(plainText) {
|
|
1311
|
+
return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
|
|
1312
|
+
}
|
|
1313
|
+
MarkedString.fromPlainText = fromPlainText;
|
|
1314
|
+
/**
|
|
1315
|
+
* Checks whether the given value conforms to the [MarkedString](#MarkedString) type.
|
|
1316
|
+
*/
|
|
1317
|
+
function is(value) {
|
|
1318
|
+
var candidate = value;
|
|
1319
|
+
return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
|
|
1320
|
+
}
|
|
1321
|
+
MarkedString.is = is;
|
|
1322
|
+
})(MarkedString = exports.MarkedString || (exports.MarkedString = {}));
|
|
1323
|
+
var Hover;
|
|
1324
|
+
(function (Hover) {
|
|
1325
|
+
/**
|
|
1326
|
+
* Checks whether the given value conforms to the [Hover](#Hover) interface.
|
|
1327
|
+
*/
|
|
1328
|
+
function is(value) {
|
|
1329
|
+
var candidate = value;
|
|
1330
|
+
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
|
|
1331
|
+
MarkedString.is(candidate.contents) ||
|
|
1332
|
+
Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
|
|
1333
|
+
}
|
|
1334
|
+
Hover.is = is;
|
|
1335
|
+
})(Hover = exports.Hover || (exports.Hover = {}));
|
|
1336
|
+
/**
|
|
1337
|
+
* The ParameterInformation namespace provides helper functions to work with
|
|
1338
|
+
* [ParameterInformation](#ParameterInformation) literals.
|
|
1339
|
+
*/
|
|
1340
|
+
var ParameterInformation;
|
|
1341
|
+
(function (ParameterInformation) {
|
|
1342
|
+
/**
|
|
1343
|
+
* Creates a new parameter information literal.
|
|
1344
|
+
*
|
|
1345
|
+
* @param label A label string.
|
|
1346
|
+
* @param documentation A doc string.
|
|
1347
|
+
*/
|
|
1348
|
+
function create(label, documentation) {
|
|
1349
|
+
return documentation ? { label: label, documentation: documentation } : { label: label };
|
|
1350
|
+
}
|
|
1351
|
+
ParameterInformation.create = create;
|
|
1352
|
+
})(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
|
|
1353
|
+
/**
|
|
1354
|
+
* The SignatureInformation namespace provides helper functions to work with
|
|
1355
|
+
* [SignatureInformation](#SignatureInformation) literals.
|
|
1356
|
+
*/
|
|
1357
|
+
var SignatureInformation;
|
|
1358
|
+
(function (SignatureInformation) {
|
|
1359
|
+
function create(label, documentation) {
|
|
1360
|
+
var parameters = [];
|
|
1361
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1362
|
+
parameters[_i - 2] = arguments[_i];
|
|
1363
|
+
}
|
|
1364
|
+
var result = { label: label };
|
|
1365
|
+
if (Is.defined(documentation)) {
|
|
1366
|
+
result.documentation = documentation;
|
|
1367
|
+
}
|
|
1368
|
+
if (Is.defined(parameters)) {
|
|
1369
|
+
result.parameters = parameters;
|
|
1370
|
+
}
|
|
1371
|
+
else {
|
|
1372
|
+
result.parameters = [];
|
|
1373
|
+
}
|
|
1374
|
+
return result;
|
|
1375
|
+
}
|
|
1376
|
+
SignatureInformation.create = create;
|
|
1377
|
+
})(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {}));
|
|
1378
|
+
/**
|
|
1379
|
+
* A document highlight kind.
|
|
1380
|
+
*/
|
|
1381
|
+
var DocumentHighlightKind;
|
|
1382
|
+
(function (DocumentHighlightKind) {
|
|
1383
|
+
/**
|
|
1384
|
+
* A textual occurrence.
|
|
1385
|
+
*/
|
|
1386
|
+
DocumentHighlightKind.Text = 1;
|
|
1387
|
+
/**
|
|
1388
|
+
* Read-access of a symbol, like reading a variable.
|
|
1389
|
+
*/
|
|
1390
|
+
DocumentHighlightKind.Read = 2;
|
|
1391
|
+
/**
|
|
1392
|
+
* Write-access of a symbol, like writing to a variable.
|
|
1393
|
+
*/
|
|
1394
|
+
DocumentHighlightKind.Write = 3;
|
|
1395
|
+
})(DocumentHighlightKind = exports.DocumentHighlightKind || (exports.DocumentHighlightKind = {}));
|
|
1396
|
+
/**
|
|
1397
|
+
* DocumentHighlight namespace to provide helper functions to work with
|
|
1398
|
+
* [DocumentHighlight](#DocumentHighlight) literals.
|
|
1399
|
+
*/
|
|
1400
|
+
var DocumentHighlight;
|
|
1401
|
+
(function (DocumentHighlight) {
|
|
1402
|
+
/**
|
|
1403
|
+
* Create a DocumentHighlight object.
|
|
1404
|
+
* @param range The range the highlight applies to.
|
|
1405
|
+
*/
|
|
1406
|
+
function create(range, kind) {
|
|
1407
|
+
var result = { range: range };
|
|
1408
|
+
if (Is.number(kind)) {
|
|
1409
|
+
result.kind = kind;
|
|
1410
|
+
}
|
|
1411
|
+
return result;
|
|
1412
|
+
}
|
|
1413
|
+
DocumentHighlight.create = create;
|
|
1414
|
+
})(DocumentHighlight = exports.DocumentHighlight || (exports.DocumentHighlight = {}));
|
|
1415
|
+
/**
|
|
1416
|
+
* A symbol kind.
|
|
1417
|
+
*/
|
|
1418
|
+
var SymbolKind;
|
|
1419
|
+
(function (SymbolKind) {
|
|
1420
|
+
SymbolKind.File = 1;
|
|
1421
|
+
SymbolKind.Module = 2;
|
|
1422
|
+
SymbolKind.Namespace = 3;
|
|
1423
|
+
SymbolKind.Package = 4;
|
|
1424
|
+
SymbolKind.Class = 5;
|
|
1425
|
+
SymbolKind.Method = 6;
|
|
1426
|
+
SymbolKind.Property = 7;
|
|
1427
|
+
SymbolKind.Field = 8;
|
|
1428
|
+
SymbolKind.Constructor = 9;
|
|
1429
|
+
SymbolKind.Enum = 10;
|
|
1430
|
+
SymbolKind.Interface = 11;
|
|
1431
|
+
SymbolKind.Function = 12;
|
|
1432
|
+
SymbolKind.Variable = 13;
|
|
1433
|
+
SymbolKind.Constant = 14;
|
|
1434
|
+
SymbolKind.String = 15;
|
|
1435
|
+
SymbolKind.Number = 16;
|
|
1436
|
+
SymbolKind.Boolean = 17;
|
|
1437
|
+
SymbolKind.Array = 18;
|
|
1438
|
+
SymbolKind.Object = 19;
|
|
1439
|
+
SymbolKind.Key = 20;
|
|
1440
|
+
SymbolKind.Null = 21;
|
|
1441
|
+
SymbolKind.EnumMember = 22;
|
|
1442
|
+
SymbolKind.Struct = 23;
|
|
1443
|
+
SymbolKind.Event = 24;
|
|
1444
|
+
SymbolKind.Operator = 25;
|
|
1445
|
+
SymbolKind.TypeParameter = 26;
|
|
1446
|
+
})(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
|
|
1447
|
+
/**
|
|
1448
|
+
* Symbol tags are extra annotations that tweak the rendering of a symbol.
|
|
1449
|
+
* @since 3.16
|
|
1450
|
+
*/
|
|
1451
|
+
var SymbolTag;
|
|
1452
|
+
(function (SymbolTag) {
|
|
1453
|
+
/**
|
|
1454
|
+
* Render a symbol as obsolete, usually using a strike-out.
|
|
1455
|
+
*/
|
|
1456
|
+
SymbolTag.Deprecated = 1;
|
|
1457
|
+
})(SymbolTag = exports.SymbolTag || (exports.SymbolTag = {}));
|
|
1458
|
+
var SymbolInformation;
|
|
1459
|
+
(function (SymbolInformation) {
|
|
1460
|
+
/**
|
|
1461
|
+
* Creates a new symbol information literal.
|
|
1462
|
+
*
|
|
1463
|
+
* @param name The name of the symbol.
|
|
1464
|
+
* @param kind The kind of the symbol.
|
|
1465
|
+
* @param range The range of the location of the symbol.
|
|
1466
|
+
* @param uri The resource of the location of symbol, defaults to the current document.
|
|
1467
|
+
* @param containerName The name of the symbol containing the symbol.
|
|
1468
|
+
*/
|
|
1469
|
+
function create(name, kind, range, uri, containerName) {
|
|
1470
|
+
var result = {
|
|
1471
|
+
name: name,
|
|
1472
|
+
kind: kind,
|
|
1473
|
+
location: { uri: uri, range: range }
|
|
1474
|
+
};
|
|
1475
|
+
if (containerName) {
|
|
1476
|
+
result.containerName = containerName;
|
|
1477
|
+
}
|
|
1478
|
+
return result;
|
|
1479
|
+
}
|
|
1480
|
+
SymbolInformation.create = create;
|
|
1481
|
+
})(SymbolInformation = exports.SymbolInformation || (exports.SymbolInformation = {}));
|
|
1482
|
+
var DocumentSymbol;
|
|
1483
|
+
(function (DocumentSymbol) {
|
|
1484
|
+
/**
|
|
1485
|
+
* Creates a new symbol information literal.
|
|
1486
|
+
*
|
|
1487
|
+
* @param name The name of the symbol.
|
|
1488
|
+
* @param detail The detail of the symbol.
|
|
1489
|
+
* @param kind The kind of the symbol.
|
|
1490
|
+
* @param range The range of the symbol.
|
|
1491
|
+
* @param selectionRange The selectionRange of the symbol.
|
|
1492
|
+
* @param children Children of the symbol.
|
|
1493
|
+
*/
|
|
1494
|
+
function create(name, detail, kind, range, selectionRange, children) {
|
|
1495
|
+
var result = {
|
|
1496
|
+
name: name,
|
|
1497
|
+
detail: detail,
|
|
1498
|
+
kind: kind,
|
|
1499
|
+
range: range,
|
|
1500
|
+
selectionRange: selectionRange
|
|
1501
|
+
};
|
|
1502
|
+
if (children !== undefined) {
|
|
1503
|
+
result.children = children;
|
|
1504
|
+
}
|
|
1505
|
+
return result;
|
|
1506
|
+
}
|
|
1507
|
+
DocumentSymbol.create = create;
|
|
1508
|
+
/**
|
|
1509
|
+
* Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.
|
|
1510
|
+
*/
|
|
1511
|
+
function is(value) {
|
|
1512
|
+
var candidate = value;
|
|
1513
|
+
return candidate &&
|
|
1514
|
+
Is.string(candidate.name) && Is.number(candidate.kind) &&
|
|
1515
|
+
Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
|
|
1516
|
+
(candidate.detail === undefined || Is.string(candidate.detail)) &&
|
|
1517
|
+
(candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&
|
|
1518
|
+
(candidate.children === undefined || Array.isArray(candidate.children)) &&
|
|
1519
|
+
(candidate.tags === undefined || Array.isArray(candidate.tags));
|
|
1520
|
+
}
|
|
1521
|
+
DocumentSymbol.is = is;
|
|
1522
|
+
})(DocumentSymbol = exports.DocumentSymbol || (exports.DocumentSymbol = {}));
|
|
1523
|
+
/**
|
|
1524
|
+
* A set of predefined code action kinds
|
|
1525
|
+
*/
|
|
1526
|
+
var CodeActionKind;
|
|
1527
|
+
(function (CodeActionKind) {
|
|
1528
|
+
/**
|
|
1529
|
+
* Empty kind.
|
|
1530
|
+
*/
|
|
1531
|
+
CodeActionKind.Empty = '';
|
|
1532
|
+
/**
|
|
1533
|
+
* Base kind for quickfix actions: 'quickfix'
|
|
1534
|
+
*/
|
|
1535
|
+
CodeActionKind.QuickFix = 'quickfix';
|
|
1536
|
+
/**
|
|
1537
|
+
* Base kind for refactoring actions: 'refactor'
|
|
1538
|
+
*/
|
|
1539
|
+
CodeActionKind.Refactor = 'refactor';
|
|
1540
|
+
/**
|
|
1541
|
+
* Base kind for refactoring extraction actions: 'refactor.extract'
|
|
1542
|
+
*
|
|
1543
|
+
* Example extract actions:
|
|
1544
|
+
*
|
|
1545
|
+
* - Extract method
|
|
1546
|
+
* - Extract function
|
|
1547
|
+
* - Extract variable
|
|
1548
|
+
* - Extract interface from class
|
|
1549
|
+
* - ...
|
|
1550
|
+
*/
|
|
1551
|
+
CodeActionKind.RefactorExtract = 'refactor.extract';
|
|
1552
|
+
/**
|
|
1553
|
+
* Base kind for refactoring inline actions: 'refactor.inline'
|
|
1554
|
+
*
|
|
1555
|
+
* Example inline actions:
|
|
1556
|
+
*
|
|
1557
|
+
* - Inline function
|
|
1558
|
+
* - Inline variable
|
|
1559
|
+
* - Inline constant
|
|
1560
|
+
* - ...
|
|
1561
|
+
*/
|
|
1562
|
+
CodeActionKind.RefactorInline = 'refactor.inline';
|
|
1563
|
+
/**
|
|
1564
|
+
* Base kind for refactoring rewrite actions: 'refactor.rewrite'
|
|
1565
|
+
*
|
|
1566
|
+
* Example rewrite actions:
|
|
1567
|
+
*
|
|
1568
|
+
* - Convert JavaScript function to class
|
|
1569
|
+
* - Add or remove parameter
|
|
1570
|
+
* - Encapsulate field
|
|
1571
|
+
* - Make method static
|
|
1572
|
+
* - Move method to base class
|
|
1573
|
+
* - ...
|
|
1574
|
+
*/
|
|
1575
|
+
CodeActionKind.RefactorRewrite = 'refactor.rewrite';
|
|
1576
|
+
/**
|
|
1577
|
+
* Base kind for source actions: `source`
|
|
1578
|
+
*
|
|
1579
|
+
* Source code actions apply to the entire file.
|
|
1580
|
+
*/
|
|
1581
|
+
CodeActionKind.Source = 'source';
|
|
1582
|
+
/**
|
|
1583
|
+
* Base kind for an organize imports source action: `source.organizeImports`
|
|
1584
|
+
*/
|
|
1585
|
+
CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
|
|
1586
|
+
/**
|
|
1587
|
+
* Base kind for auto-fix source actions: `source.fixAll`.
|
|
1588
|
+
*
|
|
1589
|
+
* Fix all actions automatically fix errors that have a clear fix that do not require user input.
|
|
1590
|
+
* They should not suppress errors or perform unsafe fixes such as generating new types or classes.
|
|
1591
|
+
*
|
|
1592
|
+
* @since 3.15.0
|
|
1593
|
+
*/
|
|
1594
|
+
CodeActionKind.SourceFixAll = 'source.fixAll';
|
|
1595
|
+
})(CodeActionKind = exports.CodeActionKind || (exports.CodeActionKind = {}));
|
|
1596
|
+
/**
|
|
1597
|
+
* The CodeActionContext namespace provides helper functions to work with
|
|
1598
|
+
* [CodeActionContext](#CodeActionContext) literals.
|
|
1599
|
+
*/
|
|
1600
|
+
var CodeActionContext;
|
|
1601
|
+
(function (CodeActionContext) {
|
|
1602
|
+
/**
|
|
1603
|
+
* Creates a new CodeActionContext literal.
|
|
1604
|
+
*/
|
|
1605
|
+
function create(diagnostics, only) {
|
|
1606
|
+
var result = { diagnostics: diagnostics };
|
|
1607
|
+
if (only !== undefined && only !== null) {
|
|
1608
|
+
result.only = only;
|
|
1609
|
+
}
|
|
1610
|
+
return result;
|
|
1611
|
+
}
|
|
1612
|
+
CodeActionContext.create = create;
|
|
1613
|
+
/**
|
|
1614
|
+
* Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.
|
|
1615
|
+
*/
|
|
1616
|
+
function is(value) {
|
|
1617
|
+
var candidate = value;
|
|
1618
|
+
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string));
|
|
1619
|
+
}
|
|
1620
|
+
CodeActionContext.is = is;
|
|
1621
|
+
})(CodeActionContext = exports.CodeActionContext || (exports.CodeActionContext = {}));
|
|
1622
|
+
var CodeAction;
|
|
1623
|
+
(function (CodeAction) {
|
|
1624
|
+
function create(title, kindOrCommandOrEdit, kind) {
|
|
1625
|
+
var result = { title: title };
|
|
1626
|
+
var checkKind = true;
|
|
1627
|
+
if (typeof kindOrCommandOrEdit === 'string') {
|
|
1628
|
+
checkKind = false;
|
|
1629
|
+
result.kind = kindOrCommandOrEdit;
|
|
1630
|
+
}
|
|
1631
|
+
else if (Command.is(kindOrCommandOrEdit)) {
|
|
1632
|
+
result.command = kindOrCommandOrEdit;
|
|
1633
|
+
}
|
|
1634
|
+
else {
|
|
1635
|
+
result.edit = kindOrCommandOrEdit;
|
|
1636
|
+
}
|
|
1637
|
+
if (checkKind && kind !== undefined) {
|
|
1638
|
+
result.kind = kind;
|
|
1639
|
+
}
|
|
1640
|
+
return result;
|
|
1641
|
+
}
|
|
1642
|
+
CodeAction.create = create;
|
|
1643
|
+
function is(value) {
|
|
1644
|
+
var candidate = value;
|
|
1645
|
+
return candidate && Is.string(candidate.title) &&
|
|
1646
|
+
(candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
|
|
1647
|
+
(candidate.kind === undefined || Is.string(candidate.kind)) &&
|
|
1648
|
+
(candidate.edit !== undefined || candidate.command !== undefined) &&
|
|
1649
|
+
(candidate.command === undefined || Command.is(candidate.command)) &&
|
|
1650
|
+
(candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&
|
|
1651
|
+
(candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
|
|
1652
|
+
}
|
|
1653
|
+
CodeAction.is = is;
|
|
1654
|
+
})(CodeAction = exports.CodeAction || (exports.CodeAction = {}));
|
|
1655
|
+
/**
|
|
1656
|
+
* The CodeLens namespace provides helper functions to work with
|
|
1657
|
+
* [CodeLens](#CodeLens) literals.
|
|
1658
|
+
*/
|
|
1659
|
+
var CodeLens;
|
|
1660
|
+
(function (CodeLens) {
|
|
1661
|
+
/**
|
|
1662
|
+
* Creates a new CodeLens literal.
|
|
1663
|
+
*/
|
|
1664
|
+
function create(range, data) {
|
|
1665
|
+
var result = { range: range };
|
|
1666
|
+
if (Is.defined(data)) {
|
|
1667
|
+
result.data = data;
|
|
1668
|
+
}
|
|
1669
|
+
return result;
|
|
1670
|
+
}
|
|
1671
|
+
CodeLens.create = create;
|
|
1672
|
+
/**
|
|
1673
|
+
* Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.
|
|
1674
|
+
*/
|
|
1675
|
+
function is(value) {
|
|
1676
|
+
var candidate = value;
|
|
1677
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
|
1678
|
+
}
|
|
1679
|
+
CodeLens.is = is;
|
|
1680
|
+
})(CodeLens = exports.CodeLens || (exports.CodeLens = {}));
|
|
1681
|
+
/**
|
|
1682
|
+
* The FormattingOptions namespace provides helper functions to work with
|
|
1683
|
+
* [FormattingOptions](#FormattingOptions) literals.
|
|
1684
|
+
*/
|
|
1685
|
+
var FormattingOptions;
|
|
1686
|
+
(function (FormattingOptions) {
|
|
1687
|
+
/**
|
|
1688
|
+
* Creates a new FormattingOptions literal.
|
|
1689
|
+
*/
|
|
1690
|
+
function create(tabSize, insertSpaces) {
|
|
1691
|
+
return { tabSize: tabSize, insertSpaces: insertSpaces };
|
|
1692
|
+
}
|
|
1693
|
+
FormattingOptions.create = create;
|
|
1694
|
+
/**
|
|
1695
|
+
* Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.
|
|
1696
|
+
*/
|
|
1697
|
+
function is(value) {
|
|
1698
|
+
var candidate = value;
|
|
1699
|
+
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
|
1700
|
+
}
|
|
1701
|
+
FormattingOptions.is = is;
|
|
1702
|
+
})(FormattingOptions = exports.FormattingOptions || (exports.FormattingOptions = {}));
|
|
1703
|
+
/**
|
|
1704
|
+
* The DocumentLink namespace provides helper functions to work with
|
|
1705
|
+
* [DocumentLink](#DocumentLink) literals.
|
|
1706
|
+
*/
|
|
1707
|
+
var DocumentLink;
|
|
1708
|
+
(function (DocumentLink) {
|
|
1709
|
+
/**
|
|
1710
|
+
* Creates a new DocumentLink literal.
|
|
1711
|
+
*/
|
|
1712
|
+
function create(range, target, data) {
|
|
1713
|
+
return { range: range, target: target, data: data };
|
|
1714
|
+
}
|
|
1715
|
+
DocumentLink.create = create;
|
|
1716
|
+
/**
|
|
1717
|
+
* Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.
|
|
1718
|
+
*/
|
|
1719
|
+
function is(value) {
|
|
1720
|
+
var candidate = value;
|
|
1721
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
|
1722
|
+
}
|
|
1723
|
+
DocumentLink.is = is;
|
|
1724
|
+
})(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {}));
|
|
1725
|
+
/**
|
|
1726
|
+
* The SelectionRange namespace provides helper function to work with
|
|
1727
|
+
* SelectionRange literals.
|
|
1728
|
+
*/
|
|
1729
|
+
var SelectionRange;
|
|
1730
|
+
(function (SelectionRange) {
|
|
1731
|
+
/**
|
|
1732
|
+
* Creates a new SelectionRange
|
|
1733
|
+
* @param range the range.
|
|
1734
|
+
* @param parent an optional parent.
|
|
1735
|
+
*/
|
|
1736
|
+
function create(range, parent) {
|
|
1737
|
+
return { range: range, parent: parent };
|
|
1738
|
+
}
|
|
1739
|
+
SelectionRange.create = create;
|
|
1740
|
+
function is(value) {
|
|
1741
|
+
var candidate = value;
|
|
1742
|
+
return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
|
|
1743
|
+
}
|
|
1744
|
+
SelectionRange.is = is;
|
|
1745
|
+
})(SelectionRange = exports.SelectionRange || (exports.SelectionRange = {}));
|
|
1746
|
+
exports.EOL = ['\n', '\r\n', '\r'];
|
|
1747
|
+
/**
|
|
1748
|
+
* @deprecated Use the text document from the new vscode-languageserver-textdocument package.
|
|
1749
|
+
*/
|
|
1750
|
+
var TextDocument;
|
|
1751
|
+
(function (TextDocument) {
|
|
1752
|
+
/**
|
|
1753
|
+
* Creates a new ITextDocument literal from the given uri and content.
|
|
1754
|
+
* @param uri The document's uri.
|
|
1755
|
+
* @param languageId The document's language Id.
|
|
1756
|
+
* @param content The document's content.
|
|
1757
|
+
*/
|
|
1758
|
+
function create(uri, languageId, version, content) {
|
|
1759
|
+
return new FullTextDocument(uri, languageId, version, content);
|
|
1760
|
+
}
|
|
1761
|
+
TextDocument.create = create;
|
|
1762
|
+
/**
|
|
1763
|
+
* Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.
|
|
1764
|
+
*/
|
|
1765
|
+
function is(value) {
|
|
1766
|
+
var candidate = value;
|
|
1767
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
|
|
1768
|
+
&& Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
|
|
1769
|
+
}
|
|
1770
|
+
TextDocument.is = is;
|
|
1771
|
+
function applyEdits(document, edits) {
|
|
1772
|
+
var text = document.getText();
|
|
1773
|
+
var sortedEdits = mergeSort(edits, function (a, b) {
|
|
1774
|
+
var diff = a.range.start.line - b.range.start.line;
|
|
1775
|
+
if (diff === 0) {
|
|
1776
|
+
return a.range.start.character - b.range.start.character;
|
|
1777
|
+
}
|
|
1778
|
+
return diff;
|
|
1779
|
+
});
|
|
1780
|
+
var lastModifiedOffset = text.length;
|
|
1781
|
+
for (var i = sortedEdits.length - 1; i >= 0; i--) {
|
|
1782
|
+
var e = sortedEdits[i];
|
|
1783
|
+
var startOffset = document.offsetAt(e.range.start);
|
|
1784
|
+
var endOffset = document.offsetAt(e.range.end);
|
|
1785
|
+
if (endOffset <= lastModifiedOffset) {
|
|
1786
|
+
text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
|
1787
|
+
}
|
|
1788
|
+
else {
|
|
1789
|
+
throw new Error('Overlapping edit');
|
|
1790
|
+
}
|
|
1791
|
+
lastModifiedOffset = startOffset;
|
|
1792
|
+
}
|
|
1793
|
+
return text;
|
|
1794
|
+
}
|
|
1795
|
+
TextDocument.applyEdits = applyEdits;
|
|
1796
|
+
function mergeSort(data, compare) {
|
|
1797
|
+
if (data.length <= 1) {
|
|
1798
|
+
// sorted
|
|
1799
|
+
return data;
|
|
1800
|
+
}
|
|
1801
|
+
var p = (data.length / 2) | 0;
|
|
1802
|
+
var left = data.slice(0, p);
|
|
1803
|
+
var right = data.slice(p);
|
|
1804
|
+
mergeSort(left, compare);
|
|
1805
|
+
mergeSort(right, compare);
|
|
1806
|
+
var leftIdx = 0;
|
|
1807
|
+
var rightIdx = 0;
|
|
1808
|
+
var i = 0;
|
|
1809
|
+
while (leftIdx < left.length && rightIdx < right.length) {
|
|
1810
|
+
var ret = compare(left[leftIdx], right[rightIdx]);
|
|
1811
|
+
if (ret <= 0) {
|
|
1812
|
+
// smaller_equal -> take left to preserve order
|
|
1813
|
+
data[i++] = left[leftIdx++];
|
|
1814
|
+
}
|
|
1815
|
+
else {
|
|
1816
|
+
// greater -> take right
|
|
1817
|
+
data[i++] = right[rightIdx++];
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
while (leftIdx < left.length) {
|
|
1821
|
+
data[i++] = left[leftIdx++];
|
|
1822
|
+
}
|
|
1823
|
+
while (rightIdx < right.length) {
|
|
1824
|
+
data[i++] = right[rightIdx++];
|
|
1825
|
+
}
|
|
1826
|
+
return data;
|
|
1827
|
+
}
|
|
1828
|
+
})(TextDocument = exports.TextDocument || (exports.TextDocument = {}));
|
|
1829
|
+
/**
|
|
1830
|
+
* @deprecated Use the text document from the new vscode-languageserver-textdocument package.
|
|
1831
|
+
*/
|
|
1832
|
+
var FullTextDocument = /** @class */ (function () {
|
|
1833
|
+
function FullTextDocument(uri, languageId, version, content) {
|
|
1834
|
+
this._uri = uri;
|
|
1835
|
+
this._languageId = languageId;
|
|
1836
|
+
this._version = version;
|
|
1837
|
+
this._content = content;
|
|
1838
|
+
this._lineOffsets = undefined;
|
|
1839
|
+
}
|
|
1840
|
+
Object.defineProperty(FullTextDocument.prototype, "uri", {
|
|
1841
|
+
get: function () {
|
|
1842
|
+
return this._uri;
|
|
1843
|
+
},
|
|
1844
|
+
enumerable: false,
|
|
1845
|
+
configurable: true
|
|
1846
|
+
});
|
|
1847
|
+
Object.defineProperty(FullTextDocument.prototype, "languageId", {
|
|
1848
|
+
get: function () {
|
|
1849
|
+
return this._languageId;
|
|
1850
|
+
},
|
|
1851
|
+
enumerable: false,
|
|
1852
|
+
configurable: true
|
|
1853
|
+
});
|
|
1854
|
+
Object.defineProperty(FullTextDocument.prototype, "version", {
|
|
1855
|
+
get: function () {
|
|
1856
|
+
return this._version;
|
|
1857
|
+
},
|
|
1858
|
+
enumerable: false,
|
|
1859
|
+
configurable: true
|
|
1860
|
+
});
|
|
1861
|
+
FullTextDocument.prototype.getText = function (range) {
|
|
1862
|
+
if (range) {
|
|
1863
|
+
var start = this.offsetAt(range.start);
|
|
1864
|
+
var end = this.offsetAt(range.end);
|
|
1865
|
+
return this._content.substring(start, end);
|
|
1866
|
+
}
|
|
1867
|
+
return this._content;
|
|
1868
|
+
};
|
|
1869
|
+
FullTextDocument.prototype.update = function (event, version) {
|
|
1870
|
+
this._content = event.text;
|
|
1871
|
+
this._version = version;
|
|
1872
|
+
this._lineOffsets = undefined;
|
|
1873
|
+
};
|
|
1874
|
+
FullTextDocument.prototype.getLineOffsets = function () {
|
|
1875
|
+
if (this._lineOffsets === undefined) {
|
|
1876
|
+
var lineOffsets = [];
|
|
1877
|
+
var text = this._content;
|
|
1878
|
+
var isLineStart = true;
|
|
1879
|
+
for (var i = 0; i < text.length; i++) {
|
|
1880
|
+
if (isLineStart) {
|
|
1881
|
+
lineOffsets.push(i);
|
|
1882
|
+
isLineStart = false;
|
|
1883
|
+
}
|
|
1884
|
+
var ch = text.charAt(i);
|
|
1885
|
+
isLineStart = (ch === '\r' || ch === '\n');
|
|
1886
|
+
if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
|
|
1887
|
+
i++;
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
if (isLineStart && text.length > 0) {
|
|
1891
|
+
lineOffsets.push(text.length);
|
|
1892
|
+
}
|
|
1893
|
+
this._lineOffsets = lineOffsets;
|
|
1894
|
+
}
|
|
1895
|
+
return this._lineOffsets;
|
|
1896
|
+
};
|
|
1897
|
+
FullTextDocument.prototype.positionAt = function (offset) {
|
|
1898
|
+
offset = Math.max(Math.min(offset, this._content.length), 0);
|
|
1899
|
+
var lineOffsets = this.getLineOffsets();
|
|
1900
|
+
var low = 0, high = lineOffsets.length;
|
|
1901
|
+
if (high === 0) {
|
|
1902
|
+
return Position.create(0, offset);
|
|
1903
|
+
}
|
|
1904
|
+
while (low < high) {
|
|
1905
|
+
var mid = Math.floor((low + high) / 2);
|
|
1906
|
+
if (lineOffsets[mid] > offset) {
|
|
1907
|
+
high = mid;
|
|
1908
|
+
}
|
|
1909
|
+
else {
|
|
1910
|
+
low = mid + 1;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
// low is the least x for which the line offset is larger than the current offset
|
|
1914
|
+
// or array.length if no line offset is larger than the current offset
|
|
1915
|
+
var line = low - 1;
|
|
1916
|
+
return Position.create(line, offset - lineOffsets[line]);
|
|
1917
|
+
};
|
|
1918
|
+
FullTextDocument.prototype.offsetAt = function (position) {
|
|
1919
|
+
var lineOffsets = this.getLineOffsets();
|
|
1920
|
+
if (position.line >= lineOffsets.length) {
|
|
1921
|
+
return this._content.length;
|
|
1922
|
+
}
|
|
1923
|
+
else if (position.line < 0) {
|
|
1924
|
+
return 0;
|
|
1925
|
+
}
|
|
1926
|
+
var lineOffset = lineOffsets[position.line];
|
|
1927
|
+
var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
|
|
1928
|
+
return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
|
1929
|
+
};
|
|
1930
|
+
Object.defineProperty(FullTextDocument.prototype, "lineCount", {
|
|
1931
|
+
get: function () {
|
|
1932
|
+
return this.getLineOffsets().length;
|
|
1933
|
+
},
|
|
1934
|
+
enumerable: false,
|
|
1935
|
+
configurable: true
|
|
1936
|
+
});
|
|
1937
|
+
return FullTextDocument;
|
|
1938
|
+
}());
|
|
1939
|
+
var Is;
|
|
1940
|
+
(function (Is) {
|
|
1941
|
+
var toString = Object.prototype.toString;
|
|
1942
|
+
function defined(value) {
|
|
1943
|
+
return typeof value !== 'undefined';
|
|
1944
|
+
}
|
|
1945
|
+
Is.defined = defined;
|
|
1946
|
+
function undefined(value) {
|
|
1947
|
+
return typeof value === 'undefined';
|
|
1948
|
+
}
|
|
1949
|
+
Is.undefined = undefined;
|
|
1950
|
+
function boolean(value) {
|
|
1951
|
+
return value === true || value === false;
|
|
1952
|
+
}
|
|
1953
|
+
Is.boolean = boolean;
|
|
1954
|
+
function string(value) {
|
|
1955
|
+
return toString.call(value) === '[object String]';
|
|
1956
|
+
}
|
|
1957
|
+
Is.string = string;
|
|
1958
|
+
function number(value) {
|
|
1959
|
+
return toString.call(value) === '[object Number]';
|
|
1960
|
+
}
|
|
1961
|
+
Is.number = number;
|
|
1962
|
+
function numberRange(value, min, max) {
|
|
1963
|
+
return toString.call(value) === '[object Number]' && min <= value && value <= max;
|
|
1964
|
+
}
|
|
1965
|
+
Is.numberRange = numberRange;
|
|
1966
|
+
function integer(value) {
|
|
1967
|
+
return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
|
|
1968
|
+
}
|
|
1969
|
+
Is.integer = integer;
|
|
1970
|
+
function uinteger(value) {
|
|
1971
|
+
return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
|
|
1972
|
+
}
|
|
1973
|
+
Is.uinteger = uinteger;
|
|
1974
|
+
function func(value) {
|
|
1975
|
+
return toString.call(value) === '[object Function]';
|
|
1976
|
+
}
|
|
1977
|
+
Is.func = func;
|
|
1978
|
+
function objectLiteral(value) {
|
|
1979
|
+
// Strictly speaking class instances pass this check as well. Since the LSP
|
|
1980
|
+
// doesn't use classes we ignore this for now. If we do we need to add something
|
|
1981
|
+
// like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
|
|
1982
|
+
return value !== null && typeof value === 'object';
|
|
1983
|
+
}
|
|
1984
|
+
Is.objectLiteral = objectLiteral;
|
|
1985
|
+
function typedArray(value, check) {
|
|
1986
|
+
return Array.isArray(value) && value.every(check);
|
|
1987
|
+
}
|
|
1988
|
+
Is.typedArray = typedArray;
|
|
1989
|
+
})(Is || (Is = {}));
|
|
1990
|
+
});
|
|
1991
|
+
//# sourceMappingURL=main.js.map;
|
|
1610
1992
|
define('vscode-languageserver-types', ['vscode-languageserver-types/main'], function (main) { return main; });
|
|
1611
1993
|
|
|
1612
1994
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define('xregexp/xregexp-all',[],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.XRegExp = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
@@ -6358,7 +6740,6 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6358
6740
|
kind: classification.Kind,
|
|
6359
6741
|
}); });
|
|
6360
6742
|
}
|
|
6361
|
-
;
|
|
6362
6743
|
/**
|
|
6363
6744
|
* Kusto Language service translates the kusto object model (transpiled from C# by Bridge.Net)
|
|
6364
6745
|
* to the vscode language server types, which are used by vscode language extensions.
|
|
@@ -6515,7 +6896,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6515
6896
|
this.__kustoJsSchemaV2 = this.convertToKustoJsSchemaV2(schema);
|
|
6516
6897
|
this._schema = schema;
|
|
6517
6898
|
this._clustersSetInGlobalState = new Set();
|
|
6518
|
-
this._nonEmptyDatabaseSetInGlobalState = new Set(); // used to remove clusters that are already in the global state
|
|
6899
|
+
this._nonEmptyDatabaseSetInGlobalState = new Set(); // used to remove clusters that are already in the global state
|
|
6519
6900
|
this.configure(languageSettings);
|
|
6520
6901
|
this._newlineAppendPipePolicy = new Kusto.Data.IntelliSense.ApplyPolicy();
|
|
6521
6902
|
this._newlineAppendPipePolicy.Text = '\n| ';
|
|
@@ -6537,13 +6918,14 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6537
6918
|
this.__kustoJsSchemaV2 = globalState;
|
|
6538
6919
|
this._clustersSetInGlobalState.clear();
|
|
6539
6920
|
this._nonEmptyDatabaseSetInGlobalState.clear();
|
|
6540
|
-
// create 2 Sets with cluster names and database names based on the updated Global State.
|
|
6921
|
+
// create 2 Sets with cluster names and database names based on the updated Global State.
|
|
6541
6922
|
for (var i = 0; i < globalState.Clusters.Count; i++) {
|
|
6542
6923
|
var clusterSymbol = this._kustoJsSchemaV2.Clusters.getItem(i);
|
|
6543
6924
|
this._clustersSetInGlobalState.add(clusterSymbol.Name);
|
|
6544
6925
|
for (var i2 = 0; i2 < clusterSymbol.Databases.Count; i2++) {
|
|
6545
6926
|
var databaseSymbol = clusterSymbol.Databases.getItem(i2);
|
|
6546
|
-
if (databaseSymbol.Tables.Count > 0) {
|
|
6927
|
+
if (databaseSymbol.Tables.Count > 0) {
|
|
6928
|
+
// only include database with tables
|
|
6547
6929
|
this._nonEmptyDatabaseSetInGlobalState.add(this.createDatabaseUniqueName(clusterSymbol.Name, databaseSymbol.Name));
|
|
6548
6930
|
}
|
|
6549
6931
|
}
|
|
@@ -6622,7 +7004,9 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6622
7004
|
// as '\$0'
|
|
6623
7005
|
var _a = kItem.AfterText && kItem.AfterText.length > 0
|
|
6624
7006
|
? {
|
|
6625
|
-
|
|
7007
|
+
// Need to escape dollar sign since it is used as a placeholder in snippet.
|
|
7008
|
+
// Usually dollar sign is not a valid character in a function name, but grafana uses macros that start with dollars.
|
|
7009
|
+
textToInsert: kItem.EditText.replace('$', '\\$') + "$0" + kItem.AfterText,
|
|
6626
7010
|
format: ls.InsertTextFormat.Snippet,
|
|
6627
7011
|
}
|
|
6628
7012
|
: {
|
|
@@ -6634,6 +7018,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6634
7018
|
var endPosition = document.positionAt(completionItems.EditStart + completionItems.EditLength);
|
|
6635
7019
|
lsItem.textEdit = ls.TextEdit.replace(ls.Range.create(startPosition, endPosition), textToInsert);
|
|
6636
7020
|
lsItem.sortText = _this.getSortText(i + 1);
|
|
7021
|
+
// lsItem.filterText = lsItem.sortText;
|
|
6637
7022
|
lsItem.kind = _this.kustoKindToLsKindV2(kItem.Kind);
|
|
6638
7023
|
lsItem.insertTextFormat = format;
|
|
6639
7024
|
lsItem.detail = helpTopic ? helpTopic.ShortDescription : undefined;
|
|
@@ -6773,7 +7158,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6773
7158
|
return Promise.resolve([]);
|
|
6774
7159
|
}
|
|
6775
7160
|
var newClustersReferences = [];
|
|
6776
|
-
var newClustersReferencesSet = new Set(); // used to remove duplicates
|
|
7161
|
+
var newClustersReferencesSet = new Set(); // used to remove duplicates
|
|
6777
7162
|
// Keep only unique clusters that aren't already exist in the Global State
|
|
6778
7163
|
for (var i = 0; i < clusterReferences.Count; i++) {
|
|
6779
7164
|
var clusterReference = clusterReferences.getItem(i);
|
|
@@ -6783,7 +7168,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6783
7168
|
continue;
|
|
6784
7169
|
}
|
|
6785
7170
|
newClustersReferencesSet.add(clusterHostName);
|
|
6786
|
-
// ignore references that are already in the GlobalState.
|
|
7171
|
+
// ignore references that are already in the GlobalState.
|
|
6787
7172
|
if (!this._clustersSetInGlobalState.has(clusterHostName)) {
|
|
6788
7173
|
newClustersReferences.push({ clusterName: clusterHostName });
|
|
6789
7174
|
}
|
|
@@ -6814,13 +7199,13 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6814
7199
|
if (!foundInGlobalState) {
|
|
6815
7200
|
newDatabasesReferences.push({
|
|
6816
7201
|
databaseName: databaseReference.Database,
|
|
6817
|
-
clusterName: databaseReference.Cluster
|
|
7202
|
+
clusterName: databaseReference.Cluster,
|
|
6818
7203
|
});
|
|
6819
7204
|
}
|
|
6820
7205
|
}
|
|
6821
7206
|
return Promise.resolve(newDatabasesReferences);
|
|
6822
7207
|
};
|
|
6823
|
-
KustoLanguageService.prototype.doValidation = function (document, changeIntervals) {
|
|
7208
|
+
KustoLanguageService.prototype.doValidation = function (document, changeIntervals, includeWarnings, includeSuggestions) {
|
|
6824
7209
|
var _this = this;
|
|
6825
7210
|
// didn't implement validation for v1.
|
|
6826
7211
|
if (!document || !this.isIntellisenseV2()) {
|
|
@@ -6833,11 +7218,23 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6833
7218
|
}
|
|
6834
7219
|
var diagnostics = blocks
|
|
6835
7220
|
.map(function (block) {
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
7221
|
+
// GetDiagnostics returns the errors in the block
|
|
7222
|
+
var diagnostics = _this.toArray(block.Service.GetDiagnostics(false));
|
|
7223
|
+
var enableWarnings = includeWarnings !== null && includeWarnings !== void 0 ? includeWarnings : _this._languageSettings.enableQueryWarnings;
|
|
7224
|
+
var enableSuggestions = includeSuggestions !== null && includeSuggestions !== void 0 ? includeSuggestions : _this._languageSettings.enableQuerySuggestions;
|
|
7225
|
+
if (enableWarnings || enableSuggestions) {
|
|
7226
|
+
// Concat Warnings and suggestions to the diagnostics
|
|
7227
|
+
var warningAndSuggestionDiagnostics = block.Service.GetAnalyzerDiagnostics(null, true);
|
|
7228
|
+
var filterredDiagnostics = _this.toArray(warningAndSuggestionDiagnostics).filter(function (d) {
|
|
7229
|
+
var _a;
|
|
7230
|
+
var allowSeverity = (enableWarnings && d.Severity === 'Warning') ||
|
|
7231
|
+
(enableSuggestions && d.Severity === 'Suggestion');
|
|
7232
|
+
var allowCode = !((_a = _this._languageSettings.disabledDiagnoticCodes) === null || _a === void 0 ? void 0 : _a.includes(d.Code));
|
|
7233
|
+
return allowSeverity && allowCode;
|
|
7234
|
+
});
|
|
7235
|
+
diagnostics = diagnostics.concat(filterredDiagnostics);
|
|
6839
7236
|
}
|
|
6840
|
-
return
|
|
7237
|
+
return diagnostics;
|
|
6841
7238
|
})
|
|
6842
7239
|
.reduce(function (prev, curr) { return prev.concat(curr); }, []);
|
|
6843
7240
|
var lsDiagnostics = this.toLsDiagnostics(diagnostics, document);
|
|
@@ -6850,7 +7247,18 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6850
7247
|
var start = document.positionAt(diag.Start);
|
|
6851
7248
|
var end = document.positionAt(diag.Start + diag.Length);
|
|
6852
7249
|
var range = ls.Range.create(start, end);
|
|
6853
|
-
|
|
7250
|
+
var severity;
|
|
7251
|
+
switch (diag.Severity) {
|
|
7252
|
+
case 'Suggestion':
|
|
7253
|
+
severity = ls.DiagnosticSeverity.Information;
|
|
7254
|
+
break;
|
|
7255
|
+
case 'Warning':
|
|
7256
|
+
severity = ls.DiagnosticSeverity.Warning;
|
|
7257
|
+
break;
|
|
7258
|
+
default:
|
|
7259
|
+
severity = ls.DiagnosticSeverity.Error;
|
|
7260
|
+
}
|
|
7261
|
+
return ls.Diagnostic.create(range, diag.Message, severity, diag.Code);
|
|
6854
7262
|
});
|
|
6855
7263
|
};
|
|
6856
7264
|
/**
|
|
@@ -6973,8 +7381,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6973
7381
|
});
|
|
6974
7382
|
}
|
|
6975
7383
|
if (!cluster) {
|
|
6976
|
-
var databaseSymbols = databaseNames
|
|
6977
|
-
.map(function (databaseName) {
|
|
7384
|
+
var databaseSymbols = databaseNames.map(function (databaseName) {
|
|
6978
7385
|
var symbol = new sym.DatabaseSymbol.$ctor1(databaseName, undefined, false);
|
|
6979
7386
|
return symbol;
|
|
6980
7387
|
});
|
|
@@ -7050,16 +7457,18 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7050
7457
|
name: Name,
|
|
7051
7458
|
minorVersion: MinorVersion,
|
|
7052
7459
|
majorVersion: MajorVersion,
|
|
7053
|
-
tables: [].concat.apply([], [
|
|
7460
|
+
tables: [].concat.apply([], [
|
|
7461
|
+
[Tables, 'Table'],
|
|
7462
|
+
[MaterializedViews, 'MaterializedView'],
|
|
7463
|
+
[ExternalTables, 'ExternalTable'],
|
|
7464
|
+
]
|
|
7054
7465
|
.filter(function (_a) {
|
|
7055
7466
|
var tableContainer = _a[0];
|
|
7056
7467
|
return tableContainer;
|
|
7057
7468
|
})
|
|
7058
7469
|
.map(function (_a) {
|
|
7059
7470
|
var tableContainer = _a[0], tableEntity = _a[1];
|
|
7060
|
-
return Object
|
|
7061
|
-
.values(tableContainer)
|
|
7062
|
-
.map(function (_a) {
|
|
7471
|
+
return Object.values(tableContainer).map(function (_a) {
|
|
7063
7472
|
var Name = _a.Name, OrderedColumns = _a.OrderedColumns, DocString = _a.DocString;
|
|
7064
7473
|
return ({
|
|
7065
7474
|
name: Name,
|
|
@@ -7501,8 +7910,12 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7501
7910
|
if (!items) {
|
|
7502
7911
|
return Promise.resolve(undefined);
|
|
7503
7912
|
}
|
|
7504
|
-
// Errors are already shown in getDiagnostics. we don't want them in doHover.
|
|
7505
|
-
items = items.filter(function (item) {
|
|
7913
|
+
// Errors, Warnings and Suggestions are already shown in getDiagnostics. we don't want them in doHover.
|
|
7914
|
+
items = items.filter(function (item) {
|
|
7915
|
+
return item.Kind !== k2.QuickInfoKind.Error &&
|
|
7916
|
+
item.Kind !== k2.QuickInfoKind.Suggestion &&
|
|
7917
|
+
item.Kind !== k2.QuickInfoKind.Warning;
|
|
7918
|
+
});
|
|
7506
7919
|
var itemsText = items.map(function (item) { return item.Text.replace('\n\n', '\n* * *\n'); });
|
|
7507
7920
|
// separate items by horizontal line.
|
|
7508
7921
|
var text = itemsText.join('\n* * *\n');
|