@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
package/release/dev/kustoMode.js
CHANGED
|
@@ -188,1545 +188,1927 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
|
|
|
188
188
|
};
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
-
(function (factory) {
|
|
192
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
193
|
-
var v = factory(require, exports);
|
|
194
|
-
if (v !== undefined) module.exports = v;
|
|
195
|
-
}
|
|
196
|
-
else if (typeof define === "function" && define.amd) {
|
|
197
|
-
define('vscode-languageserver-types/main',["require", "exports"], factory);
|
|
198
|
-
}
|
|
199
|
-
})(function (require, exports) {
|
|
200
|
-
/* --------------------------------------------------------------------------------------------
|
|
201
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
202
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
203
|
-
* ------------------------------------------------------------------------------------------ */
|
|
204
|
-
'use strict';
|
|
205
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
*
|
|
267
|
-
*/
|
|
268
|
-
function
|
|
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
|
-
function
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
return
|
|
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
|
-
return
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
*
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
*
|
|
524
|
-
*/
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
*
|
|
597
|
-
*/
|
|
598
|
-
function
|
|
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
|
-
function
|
|
662
|
-
var
|
|
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
|
-
|
|
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
|
-
this.
|
|
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
|
-
|
|
1004
|
-
|
|
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
|
-
var
|
|
1124
|
-
if (
|
|
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
|
-
*
|
|
1338
|
-
*/
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
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
|
-
* The
|
|
1458
|
-
* [
|
|
1459
|
-
*/
|
|
1460
|
-
var
|
|
1461
|
-
(function (
|
|
1462
|
-
/**
|
|
1463
|
-
* Creates a new
|
|
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
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
191
|
+
(function (factory) {
|
|
192
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
193
|
+
var v = factory(require, exports);
|
|
194
|
+
if (v !== undefined) module.exports = v;
|
|
195
|
+
}
|
|
196
|
+
else if (typeof define === "function" && define.amd) {
|
|
197
|
+
define('vscode-languageserver-types/main',["require", "exports"], factory);
|
|
198
|
+
}
|
|
199
|
+
})(function (require, exports) {
|
|
200
|
+
/* --------------------------------------------------------------------------------------------
|
|
201
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
202
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
203
|
+
* ------------------------------------------------------------------------------------------ */
|
|
204
|
+
'use strict';
|
|
205
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
206
|
+
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;
|
|
207
|
+
var integer;
|
|
208
|
+
(function (integer) {
|
|
209
|
+
integer.MIN_VALUE = -2147483648;
|
|
210
|
+
integer.MAX_VALUE = 2147483647;
|
|
211
|
+
})(integer = exports.integer || (exports.integer = {}));
|
|
212
|
+
var uinteger;
|
|
213
|
+
(function (uinteger) {
|
|
214
|
+
uinteger.MIN_VALUE = 0;
|
|
215
|
+
uinteger.MAX_VALUE = 2147483647;
|
|
216
|
+
})(uinteger = exports.uinteger || (exports.uinteger = {}));
|
|
217
|
+
/**
|
|
218
|
+
* The Position namespace provides helper functions to work with
|
|
219
|
+
* [Position](#Position) literals.
|
|
220
|
+
*/
|
|
221
|
+
var Position;
|
|
222
|
+
(function (Position) {
|
|
223
|
+
/**
|
|
224
|
+
* Creates a new Position literal from the given line and character.
|
|
225
|
+
* @param line The position's line.
|
|
226
|
+
* @param character The position's character.
|
|
227
|
+
*/
|
|
228
|
+
function create(line, character) {
|
|
229
|
+
if (line === Number.MAX_VALUE) {
|
|
230
|
+
line = uinteger.MAX_VALUE;
|
|
231
|
+
}
|
|
232
|
+
if (character === Number.MAX_VALUE) {
|
|
233
|
+
character = uinteger.MAX_VALUE;
|
|
234
|
+
}
|
|
235
|
+
return { line: line, character: character };
|
|
236
|
+
}
|
|
237
|
+
Position.create = create;
|
|
238
|
+
/**
|
|
239
|
+
* Checks whether the given literal conforms to the [Position](#Position) interface.
|
|
240
|
+
*/
|
|
241
|
+
function is(value) {
|
|
242
|
+
var candidate = value;
|
|
243
|
+
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
|
|
244
|
+
}
|
|
245
|
+
Position.is = is;
|
|
246
|
+
})(Position = exports.Position || (exports.Position = {}));
|
|
247
|
+
/**
|
|
248
|
+
* The Range namespace provides helper functions to work with
|
|
249
|
+
* [Range](#Range) literals.
|
|
250
|
+
*/
|
|
251
|
+
var Range;
|
|
252
|
+
(function (Range) {
|
|
253
|
+
function create(one, two, three, four) {
|
|
254
|
+
if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
|
|
255
|
+
return { start: Position.create(one, two), end: Position.create(three, four) };
|
|
256
|
+
}
|
|
257
|
+
else if (Position.is(one) && Position.is(two)) {
|
|
258
|
+
return { start: one, end: two };
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]");
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
Range.create = create;
|
|
265
|
+
/**
|
|
266
|
+
* Checks whether the given literal conforms to the [Range](#Range) interface.
|
|
267
|
+
*/
|
|
268
|
+
function is(value) {
|
|
269
|
+
var candidate = value;
|
|
270
|
+
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
|
271
|
+
}
|
|
272
|
+
Range.is = is;
|
|
273
|
+
})(Range = exports.Range || (exports.Range = {}));
|
|
274
|
+
/**
|
|
275
|
+
* The Location namespace provides helper functions to work with
|
|
276
|
+
* [Location](#Location) literals.
|
|
277
|
+
*/
|
|
278
|
+
var Location;
|
|
279
|
+
(function (Location) {
|
|
280
|
+
/**
|
|
281
|
+
* Creates a Location literal.
|
|
282
|
+
* @param uri The location's uri.
|
|
283
|
+
* @param range The location's range.
|
|
284
|
+
*/
|
|
285
|
+
function create(uri, range) {
|
|
286
|
+
return { uri: uri, range: range };
|
|
287
|
+
}
|
|
288
|
+
Location.create = create;
|
|
289
|
+
/**
|
|
290
|
+
* Checks whether the given literal conforms to the [Location](#Location) interface.
|
|
291
|
+
*/
|
|
292
|
+
function is(value) {
|
|
293
|
+
var candidate = value;
|
|
294
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
|
295
|
+
}
|
|
296
|
+
Location.is = is;
|
|
297
|
+
})(Location = exports.Location || (exports.Location = {}));
|
|
298
|
+
/**
|
|
299
|
+
* The LocationLink namespace provides helper functions to work with
|
|
300
|
+
* [LocationLink](#LocationLink) literals.
|
|
301
|
+
*/
|
|
302
|
+
var LocationLink;
|
|
303
|
+
(function (LocationLink) {
|
|
304
|
+
/**
|
|
305
|
+
* Creates a LocationLink literal.
|
|
306
|
+
* @param targetUri The definition's uri.
|
|
307
|
+
* @param targetRange The full range of the definition.
|
|
308
|
+
* @param targetSelectionRange The span of the symbol definition at the target.
|
|
309
|
+
* @param originSelectionRange The span of the symbol being defined in the originating source file.
|
|
310
|
+
*/
|
|
311
|
+
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
|
312
|
+
return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
|
|
313
|
+
}
|
|
314
|
+
LocationLink.create = create;
|
|
315
|
+
/**
|
|
316
|
+
* Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
|
|
317
|
+
*/
|
|
318
|
+
function is(value) {
|
|
319
|
+
var candidate = value;
|
|
320
|
+
return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
|
|
321
|
+
&& (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
|
|
322
|
+
&& (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
|
323
|
+
}
|
|
324
|
+
LocationLink.is = is;
|
|
325
|
+
})(LocationLink = exports.LocationLink || (exports.LocationLink = {}));
|
|
326
|
+
/**
|
|
327
|
+
* The Color namespace provides helper functions to work with
|
|
328
|
+
* [Color](#Color) literals.
|
|
329
|
+
*/
|
|
330
|
+
var Color;
|
|
331
|
+
(function (Color) {
|
|
332
|
+
/**
|
|
333
|
+
* Creates a new Color literal.
|
|
334
|
+
*/
|
|
335
|
+
function create(red, green, blue, alpha) {
|
|
336
|
+
return {
|
|
337
|
+
red: red,
|
|
338
|
+
green: green,
|
|
339
|
+
blue: blue,
|
|
340
|
+
alpha: alpha,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
Color.create = create;
|
|
344
|
+
/**
|
|
345
|
+
* Checks whether the given literal conforms to the [Color](#Color) interface.
|
|
346
|
+
*/
|
|
347
|
+
function is(value) {
|
|
348
|
+
var candidate = value;
|
|
349
|
+
return Is.numberRange(candidate.red, 0, 1)
|
|
350
|
+
&& Is.numberRange(candidate.green, 0, 1)
|
|
351
|
+
&& Is.numberRange(candidate.blue, 0, 1)
|
|
352
|
+
&& Is.numberRange(candidate.alpha, 0, 1);
|
|
353
|
+
}
|
|
354
|
+
Color.is = is;
|
|
355
|
+
})(Color = exports.Color || (exports.Color = {}));
|
|
356
|
+
/**
|
|
357
|
+
* The ColorInformation namespace provides helper functions to work with
|
|
358
|
+
* [ColorInformation](#ColorInformation) literals.
|
|
359
|
+
*/
|
|
360
|
+
var ColorInformation;
|
|
361
|
+
(function (ColorInformation) {
|
|
362
|
+
/**
|
|
363
|
+
* Creates a new ColorInformation literal.
|
|
364
|
+
*/
|
|
365
|
+
function create(range, color) {
|
|
366
|
+
return {
|
|
367
|
+
range: range,
|
|
368
|
+
color: color,
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
ColorInformation.create = create;
|
|
372
|
+
/**
|
|
373
|
+
* Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
|
|
374
|
+
*/
|
|
375
|
+
function is(value) {
|
|
376
|
+
var candidate = value;
|
|
377
|
+
return Range.is(candidate.range) && Color.is(candidate.color);
|
|
378
|
+
}
|
|
379
|
+
ColorInformation.is = is;
|
|
380
|
+
})(ColorInformation = exports.ColorInformation || (exports.ColorInformation = {}));
|
|
381
|
+
/**
|
|
382
|
+
* The Color namespace provides helper functions to work with
|
|
383
|
+
* [ColorPresentation](#ColorPresentation) literals.
|
|
384
|
+
*/
|
|
385
|
+
var ColorPresentation;
|
|
386
|
+
(function (ColorPresentation) {
|
|
387
|
+
/**
|
|
388
|
+
* Creates a new ColorInformation literal.
|
|
389
|
+
*/
|
|
390
|
+
function create(label, textEdit, additionalTextEdits) {
|
|
391
|
+
return {
|
|
392
|
+
label: label,
|
|
393
|
+
textEdit: textEdit,
|
|
394
|
+
additionalTextEdits: additionalTextEdits,
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
ColorPresentation.create = create;
|
|
398
|
+
/**
|
|
399
|
+
* Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.
|
|
400
|
+
*/
|
|
401
|
+
function is(value) {
|
|
402
|
+
var candidate = value;
|
|
403
|
+
return Is.string(candidate.label)
|
|
404
|
+
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
|
405
|
+
&& (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
|
406
|
+
}
|
|
407
|
+
ColorPresentation.is = is;
|
|
408
|
+
})(ColorPresentation = exports.ColorPresentation || (exports.ColorPresentation = {}));
|
|
409
|
+
/**
|
|
410
|
+
* Enum of known range kinds
|
|
411
|
+
*/
|
|
412
|
+
var FoldingRangeKind;
|
|
413
|
+
(function (FoldingRangeKind) {
|
|
414
|
+
/**
|
|
415
|
+
* Folding range for a comment
|
|
416
|
+
*/
|
|
417
|
+
FoldingRangeKind["Comment"] = "comment";
|
|
418
|
+
/**
|
|
419
|
+
* Folding range for a imports or includes
|
|
420
|
+
*/
|
|
421
|
+
FoldingRangeKind["Imports"] = "imports";
|
|
422
|
+
/**
|
|
423
|
+
* Folding range for a region (e.g. `#region`)
|
|
424
|
+
*/
|
|
425
|
+
FoldingRangeKind["Region"] = "region";
|
|
426
|
+
})(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
|
|
427
|
+
/**
|
|
428
|
+
* The folding range namespace provides helper functions to work with
|
|
429
|
+
* [FoldingRange](#FoldingRange) literals.
|
|
430
|
+
*/
|
|
431
|
+
var FoldingRange;
|
|
432
|
+
(function (FoldingRange) {
|
|
433
|
+
/**
|
|
434
|
+
* Creates a new FoldingRange literal.
|
|
435
|
+
*/
|
|
436
|
+
function create(startLine, endLine, startCharacter, endCharacter, kind) {
|
|
437
|
+
var result = {
|
|
438
|
+
startLine: startLine,
|
|
439
|
+
endLine: endLine
|
|
440
|
+
};
|
|
441
|
+
if (Is.defined(startCharacter)) {
|
|
442
|
+
result.startCharacter = startCharacter;
|
|
443
|
+
}
|
|
444
|
+
if (Is.defined(endCharacter)) {
|
|
445
|
+
result.endCharacter = endCharacter;
|
|
446
|
+
}
|
|
447
|
+
if (Is.defined(kind)) {
|
|
448
|
+
result.kind = kind;
|
|
449
|
+
}
|
|
450
|
+
return result;
|
|
451
|
+
}
|
|
452
|
+
FoldingRange.create = create;
|
|
453
|
+
/**
|
|
454
|
+
* Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.
|
|
455
|
+
*/
|
|
456
|
+
function is(value) {
|
|
457
|
+
var candidate = value;
|
|
458
|
+
return Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
|
|
459
|
+
&& (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
|
|
460
|
+
&& (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
|
|
461
|
+
&& (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
|
462
|
+
}
|
|
463
|
+
FoldingRange.is = is;
|
|
464
|
+
})(FoldingRange = exports.FoldingRange || (exports.FoldingRange = {}));
|
|
465
|
+
/**
|
|
466
|
+
* The DiagnosticRelatedInformation namespace provides helper functions to work with
|
|
467
|
+
* [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.
|
|
468
|
+
*/
|
|
469
|
+
var DiagnosticRelatedInformation;
|
|
470
|
+
(function (DiagnosticRelatedInformation) {
|
|
471
|
+
/**
|
|
472
|
+
* Creates a new DiagnosticRelatedInformation literal.
|
|
473
|
+
*/
|
|
474
|
+
function create(location, message) {
|
|
475
|
+
return {
|
|
476
|
+
location: location,
|
|
477
|
+
message: message
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
DiagnosticRelatedInformation.create = create;
|
|
481
|
+
/**
|
|
482
|
+
* Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.
|
|
483
|
+
*/
|
|
484
|
+
function is(value) {
|
|
485
|
+
var candidate = value;
|
|
486
|
+
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
|
487
|
+
}
|
|
488
|
+
DiagnosticRelatedInformation.is = is;
|
|
489
|
+
})(DiagnosticRelatedInformation = exports.DiagnosticRelatedInformation || (exports.DiagnosticRelatedInformation = {}));
|
|
490
|
+
/**
|
|
491
|
+
* The diagnostic's severity.
|
|
492
|
+
*/
|
|
493
|
+
var DiagnosticSeverity;
|
|
494
|
+
(function (DiagnosticSeverity) {
|
|
495
|
+
/**
|
|
496
|
+
* Reports an error.
|
|
497
|
+
*/
|
|
498
|
+
DiagnosticSeverity.Error = 1;
|
|
499
|
+
/**
|
|
500
|
+
* Reports a warning.
|
|
501
|
+
*/
|
|
502
|
+
DiagnosticSeverity.Warning = 2;
|
|
503
|
+
/**
|
|
504
|
+
* Reports an information.
|
|
505
|
+
*/
|
|
506
|
+
DiagnosticSeverity.Information = 3;
|
|
507
|
+
/**
|
|
508
|
+
* Reports a hint.
|
|
509
|
+
*/
|
|
510
|
+
DiagnosticSeverity.Hint = 4;
|
|
511
|
+
})(DiagnosticSeverity = exports.DiagnosticSeverity || (exports.DiagnosticSeverity = {}));
|
|
512
|
+
/**
|
|
513
|
+
* The diagnostic tags.
|
|
514
|
+
*
|
|
515
|
+
* @since 3.15.0
|
|
516
|
+
*/
|
|
517
|
+
var DiagnosticTag;
|
|
518
|
+
(function (DiagnosticTag) {
|
|
519
|
+
/**
|
|
520
|
+
* Unused or unnecessary code.
|
|
521
|
+
*
|
|
522
|
+
* Clients are allowed to render diagnostics with this tag faded out instead of having
|
|
523
|
+
* an error squiggle.
|
|
524
|
+
*/
|
|
525
|
+
DiagnosticTag.Unnecessary = 1;
|
|
526
|
+
/**
|
|
527
|
+
* Deprecated or obsolete code.
|
|
528
|
+
*
|
|
529
|
+
* Clients are allowed to rendered diagnostics with this tag strike through.
|
|
530
|
+
*/
|
|
531
|
+
DiagnosticTag.Deprecated = 2;
|
|
532
|
+
})(DiagnosticTag = exports.DiagnosticTag || (exports.DiagnosticTag = {}));
|
|
533
|
+
/**
|
|
534
|
+
* The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
|
|
535
|
+
*
|
|
536
|
+
* @since 3.16.0
|
|
537
|
+
*/
|
|
538
|
+
var CodeDescription;
|
|
539
|
+
(function (CodeDescription) {
|
|
540
|
+
function is(value) {
|
|
541
|
+
var candidate = value;
|
|
542
|
+
return candidate !== undefined && candidate !== null && Is.string(candidate.href);
|
|
543
|
+
}
|
|
544
|
+
CodeDescription.is = is;
|
|
545
|
+
})(CodeDescription = exports.CodeDescription || (exports.CodeDescription = {}));
|
|
546
|
+
/**
|
|
547
|
+
* The Diagnostic namespace provides helper functions to work with
|
|
548
|
+
* [Diagnostic](#Diagnostic) literals.
|
|
549
|
+
*/
|
|
550
|
+
var Diagnostic;
|
|
551
|
+
(function (Diagnostic) {
|
|
552
|
+
/**
|
|
553
|
+
* Creates a new Diagnostic literal.
|
|
554
|
+
*/
|
|
555
|
+
function create(range, message, severity, code, source, relatedInformation) {
|
|
556
|
+
var result = { range: range, message: message };
|
|
557
|
+
if (Is.defined(severity)) {
|
|
558
|
+
result.severity = severity;
|
|
559
|
+
}
|
|
560
|
+
if (Is.defined(code)) {
|
|
561
|
+
result.code = code;
|
|
562
|
+
}
|
|
563
|
+
if (Is.defined(source)) {
|
|
564
|
+
result.source = source;
|
|
565
|
+
}
|
|
566
|
+
if (Is.defined(relatedInformation)) {
|
|
567
|
+
result.relatedInformation = relatedInformation;
|
|
568
|
+
}
|
|
569
|
+
return result;
|
|
570
|
+
}
|
|
571
|
+
Diagnostic.create = create;
|
|
572
|
+
/**
|
|
573
|
+
* Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.
|
|
574
|
+
*/
|
|
575
|
+
function is(value) {
|
|
576
|
+
var _a;
|
|
577
|
+
var candidate = value;
|
|
578
|
+
return Is.defined(candidate)
|
|
579
|
+
&& Range.is(candidate.range)
|
|
580
|
+
&& Is.string(candidate.message)
|
|
581
|
+
&& (Is.number(candidate.severity) || Is.undefined(candidate.severity))
|
|
582
|
+
&& (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
|
|
583
|
+
&& (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))
|
|
584
|
+
&& (Is.string(candidate.source) || Is.undefined(candidate.source))
|
|
585
|
+
&& (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
|
|
586
|
+
}
|
|
587
|
+
Diagnostic.is = is;
|
|
588
|
+
})(Diagnostic = exports.Diagnostic || (exports.Diagnostic = {}));
|
|
589
|
+
/**
|
|
590
|
+
* The Command namespace provides helper functions to work with
|
|
591
|
+
* [Command](#Command) literals.
|
|
592
|
+
*/
|
|
593
|
+
var Command;
|
|
594
|
+
(function (Command) {
|
|
595
|
+
/**
|
|
596
|
+
* Creates a new Command literal.
|
|
597
|
+
*/
|
|
598
|
+
function create(title, command) {
|
|
599
|
+
var args = [];
|
|
600
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
601
|
+
args[_i - 2] = arguments[_i];
|
|
602
|
+
}
|
|
603
|
+
var result = { title: title, command: command };
|
|
604
|
+
if (Is.defined(args) && args.length > 0) {
|
|
605
|
+
result.arguments = args;
|
|
606
|
+
}
|
|
607
|
+
return result;
|
|
608
|
+
}
|
|
609
|
+
Command.create = create;
|
|
610
|
+
/**
|
|
611
|
+
* Checks whether the given literal conforms to the [Command](#Command) interface.
|
|
612
|
+
*/
|
|
613
|
+
function is(value) {
|
|
614
|
+
var candidate = value;
|
|
615
|
+
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
|
616
|
+
}
|
|
617
|
+
Command.is = is;
|
|
618
|
+
})(Command = exports.Command || (exports.Command = {}));
|
|
619
|
+
/**
|
|
620
|
+
* The TextEdit namespace provides helper function to create replace,
|
|
621
|
+
* insert and delete edits more easily.
|
|
622
|
+
*/
|
|
623
|
+
var TextEdit;
|
|
624
|
+
(function (TextEdit) {
|
|
625
|
+
/**
|
|
626
|
+
* Creates a replace text edit.
|
|
627
|
+
* @param range The range of text to be replaced.
|
|
628
|
+
* @param newText The new text.
|
|
629
|
+
*/
|
|
630
|
+
function replace(range, newText) {
|
|
631
|
+
return { range: range, newText: newText };
|
|
632
|
+
}
|
|
633
|
+
TextEdit.replace = replace;
|
|
634
|
+
/**
|
|
635
|
+
* Creates a insert text edit.
|
|
636
|
+
* @param position The position to insert the text at.
|
|
637
|
+
* @param newText The text to be inserted.
|
|
638
|
+
*/
|
|
639
|
+
function insert(position, newText) {
|
|
640
|
+
return { range: { start: position, end: position }, newText: newText };
|
|
641
|
+
}
|
|
642
|
+
TextEdit.insert = insert;
|
|
643
|
+
/**
|
|
644
|
+
* Creates a delete text edit.
|
|
645
|
+
* @param range The range of text to be deleted.
|
|
646
|
+
*/
|
|
647
|
+
function del(range) {
|
|
648
|
+
return { range: range, newText: '' };
|
|
649
|
+
}
|
|
650
|
+
TextEdit.del = del;
|
|
651
|
+
function is(value) {
|
|
652
|
+
var candidate = value;
|
|
653
|
+
return Is.objectLiteral(candidate)
|
|
654
|
+
&& Is.string(candidate.newText)
|
|
655
|
+
&& Range.is(candidate.range);
|
|
656
|
+
}
|
|
657
|
+
TextEdit.is = is;
|
|
658
|
+
})(TextEdit = exports.TextEdit || (exports.TextEdit = {}));
|
|
659
|
+
var ChangeAnnotation;
|
|
660
|
+
(function (ChangeAnnotation) {
|
|
661
|
+
function create(label, needsConfirmation, description) {
|
|
662
|
+
var result = { label: label };
|
|
663
|
+
if (needsConfirmation !== undefined) {
|
|
664
|
+
result.needsConfirmation = needsConfirmation;
|
|
665
|
+
}
|
|
666
|
+
if (description !== undefined) {
|
|
667
|
+
result.description = description;
|
|
668
|
+
}
|
|
669
|
+
return result;
|
|
670
|
+
}
|
|
671
|
+
ChangeAnnotation.create = create;
|
|
672
|
+
function is(value) {
|
|
673
|
+
var candidate = value;
|
|
674
|
+
return candidate !== undefined && Is.objectLiteral(candidate) && Is.string(candidate.label) &&
|
|
675
|
+
(Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
|
|
676
|
+
(Is.string(candidate.description) || candidate.description === undefined);
|
|
677
|
+
}
|
|
678
|
+
ChangeAnnotation.is = is;
|
|
679
|
+
})(ChangeAnnotation = exports.ChangeAnnotation || (exports.ChangeAnnotation = {}));
|
|
680
|
+
var ChangeAnnotationIdentifier;
|
|
681
|
+
(function (ChangeAnnotationIdentifier) {
|
|
682
|
+
function is(value) {
|
|
683
|
+
var candidate = value;
|
|
684
|
+
return typeof candidate === 'string';
|
|
685
|
+
}
|
|
686
|
+
ChangeAnnotationIdentifier.is = is;
|
|
687
|
+
})(ChangeAnnotationIdentifier = exports.ChangeAnnotationIdentifier || (exports.ChangeAnnotationIdentifier = {}));
|
|
688
|
+
var AnnotatedTextEdit;
|
|
689
|
+
(function (AnnotatedTextEdit) {
|
|
690
|
+
/**
|
|
691
|
+
* Creates an annotated replace text edit.
|
|
692
|
+
*
|
|
693
|
+
* @param range The range of text to be replaced.
|
|
694
|
+
* @param newText The new text.
|
|
695
|
+
* @param annotation The annotation.
|
|
696
|
+
*/
|
|
697
|
+
function replace(range, newText, annotation) {
|
|
698
|
+
return { range: range, newText: newText, annotationId: annotation };
|
|
699
|
+
}
|
|
700
|
+
AnnotatedTextEdit.replace = replace;
|
|
701
|
+
/**
|
|
702
|
+
* Creates an annotated insert text edit.
|
|
703
|
+
*
|
|
704
|
+
* @param position The position to insert the text at.
|
|
705
|
+
* @param newText The text to be inserted.
|
|
706
|
+
* @param annotation The annotation.
|
|
707
|
+
*/
|
|
708
|
+
function insert(position, newText, annotation) {
|
|
709
|
+
return { range: { start: position, end: position }, newText: newText, annotationId: annotation };
|
|
710
|
+
}
|
|
711
|
+
AnnotatedTextEdit.insert = insert;
|
|
712
|
+
/**
|
|
713
|
+
* Creates an annotated delete text edit.
|
|
714
|
+
*
|
|
715
|
+
* @param range The range of text to be deleted.
|
|
716
|
+
* @param annotation The annotation.
|
|
717
|
+
*/
|
|
718
|
+
function del(range, annotation) {
|
|
719
|
+
return { range: range, newText: '', annotationId: annotation };
|
|
720
|
+
}
|
|
721
|
+
AnnotatedTextEdit.del = del;
|
|
722
|
+
function is(value) {
|
|
723
|
+
var candidate = value;
|
|
724
|
+
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
725
|
+
}
|
|
726
|
+
AnnotatedTextEdit.is = is;
|
|
727
|
+
})(AnnotatedTextEdit = exports.AnnotatedTextEdit || (exports.AnnotatedTextEdit = {}));
|
|
728
|
+
/**
|
|
729
|
+
* The TextDocumentEdit namespace provides helper function to create
|
|
730
|
+
* an edit that manipulates a text document.
|
|
731
|
+
*/
|
|
732
|
+
var TextDocumentEdit;
|
|
733
|
+
(function (TextDocumentEdit) {
|
|
734
|
+
/**
|
|
735
|
+
* Creates a new `TextDocumentEdit`
|
|
736
|
+
*/
|
|
737
|
+
function create(textDocument, edits) {
|
|
738
|
+
return { textDocument: textDocument, edits: edits };
|
|
739
|
+
}
|
|
740
|
+
TextDocumentEdit.create = create;
|
|
741
|
+
function is(value) {
|
|
742
|
+
var candidate = value;
|
|
743
|
+
return Is.defined(candidate)
|
|
744
|
+
&& OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
|
|
745
|
+
&& Array.isArray(candidate.edits);
|
|
746
|
+
}
|
|
747
|
+
TextDocumentEdit.is = is;
|
|
748
|
+
})(TextDocumentEdit = exports.TextDocumentEdit || (exports.TextDocumentEdit = {}));
|
|
749
|
+
var CreateFile;
|
|
750
|
+
(function (CreateFile) {
|
|
751
|
+
function create(uri, options, annotation) {
|
|
752
|
+
var result = {
|
|
753
|
+
kind: 'create',
|
|
754
|
+
uri: uri
|
|
755
|
+
};
|
|
756
|
+
if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
|
|
757
|
+
result.options = options;
|
|
758
|
+
}
|
|
759
|
+
if (annotation !== undefined) {
|
|
760
|
+
result.annotationId = annotation;
|
|
761
|
+
}
|
|
762
|
+
return result;
|
|
763
|
+
}
|
|
764
|
+
CreateFile.create = create;
|
|
765
|
+
function is(value) {
|
|
766
|
+
var candidate = value;
|
|
767
|
+
return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
|
|
768
|
+
((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));
|
|
769
|
+
}
|
|
770
|
+
CreateFile.is = is;
|
|
771
|
+
})(CreateFile = exports.CreateFile || (exports.CreateFile = {}));
|
|
772
|
+
var RenameFile;
|
|
773
|
+
(function (RenameFile) {
|
|
774
|
+
function create(oldUri, newUri, options, annotation) {
|
|
775
|
+
var result = {
|
|
776
|
+
kind: 'rename',
|
|
777
|
+
oldUri: oldUri,
|
|
778
|
+
newUri: newUri
|
|
779
|
+
};
|
|
780
|
+
if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
|
|
781
|
+
result.options = options;
|
|
782
|
+
}
|
|
783
|
+
if (annotation !== undefined) {
|
|
784
|
+
result.annotationId = annotation;
|
|
785
|
+
}
|
|
786
|
+
return result;
|
|
787
|
+
}
|
|
788
|
+
RenameFile.create = create;
|
|
789
|
+
function is(value) {
|
|
790
|
+
var candidate = value;
|
|
791
|
+
return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
|
|
792
|
+
((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));
|
|
793
|
+
}
|
|
794
|
+
RenameFile.is = is;
|
|
795
|
+
})(RenameFile = exports.RenameFile || (exports.RenameFile = {}));
|
|
796
|
+
var DeleteFile;
|
|
797
|
+
(function (DeleteFile) {
|
|
798
|
+
function create(uri, options, annotation) {
|
|
799
|
+
var result = {
|
|
800
|
+
kind: 'delete',
|
|
801
|
+
uri: uri
|
|
802
|
+
};
|
|
803
|
+
if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
|
|
804
|
+
result.options = options;
|
|
805
|
+
}
|
|
806
|
+
if (annotation !== undefined) {
|
|
807
|
+
result.annotationId = annotation;
|
|
808
|
+
}
|
|
809
|
+
return result;
|
|
810
|
+
}
|
|
811
|
+
DeleteFile.create = create;
|
|
812
|
+
function is(value) {
|
|
813
|
+
var candidate = value;
|
|
814
|
+
return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
|
|
815
|
+
((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));
|
|
816
|
+
}
|
|
817
|
+
DeleteFile.is = is;
|
|
818
|
+
})(DeleteFile = exports.DeleteFile || (exports.DeleteFile = {}));
|
|
819
|
+
var WorkspaceEdit;
|
|
820
|
+
(function (WorkspaceEdit) {
|
|
821
|
+
function is(value) {
|
|
822
|
+
var candidate = value;
|
|
823
|
+
return candidate &&
|
|
824
|
+
(candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
|
|
825
|
+
(candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {
|
|
826
|
+
if (Is.string(change.kind)) {
|
|
827
|
+
return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
return TextDocumentEdit.is(change);
|
|
831
|
+
}
|
|
832
|
+
}));
|
|
833
|
+
}
|
|
834
|
+
WorkspaceEdit.is = is;
|
|
835
|
+
})(WorkspaceEdit = exports.WorkspaceEdit || (exports.WorkspaceEdit = {}));
|
|
836
|
+
var TextEditChangeImpl = /** @class */ (function () {
|
|
837
|
+
function TextEditChangeImpl(edits, changeAnnotations) {
|
|
838
|
+
this.edits = edits;
|
|
839
|
+
this.changeAnnotations = changeAnnotations;
|
|
840
|
+
}
|
|
841
|
+
TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {
|
|
842
|
+
var edit;
|
|
843
|
+
var id;
|
|
844
|
+
if (annotation === undefined) {
|
|
845
|
+
edit = TextEdit.insert(position, newText);
|
|
846
|
+
}
|
|
847
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
848
|
+
id = annotation;
|
|
849
|
+
edit = AnnotatedTextEdit.insert(position, newText, annotation);
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
853
|
+
id = this.changeAnnotations.manage(annotation);
|
|
854
|
+
edit = AnnotatedTextEdit.insert(position, newText, id);
|
|
855
|
+
}
|
|
856
|
+
this.edits.push(edit);
|
|
857
|
+
if (id !== undefined) {
|
|
858
|
+
return id;
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {
|
|
862
|
+
var edit;
|
|
863
|
+
var id;
|
|
864
|
+
if (annotation === undefined) {
|
|
865
|
+
edit = TextEdit.replace(range, newText);
|
|
866
|
+
}
|
|
867
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
868
|
+
id = annotation;
|
|
869
|
+
edit = AnnotatedTextEdit.replace(range, newText, annotation);
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
873
|
+
id = this.changeAnnotations.manage(annotation);
|
|
874
|
+
edit = AnnotatedTextEdit.replace(range, newText, id);
|
|
875
|
+
}
|
|
876
|
+
this.edits.push(edit);
|
|
877
|
+
if (id !== undefined) {
|
|
878
|
+
return id;
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
TextEditChangeImpl.prototype.delete = function (range, annotation) {
|
|
882
|
+
var edit;
|
|
883
|
+
var id;
|
|
884
|
+
if (annotation === undefined) {
|
|
885
|
+
edit = TextEdit.del(range);
|
|
886
|
+
}
|
|
887
|
+
else if (ChangeAnnotationIdentifier.is(annotation)) {
|
|
888
|
+
id = annotation;
|
|
889
|
+
edit = AnnotatedTextEdit.del(range, annotation);
|
|
890
|
+
}
|
|
891
|
+
else {
|
|
892
|
+
this.assertChangeAnnotations(this.changeAnnotations);
|
|
893
|
+
id = this.changeAnnotations.manage(annotation);
|
|
894
|
+
edit = AnnotatedTextEdit.del(range, id);
|
|
895
|
+
}
|
|
896
|
+
this.edits.push(edit);
|
|
897
|
+
if (id !== undefined) {
|
|
898
|
+
return id;
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
TextEditChangeImpl.prototype.add = function (edit) {
|
|
902
|
+
this.edits.push(edit);
|
|
903
|
+
};
|
|
904
|
+
TextEditChangeImpl.prototype.all = function () {
|
|
905
|
+
return this.edits;
|
|
906
|
+
};
|
|
907
|
+
TextEditChangeImpl.prototype.clear = function () {
|
|
908
|
+
this.edits.splice(0, this.edits.length);
|
|
909
|
+
};
|
|
910
|
+
TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {
|
|
911
|
+
if (value === undefined) {
|
|
912
|
+
throw new Error("Text edit change is not configured to manage change annotations.");
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
return TextEditChangeImpl;
|
|
916
|
+
}());
|
|
917
|
+
/**
|
|
918
|
+
* A helper class
|
|
919
|
+
*/
|
|
920
|
+
var ChangeAnnotations = /** @class */ (function () {
|
|
921
|
+
function ChangeAnnotations(annotations) {
|
|
922
|
+
this._annotations = annotations === undefined ? Object.create(null) : annotations;
|
|
923
|
+
this._counter = 0;
|
|
924
|
+
this._size = 0;
|
|
925
|
+
}
|
|
926
|
+
ChangeAnnotations.prototype.all = function () {
|
|
927
|
+
return this._annotations;
|
|
928
|
+
};
|
|
929
|
+
Object.defineProperty(ChangeAnnotations.prototype, "size", {
|
|
930
|
+
get: function () {
|
|
931
|
+
return this._size;
|
|
932
|
+
},
|
|
933
|
+
enumerable: false,
|
|
934
|
+
configurable: true
|
|
935
|
+
});
|
|
936
|
+
ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
|
|
937
|
+
var id;
|
|
938
|
+
if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
|
|
939
|
+
id = idOrAnnotation;
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
id = this.nextId();
|
|
943
|
+
annotation = idOrAnnotation;
|
|
944
|
+
}
|
|
945
|
+
if (this._annotations[id] !== undefined) {
|
|
946
|
+
throw new Error("Id " + id + " is already in use.");
|
|
947
|
+
}
|
|
948
|
+
if (annotation === undefined) {
|
|
949
|
+
throw new Error("No annotation provided for id " + id);
|
|
950
|
+
}
|
|
951
|
+
this._annotations[id] = annotation;
|
|
952
|
+
this._size++;
|
|
953
|
+
return id;
|
|
954
|
+
};
|
|
955
|
+
ChangeAnnotations.prototype.nextId = function () {
|
|
956
|
+
this._counter++;
|
|
957
|
+
return this._counter.toString();
|
|
958
|
+
};
|
|
959
|
+
return ChangeAnnotations;
|
|
960
|
+
}());
|
|
961
|
+
/**
|
|
962
|
+
* A workspace change helps constructing changes to a workspace.
|
|
963
|
+
*/
|
|
964
|
+
var WorkspaceChange = /** @class */ (function () {
|
|
965
|
+
function WorkspaceChange(workspaceEdit) {
|
|
966
|
+
var _this = this;
|
|
967
|
+
this._textEditChanges = Object.create(null);
|
|
968
|
+
if (workspaceEdit !== undefined) {
|
|
969
|
+
this._workspaceEdit = workspaceEdit;
|
|
970
|
+
if (workspaceEdit.documentChanges) {
|
|
971
|
+
this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
|
|
972
|
+
workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
973
|
+
workspaceEdit.documentChanges.forEach(function (change) {
|
|
974
|
+
if (TextDocumentEdit.is(change)) {
|
|
975
|
+
var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);
|
|
976
|
+
_this._textEditChanges[change.textDocument.uri] = textEditChange;
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
else if (workspaceEdit.changes) {
|
|
981
|
+
Object.keys(workspaceEdit.changes).forEach(function (key) {
|
|
982
|
+
var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
|
983
|
+
_this._textEditChanges[key] = textEditChange;
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
else {
|
|
988
|
+
this._workspaceEdit = {};
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
Object.defineProperty(WorkspaceChange.prototype, "edit", {
|
|
992
|
+
/**
|
|
993
|
+
* Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal
|
|
994
|
+
* use to be returned from a workspace edit operation like rename.
|
|
995
|
+
*/
|
|
996
|
+
get: function () {
|
|
997
|
+
this.initDocumentChanges();
|
|
998
|
+
if (this._changeAnnotations !== undefined) {
|
|
999
|
+
if (this._changeAnnotations.size === 0) {
|
|
1000
|
+
this._workspaceEdit.changeAnnotations = undefined;
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
return this._workspaceEdit;
|
|
1007
|
+
},
|
|
1008
|
+
enumerable: false,
|
|
1009
|
+
configurable: true
|
|
1010
|
+
});
|
|
1011
|
+
WorkspaceChange.prototype.getTextEditChange = function (key) {
|
|
1012
|
+
if (OptionalVersionedTextDocumentIdentifier.is(key)) {
|
|
1013
|
+
this.initDocumentChanges();
|
|
1014
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
1015
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
1016
|
+
}
|
|
1017
|
+
var textDocument = { uri: key.uri, version: key.version };
|
|
1018
|
+
var result = this._textEditChanges[textDocument.uri];
|
|
1019
|
+
if (!result) {
|
|
1020
|
+
var edits = [];
|
|
1021
|
+
var textDocumentEdit = {
|
|
1022
|
+
textDocument: textDocument,
|
|
1023
|
+
edits: edits
|
|
1024
|
+
};
|
|
1025
|
+
this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
|
1026
|
+
result = new TextEditChangeImpl(edits, this._changeAnnotations);
|
|
1027
|
+
this._textEditChanges[textDocument.uri] = result;
|
|
1028
|
+
}
|
|
1029
|
+
return result;
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
this.initChanges();
|
|
1033
|
+
if (this._workspaceEdit.changes === undefined) {
|
|
1034
|
+
throw new Error('Workspace edit is not configured for normal text edit changes.');
|
|
1035
|
+
}
|
|
1036
|
+
var result = this._textEditChanges[key];
|
|
1037
|
+
if (!result) {
|
|
1038
|
+
var edits = [];
|
|
1039
|
+
this._workspaceEdit.changes[key] = edits;
|
|
1040
|
+
result = new TextEditChangeImpl(edits);
|
|
1041
|
+
this._textEditChanges[key] = result;
|
|
1042
|
+
}
|
|
1043
|
+
return result;
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
WorkspaceChange.prototype.initDocumentChanges = function () {
|
|
1047
|
+
if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
|
|
1048
|
+
this._changeAnnotations = new ChangeAnnotations();
|
|
1049
|
+
this._workspaceEdit.documentChanges = [];
|
|
1050
|
+
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
WorkspaceChange.prototype.initChanges = function () {
|
|
1054
|
+
if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
|
|
1055
|
+
this._workspaceEdit.changes = Object.create(null);
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {
|
|
1059
|
+
this.initDocumentChanges();
|
|
1060
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
1061
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
1062
|
+
}
|
|
1063
|
+
var annotation;
|
|
1064
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
1065
|
+
annotation = optionsOrAnnotation;
|
|
1066
|
+
}
|
|
1067
|
+
else {
|
|
1068
|
+
options = optionsOrAnnotation;
|
|
1069
|
+
}
|
|
1070
|
+
var operation;
|
|
1071
|
+
var id;
|
|
1072
|
+
if (annotation === undefined) {
|
|
1073
|
+
operation = CreateFile.create(uri, options);
|
|
1074
|
+
}
|
|
1075
|
+
else {
|
|
1076
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
1077
|
+
operation = CreateFile.create(uri, options, id);
|
|
1078
|
+
}
|
|
1079
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
1080
|
+
if (id !== undefined) {
|
|
1081
|
+
return id;
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {
|
|
1085
|
+
this.initDocumentChanges();
|
|
1086
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
1087
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
1088
|
+
}
|
|
1089
|
+
var annotation;
|
|
1090
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
1091
|
+
annotation = optionsOrAnnotation;
|
|
1092
|
+
}
|
|
1093
|
+
else {
|
|
1094
|
+
options = optionsOrAnnotation;
|
|
1095
|
+
}
|
|
1096
|
+
var operation;
|
|
1097
|
+
var id;
|
|
1098
|
+
if (annotation === undefined) {
|
|
1099
|
+
operation = RenameFile.create(oldUri, newUri, options);
|
|
1100
|
+
}
|
|
1101
|
+
else {
|
|
1102
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
1103
|
+
operation = RenameFile.create(oldUri, newUri, options, id);
|
|
1104
|
+
}
|
|
1105
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
1106
|
+
if (id !== undefined) {
|
|
1107
|
+
return id;
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {
|
|
1111
|
+
this.initDocumentChanges();
|
|
1112
|
+
if (this._workspaceEdit.documentChanges === undefined) {
|
|
1113
|
+
throw new Error('Workspace edit is not configured for document changes.');
|
|
1114
|
+
}
|
|
1115
|
+
var annotation;
|
|
1116
|
+
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
1117
|
+
annotation = optionsOrAnnotation;
|
|
1118
|
+
}
|
|
1119
|
+
else {
|
|
1120
|
+
options = optionsOrAnnotation;
|
|
1121
|
+
}
|
|
1122
|
+
var operation;
|
|
1123
|
+
var id;
|
|
1124
|
+
if (annotation === undefined) {
|
|
1125
|
+
operation = DeleteFile.create(uri, options);
|
|
1126
|
+
}
|
|
1127
|
+
else {
|
|
1128
|
+
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
|
|
1129
|
+
operation = DeleteFile.create(uri, options, id);
|
|
1130
|
+
}
|
|
1131
|
+
this._workspaceEdit.documentChanges.push(operation);
|
|
1132
|
+
if (id !== undefined) {
|
|
1133
|
+
return id;
|
|
1134
|
+
}
|
|
1135
|
+
};
|
|
1136
|
+
return WorkspaceChange;
|
|
1137
|
+
}());
|
|
1138
|
+
exports.WorkspaceChange = WorkspaceChange;
|
|
1139
|
+
/**
|
|
1140
|
+
* The TextDocumentIdentifier namespace provides helper functions to work with
|
|
1141
|
+
* [TextDocumentIdentifier](#TextDocumentIdentifier) literals.
|
|
1142
|
+
*/
|
|
1143
|
+
var TextDocumentIdentifier;
|
|
1144
|
+
(function (TextDocumentIdentifier) {
|
|
1145
|
+
/**
|
|
1146
|
+
* Creates a new TextDocumentIdentifier literal.
|
|
1147
|
+
* @param uri The document's uri.
|
|
1148
|
+
*/
|
|
1149
|
+
function create(uri) {
|
|
1150
|
+
return { uri: uri };
|
|
1151
|
+
}
|
|
1152
|
+
TextDocumentIdentifier.create = create;
|
|
1153
|
+
/**
|
|
1154
|
+
* Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.
|
|
1155
|
+
*/
|
|
1156
|
+
function is(value) {
|
|
1157
|
+
var candidate = value;
|
|
1158
|
+
return Is.defined(candidate) && Is.string(candidate.uri);
|
|
1159
|
+
}
|
|
1160
|
+
TextDocumentIdentifier.is = is;
|
|
1161
|
+
})(TextDocumentIdentifier = exports.TextDocumentIdentifier || (exports.TextDocumentIdentifier = {}));
|
|
1162
|
+
/**
|
|
1163
|
+
* The VersionedTextDocumentIdentifier namespace provides helper functions to work with
|
|
1164
|
+
* [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.
|
|
1165
|
+
*/
|
|
1166
|
+
var VersionedTextDocumentIdentifier;
|
|
1167
|
+
(function (VersionedTextDocumentIdentifier) {
|
|
1168
|
+
/**
|
|
1169
|
+
* Creates a new VersionedTextDocumentIdentifier literal.
|
|
1170
|
+
* @param uri The document's uri.
|
|
1171
|
+
* @param uri The document's text.
|
|
1172
|
+
*/
|
|
1173
|
+
function create(uri, version) {
|
|
1174
|
+
return { uri: uri, version: version };
|
|
1175
|
+
}
|
|
1176
|
+
VersionedTextDocumentIdentifier.create = create;
|
|
1177
|
+
/**
|
|
1178
|
+
* Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.
|
|
1179
|
+
*/
|
|
1180
|
+
function is(value) {
|
|
1181
|
+
var candidate = value;
|
|
1182
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
|
|
1183
|
+
}
|
|
1184
|
+
VersionedTextDocumentIdentifier.is = is;
|
|
1185
|
+
})(VersionedTextDocumentIdentifier = exports.VersionedTextDocumentIdentifier || (exports.VersionedTextDocumentIdentifier = {}));
|
|
1186
|
+
/**
|
|
1187
|
+
* The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
|
|
1188
|
+
* [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) literals.
|
|
1189
|
+
*/
|
|
1190
|
+
var OptionalVersionedTextDocumentIdentifier;
|
|
1191
|
+
(function (OptionalVersionedTextDocumentIdentifier) {
|
|
1192
|
+
/**
|
|
1193
|
+
* Creates a new OptionalVersionedTextDocumentIdentifier literal.
|
|
1194
|
+
* @param uri The document's uri.
|
|
1195
|
+
* @param uri The document's text.
|
|
1196
|
+
*/
|
|
1197
|
+
function create(uri, version) {
|
|
1198
|
+
return { uri: uri, version: version };
|
|
1199
|
+
}
|
|
1200
|
+
OptionalVersionedTextDocumentIdentifier.create = create;
|
|
1201
|
+
/**
|
|
1202
|
+
* Checks whether the given literal conforms to the [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) interface.
|
|
1203
|
+
*/
|
|
1204
|
+
function is(value) {
|
|
1205
|
+
var candidate = value;
|
|
1206
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
|
|
1207
|
+
}
|
|
1208
|
+
OptionalVersionedTextDocumentIdentifier.is = is;
|
|
1209
|
+
})(OptionalVersionedTextDocumentIdentifier = exports.OptionalVersionedTextDocumentIdentifier || (exports.OptionalVersionedTextDocumentIdentifier = {}));
|
|
1210
|
+
/**
|
|
1211
|
+
* The TextDocumentItem namespace provides helper functions to work with
|
|
1212
|
+
* [TextDocumentItem](#TextDocumentItem) literals.
|
|
1213
|
+
*/
|
|
1214
|
+
var TextDocumentItem;
|
|
1215
|
+
(function (TextDocumentItem) {
|
|
1216
|
+
/**
|
|
1217
|
+
* Creates a new TextDocumentItem literal.
|
|
1218
|
+
* @param uri The document's uri.
|
|
1219
|
+
* @param languageId The document's language identifier.
|
|
1220
|
+
* @param version The document's version number.
|
|
1221
|
+
* @param text The document's text.
|
|
1222
|
+
*/
|
|
1223
|
+
function create(uri, languageId, version, text) {
|
|
1224
|
+
return { uri: uri, languageId: languageId, version: version, text: text };
|
|
1225
|
+
}
|
|
1226
|
+
TextDocumentItem.create = create;
|
|
1227
|
+
/**
|
|
1228
|
+
* Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.
|
|
1229
|
+
*/
|
|
1230
|
+
function is(value) {
|
|
1231
|
+
var candidate = value;
|
|
1232
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
|
|
1233
|
+
}
|
|
1234
|
+
TextDocumentItem.is = is;
|
|
1235
|
+
})(TextDocumentItem = exports.TextDocumentItem || (exports.TextDocumentItem = {}));
|
|
1236
|
+
/**
|
|
1237
|
+
* Describes the content type that a client supports in various
|
|
1238
|
+
* result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
|
|
1239
|
+
*
|
|
1240
|
+
* Please note that `MarkupKinds` must not start with a `$`. This kinds
|
|
1241
|
+
* are reserved for internal usage.
|
|
1242
|
+
*/
|
|
1243
|
+
var MarkupKind;
|
|
1244
|
+
(function (MarkupKind) {
|
|
1245
|
+
/**
|
|
1246
|
+
* Plain text is supported as a content format
|
|
1247
|
+
*/
|
|
1248
|
+
MarkupKind.PlainText = 'plaintext';
|
|
1249
|
+
/**
|
|
1250
|
+
* Markdown is supported as a content format
|
|
1251
|
+
*/
|
|
1252
|
+
MarkupKind.Markdown = 'markdown';
|
|
1253
|
+
})(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
|
|
1254
|
+
(function (MarkupKind) {
|
|
1255
|
+
/**
|
|
1256
|
+
* Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.
|
|
1257
|
+
*/
|
|
1258
|
+
function is(value) {
|
|
1259
|
+
var candidate = value;
|
|
1260
|
+
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
|
1261
|
+
}
|
|
1262
|
+
MarkupKind.is = is;
|
|
1263
|
+
})(MarkupKind = exports.MarkupKind || (exports.MarkupKind = {}));
|
|
1264
|
+
var MarkupContent;
|
|
1265
|
+
(function (MarkupContent) {
|
|
1266
|
+
/**
|
|
1267
|
+
* Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.
|
|
1268
|
+
*/
|
|
1269
|
+
function is(value) {
|
|
1270
|
+
var candidate = value;
|
|
1271
|
+
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
|
1272
|
+
}
|
|
1273
|
+
MarkupContent.is = is;
|
|
1274
|
+
})(MarkupContent = exports.MarkupContent || (exports.MarkupContent = {}));
|
|
1275
|
+
/**
|
|
1276
|
+
* The kind of a completion entry.
|
|
1277
|
+
*/
|
|
1278
|
+
var CompletionItemKind;
|
|
1279
|
+
(function (CompletionItemKind) {
|
|
1280
|
+
CompletionItemKind.Text = 1;
|
|
1281
|
+
CompletionItemKind.Method = 2;
|
|
1282
|
+
CompletionItemKind.Function = 3;
|
|
1283
|
+
CompletionItemKind.Constructor = 4;
|
|
1284
|
+
CompletionItemKind.Field = 5;
|
|
1285
|
+
CompletionItemKind.Variable = 6;
|
|
1286
|
+
CompletionItemKind.Class = 7;
|
|
1287
|
+
CompletionItemKind.Interface = 8;
|
|
1288
|
+
CompletionItemKind.Module = 9;
|
|
1289
|
+
CompletionItemKind.Property = 10;
|
|
1290
|
+
CompletionItemKind.Unit = 11;
|
|
1291
|
+
CompletionItemKind.Value = 12;
|
|
1292
|
+
CompletionItemKind.Enum = 13;
|
|
1293
|
+
CompletionItemKind.Keyword = 14;
|
|
1294
|
+
CompletionItemKind.Snippet = 15;
|
|
1295
|
+
CompletionItemKind.Color = 16;
|
|
1296
|
+
CompletionItemKind.File = 17;
|
|
1297
|
+
CompletionItemKind.Reference = 18;
|
|
1298
|
+
CompletionItemKind.Folder = 19;
|
|
1299
|
+
CompletionItemKind.EnumMember = 20;
|
|
1300
|
+
CompletionItemKind.Constant = 21;
|
|
1301
|
+
CompletionItemKind.Struct = 22;
|
|
1302
|
+
CompletionItemKind.Event = 23;
|
|
1303
|
+
CompletionItemKind.Operator = 24;
|
|
1304
|
+
CompletionItemKind.TypeParameter = 25;
|
|
1305
|
+
})(CompletionItemKind = exports.CompletionItemKind || (exports.CompletionItemKind = {}));
|
|
1306
|
+
/**
|
|
1307
|
+
* Defines whether the insert text in a completion item should be interpreted as
|
|
1308
|
+
* plain text or a snippet.
|
|
1309
|
+
*/
|
|
1310
|
+
var InsertTextFormat;
|
|
1311
|
+
(function (InsertTextFormat) {
|
|
1312
|
+
/**
|
|
1313
|
+
* The primary text to be inserted is treated as a plain string.
|
|
1314
|
+
*/
|
|
1315
|
+
InsertTextFormat.PlainText = 1;
|
|
1316
|
+
/**
|
|
1317
|
+
* The primary text to be inserted is treated as a snippet.
|
|
1318
|
+
*
|
|
1319
|
+
* A snippet can define tab stops and placeholders with `$1`, `$2`
|
|
1320
|
+
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
|
|
1321
|
+
* the end of the snippet. Placeholders with equal identifiers are linked,
|
|
1322
|
+
* that is typing in one will update others too.
|
|
1323
|
+
*
|
|
1324
|
+
* See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
|
|
1325
|
+
*/
|
|
1326
|
+
InsertTextFormat.Snippet = 2;
|
|
1327
|
+
})(InsertTextFormat = exports.InsertTextFormat || (exports.InsertTextFormat = {}));
|
|
1328
|
+
/**
|
|
1329
|
+
* Completion item tags are extra annotations that tweak the rendering of a completion
|
|
1330
|
+
* item.
|
|
1331
|
+
*
|
|
1332
|
+
* @since 3.15.0
|
|
1333
|
+
*/
|
|
1334
|
+
var CompletionItemTag;
|
|
1335
|
+
(function (CompletionItemTag) {
|
|
1336
|
+
/**
|
|
1337
|
+
* Render a completion as obsolete, usually using a strike-out.
|
|
1338
|
+
*/
|
|
1339
|
+
CompletionItemTag.Deprecated = 1;
|
|
1340
|
+
})(CompletionItemTag = exports.CompletionItemTag || (exports.CompletionItemTag = {}));
|
|
1341
|
+
/**
|
|
1342
|
+
* The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
|
|
1343
|
+
*
|
|
1344
|
+
* @since 3.16.0
|
|
1345
|
+
*/
|
|
1346
|
+
var InsertReplaceEdit;
|
|
1347
|
+
(function (InsertReplaceEdit) {
|
|
1348
|
+
/**
|
|
1349
|
+
* Creates a new insert / replace edit
|
|
1350
|
+
*/
|
|
1351
|
+
function create(newText, insert, replace) {
|
|
1352
|
+
return { newText: newText, insert: insert, replace: replace };
|
|
1353
|
+
}
|
|
1354
|
+
InsertReplaceEdit.create = create;
|
|
1355
|
+
/**
|
|
1356
|
+
* Checks whether the given literal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface.
|
|
1357
|
+
*/
|
|
1358
|
+
function is(value) {
|
|
1359
|
+
var candidate = value;
|
|
1360
|
+
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
|
|
1361
|
+
}
|
|
1362
|
+
InsertReplaceEdit.is = is;
|
|
1363
|
+
})(InsertReplaceEdit = exports.InsertReplaceEdit || (exports.InsertReplaceEdit = {}));
|
|
1364
|
+
/**
|
|
1365
|
+
* How whitespace and indentation is handled during completion
|
|
1366
|
+
* item insertion.
|
|
1367
|
+
*
|
|
1368
|
+
* @since 3.16.0
|
|
1369
|
+
*/
|
|
1370
|
+
var InsertTextMode;
|
|
1371
|
+
(function (InsertTextMode) {
|
|
1372
|
+
/**
|
|
1373
|
+
* The insertion or replace strings is taken as it is. If the
|
|
1374
|
+
* value is multi line the lines below the cursor will be
|
|
1375
|
+
* inserted using the indentation defined in the string value.
|
|
1376
|
+
* The client will not apply any kind of adjustments to the
|
|
1377
|
+
* string.
|
|
1378
|
+
*/
|
|
1379
|
+
InsertTextMode.asIs = 1;
|
|
1380
|
+
/**
|
|
1381
|
+
* The editor adjusts leading whitespace of new lines so that
|
|
1382
|
+
* they match the indentation up to the cursor of the line for
|
|
1383
|
+
* which the item is accepted.
|
|
1384
|
+
*
|
|
1385
|
+
* Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
|
|
1386
|
+
* multi line completion item is indented using 2 tabs and all
|
|
1387
|
+
* following lines inserted will be indented using 2 tabs as well.
|
|
1388
|
+
*/
|
|
1389
|
+
InsertTextMode.adjustIndentation = 2;
|
|
1390
|
+
})(InsertTextMode = exports.InsertTextMode || (exports.InsertTextMode = {}));
|
|
1391
|
+
/**
|
|
1392
|
+
* The CompletionItem namespace provides functions to deal with
|
|
1393
|
+
* completion items.
|
|
1394
|
+
*/
|
|
1395
|
+
var CompletionItem;
|
|
1396
|
+
(function (CompletionItem) {
|
|
1397
|
+
/**
|
|
1398
|
+
* Create a completion item and seed it with a label.
|
|
1399
|
+
* @param label The completion item's label
|
|
1400
|
+
*/
|
|
1401
|
+
function create(label) {
|
|
1402
|
+
return { label: label };
|
|
1403
|
+
}
|
|
1404
|
+
CompletionItem.create = create;
|
|
1405
|
+
})(CompletionItem = exports.CompletionItem || (exports.CompletionItem = {}));
|
|
1406
|
+
/**
|
|
1407
|
+
* The CompletionList namespace provides functions to deal with
|
|
1408
|
+
* completion lists.
|
|
1409
|
+
*/
|
|
1410
|
+
var CompletionList;
|
|
1411
|
+
(function (CompletionList) {
|
|
1412
|
+
/**
|
|
1413
|
+
* Creates a new completion list.
|
|
1414
|
+
*
|
|
1415
|
+
* @param items The completion items.
|
|
1416
|
+
* @param isIncomplete The list is not complete.
|
|
1417
|
+
*/
|
|
1418
|
+
function create(items, isIncomplete) {
|
|
1419
|
+
return { items: items ? items : [], isIncomplete: !!isIncomplete };
|
|
1420
|
+
}
|
|
1421
|
+
CompletionList.create = create;
|
|
1422
|
+
})(CompletionList = exports.CompletionList || (exports.CompletionList = {}));
|
|
1423
|
+
var MarkedString;
|
|
1424
|
+
(function (MarkedString) {
|
|
1425
|
+
/**
|
|
1426
|
+
* Creates a marked string from plain text.
|
|
1427
|
+
*
|
|
1428
|
+
* @param plainText The plain text.
|
|
1429
|
+
*/
|
|
1430
|
+
function fromPlainText(plainText) {
|
|
1431
|
+
return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
|
|
1432
|
+
}
|
|
1433
|
+
MarkedString.fromPlainText = fromPlainText;
|
|
1434
|
+
/**
|
|
1435
|
+
* Checks whether the given value conforms to the [MarkedString](#MarkedString) type.
|
|
1436
|
+
*/
|
|
1437
|
+
function is(value) {
|
|
1438
|
+
var candidate = value;
|
|
1439
|
+
return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
|
|
1440
|
+
}
|
|
1441
|
+
MarkedString.is = is;
|
|
1442
|
+
})(MarkedString = exports.MarkedString || (exports.MarkedString = {}));
|
|
1443
|
+
var Hover;
|
|
1444
|
+
(function (Hover) {
|
|
1445
|
+
/**
|
|
1446
|
+
* Checks whether the given value conforms to the [Hover](#Hover) interface.
|
|
1447
|
+
*/
|
|
1448
|
+
function is(value) {
|
|
1449
|
+
var candidate = value;
|
|
1450
|
+
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
|
|
1451
|
+
MarkedString.is(candidate.contents) ||
|
|
1452
|
+
Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
|
|
1453
|
+
}
|
|
1454
|
+
Hover.is = is;
|
|
1455
|
+
})(Hover = exports.Hover || (exports.Hover = {}));
|
|
1456
|
+
/**
|
|
1457
|
+
* The ParameterInformation namespace provides helper functions to work with
|
|
1458
|
+
* [ParameterInformation](#ParameterInformation) literals.
|
|
1459
|
+
*/
|
|
1460
|
+
var ParameterInformation;
|
|
1461
|
+
(function (ParameterInformation) {
|
|
1462
|
+
/**
|
|
1463
|
+
* Creates a new parameter information literal.
|
|
1464
|
+
*
|
|
1465
|
+
* @param label A label string.
|
|
1466
|
+
* @param documentation A doc string.
|
|
1467
|
+
*/
|
|
1468
|
+
function create(label, documentation) {
|
|
1469
|
+
return documentation ? { label: label, documentation: documentation } : { label: label };
|
|
1470
|
+
}
|
|
1471
|
+
ParameterInformation.create = create;
|
|
1472
|
+
})(ParameterInformation = exports.ParameterInformation || (exports.ParameterInformation = {}));
|
|
1473
|
+
/**
|
|
1474
|
+
* The SignatureInformation namespace provides helper functions to work with
|
|
1475
|
+
* [SignatureInformation](#SignatureInformation) literals.
|
|
1476
|
+
*/
|
|
1477
|
+
var SignatureInformation;
|
|
1478
|
+
(function (SignatureInformation) {
|
|
1479
|
+
function create(label, documentation) {
|
|
1480
|
+
var parameters = [];
|
|
1481
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
1482
|
+
parameters[_i - 2] = arguments[_i];
|
|
1483
|
+
}
|
|
1484
|
+
var result = { label: label };
|
|
1485
|
+
if (Is.defined(documentation)) {
|
|
1486
|
+
result.documentation = documentation;
|
|
1487
|
+
}
|
|
1488
|
+
if (Is.defined(parameters)) {
|
|
1489
|
+
result.parameters = parameters;
|
|
1490
|
+
}
|
|
1491
|
+
else {
|
|
1492
|
+
result.parameters = [];
|
|
1493
|
+
}
|
|
1494
|
+
return result;
|
|
1495
|
+
}
|
|
1496
|
+
SignatureInformation.create = create;
|
|
1497
|
+
})(SignatureInformation = exports.SignatureInformation || (exports.SignatureInformation = {}));
|
|
1498
|
+
/**
|
|
1499
|
+
* A document highlight kind.
|
|
1500
|
+
*/
|
|
1501
|
+
var DocumentHighlightKind;
|
|
1502
|
+
(function (DocumentHighlightKind) {
|
|
1503
|
+
/**
|
|
1504
|
+
* A textual occurrence.
|
|
1505
|
+
*/
|
|
1506
|
+
DocumentHighlightKind.Text = 1;
|
|
1507
|
+
/**
|
|
1508
|
+
* Read-access of a symbol, like reading a variable.
|
|
1509
|
+
*/
|
|
1510
|
+
DocumentHighlightKind.Read = 2;
|
|
1511
|
+
/**
|
|
1512
|
+
* Write-access of a symbol, like writing to a variable.
|
|
1513
|
+
*/
|
|
1514
|
+
DocumentHighlightKind.Write = 3;
|
|
1515
|
+
})(DocumentHighlightKind = exports.DocumentHighlightKind || (exports.DocumentHighlightKind = {}));
|
|
1516
|
+
/**
|
|
1517
|
+
* DocumentHighlight namespace to provide helper functions to work with
|
|
1518
|
+
* [DocumentHighlight](#DocumentHighlight) literals.
|
|
1519
|
+
*/
|
|
1520
|
+
var DocumentHighlight;
|
|
1521
|
+
(function (DocumentHighlight) {
|
|
1522
|
+
/**
|
|
1523
|
+
* Create a DocumentHighlight object.
|
|
1524
|
+
* @param range The range the highlight applies to.
|
|
1525
|
+
*/
|
|
1526
|
+
function create(range, kind) {
|
|
1527
|
+
var result = { range: range };
|
|
1528
|
+
if (Is.number(kind)) {
|
|
1529
|
+
result.kind = kind;
|
|
1530
|
+
}
|
|
1531
|
+
return result;
|
|
1532
|
+
}
|
|
1533
|
+
DocumentHighlight.create = create;
|
|
1534
|
+
})(DocumentHighlight = exports.DocumentHighlight || (exports.DocumentHighlight = {}));
|
|
1535
|
+
/**
|
|
1536
|
+
* A symbol kind.
|
|
1537
|
+
*/
|
|
1538
|
+
var SymbolKind;
|
|
1539
|
+
(function (SymbolKind) {
|
|
1540
|
+
SymbolKind.File = 1;
|
|
1541
|
+
SymbolKind.Module = 2;
|
|
1542
|
+
SymbolKind.Namespace = 3;
|
|
1543
|
+
SymbolKind.Package = 4;
|
|
1544
|
+
SymbolKind.Class = 5;
|
|
1545
|
+
SymbolKind.Method = 6;
|
|
1546
|
+
SymbolKind.Property = 7;
|
|
1547
|
+
SymbolKind.Field = 8;
|
|
1548
|
+
SymbolKind.Constructor = 9;
|
|
1549
|
+
SymbolKind.Enum = 10;
|
|
1550
|
+
SymbolKind.Interface = 11;
|
|
1551
|
+
SymbolKind.Function = 12;
|
|
1552
|
+
SymbolKind.Variable = 13;
|
|
1553
|
+
SymbolKind.Constant = 14;
|
|
1554
|
+
SymbolKind.String = 15;
|
|
1555
|
+
SymbolKind.Number = 16;
|
|
1556
|
+
SymbolKind.Boolean = 17;
|
|
1557
|
+
SymbolKind.Array = 18;
|
|
1558
|
+
SymbolKind.Object = 19;
|
|
1559
|
+
SymbolKind.Key = 20;
|
|
1560
|
+
SymbolKind.Null = 21;
|
|
1561
|
+
SymbolKind.EnumMember = 22;
|
|
1562
|
+
SymbolKind.Struct = 23;
|
|
1563
|
+
SymbolKind.Event = 24;
|
|
1564
|
+
SymbolKind.Operator = 25;
|
|
1565
|
+
SymbolKind.TypeParameter = 26;
|
|
1566
|
+
})(SymbolKind = exports.SymbolKind || (exports.SymbolKind = {}));
|
|
1567
|
+
/**
|
|
1568
|
+
* Symbol tags are extra annotations that tweak the rendering of a symbol.
|
|
1569
|
+
* @since 3.16
|
|
1570
|
+
*/
|
|
1571
|
+
var SymbolTag;
|
|
1572
|
+
(function (SymbolTag) {
|
|
1573
|
+
/**
|
|
1574
|
+
* Render a symbol as obsolete, usually using a strike-out.
|
|
1575
|
+
*/
|
|
1576
|
+
SymbolTag.Deprecated = 1;
|
|
1577
|
+
})(SymbolTag = exports.SymbolTag || (exports.SymbolTag = {}));
|
|
1578
|
+
var SymbolInformation;
|
|
1579
|
+
(function (SymbolInformation) {
|
|
1580
|
+
/**
|
|
1581
|
+
* Creates a new symbol information literal.
|
|
1582
|
+
*
|
|
1583
|
+
* @param name The name of the symbol.
|
|
1584
|
+
* @param kind The kind of the symbol.
|
|
1585
|
+
* @param range The range of the location of the symbol.
|
|
1586
|
+
* @param uri The resource of the location of symbol, defaults to the current document.
|
|
1587
|
+
* @param containerName The name of the symbol containing the symbol.
|
|
1588
|
+
*/
|
|
1589
|
+
function create(name, kind, range, uri, containerName) {
|
|
1590
|
+
var result = {
|
|
1591
|
+
name: name,
|
|
1592
|
+
kind: kind,
|
|
1593
|
+
location: { uri: uri, range: range }
|
|
1594
|
+
};
|
|
1595
|
+
if (containerName) {
|
|
1596
|
+
result.containerName = containerName;
|
|
1597
|
+
}
|
|
1598
|
+
return result;
|
|
1599
|
+
}
|
|
1600
|
+
SymbolInformation.create = create;
|
|
1601
|
+
})(SymbolInformation = exports.SymbolInformation || (exports.SymbolInformation = {}));
|
|
1602
|
+
var DocumentSymbol;
|
|
1603
|
+
(function (DocumentSymbol) {
|
|
1604
|
+
/**
|
|
1605
|
+
* Creates a new symbol information literal.
|
|
1606
|
+
*
|
|
1607
|
+
* @param name The name of the symbol.
|
|
1608
|
+
* @param detail The detail of the symbol.
|
|
1609
|
+
* @param kind The kind of the symbol.
|
|
1610
|
+
* @param range The range of the symbol.
|
|
1611
|
+
* @param selectionRange The selectionRange of the symbol.
|
|
1612
|
+
* @param children Children of the symbol.
|
|
1613
|
+
*/
|
|
1614
|
+
function create(name, detail, kind, range, selectionRange, children) {
|
|
1615
|
+
var result = {
|
|
1616
|
+
name: name,
|
|
1617
|
+
detail: detail,
|
|
1618
|
+
kind: kind,
|
|
1619
|
+
range: range,
|
|
1620
|
+
selectionRange: selectionRange
|
|
1621
|
+
};
|
|
1622
|
+
if (children !== undefined) {
|
|
1623
|
+
result.children = children;
|
|
1624
|
+
}
|
|
1625
|
+
return result;
|
|
1626
|
+
}
|
|
1627
|
+
DocumentSymbol.create = create;
|
|
1628
|
+
/**
|
|
1629
|
+
* Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.
|
|
1630
|
+
*/
|
|
1631
|
+
function is(value) {
|
|
1632
|
+
var candidate = value;
|
|
1633
|
+
return candidate &&
|
|
1634
|
+
Is.string(candidate.name) && Is.number(candidate.kind) &&
|
|
1635
|
+
Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
|
|
1636
|
+
(candidate.detail === undefined || Is.string(candidate.detail)) &&
|
|
1637
|
+
(candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&
|
|
1638
|
+
(candidate.children === undefined || Array.isArray(candidate.children)) &&
|
|
1639
|
+
(candidate.tags === undefined || Array.isArray(candidate.tags));
|
|
1640
|
+
}
|
|
1641
|
+
DocumentSymbol.is = is;
|
|
1642
|
+
})(DocumentSymbol = exports.DocumentSymbol || (exports.DocumentSymbol = {}));
|
|
1643
|
+
/**
|
|
1644
|
+
* A set of predefined code action kinds
|
|
1645
|
+
*/
|
|
1646
|
+
var CodeActionKind;
|
|
1647
|
+
(function (CodeActionKind) {
|
|
1648
|
+
/**
|
|
1649
|
+
* Empty kind.
|
|
1650
|
+
*/
|
|
1651
|
+
CodeActionKind.Empty = '';
|
|
1652
|
+
/**
|
|
1653
|
+
* Base kind for quickfix actions: 'quickfix'
|
|
1654
|
+
*/
|
|
1655
|
+
CodeActionKind.QuickFix = 'quickfix';
|
|
1656
|
+
/**
|
|
1657
|
+
* Base kind for refactoring actions: 'refactor'
|
|
1658
|
+
*/
|
|
1659
|
+
CodeActionKind.Refactor = 'refactor';
|
|
1660
|
+
/**
|
|
1661
|
+
* Base kind for refactoring extraction actions: 'refactor.extract'
|
|
1662
|
+
*
|
|
1663
|
+
* Example extract actions:
|
|
1664
|
+
*
|
|
1665
|
+
* - Extract method
|
|
1666
|
+
* - Extract function
|
|
1667
|
+
* - Extract variable
|
|
1668
|
+
* - Extract interface from class
|
|
1669
|
+
* - ...
|
|
1670
|
+
*/
|
|
1671
|
+
CodeActionKind.RefactorExtract = 'refactor.extract';
|
|
1672
|
+
/**
|
|
1673
|
+
* Base kind for refactoring inline actions: 'refactor.inline'
|
|
1674
|
+
*
|
|
1675
|
+
* Example inline actions:
|
|
1676
|
+
*
|
|
1677
|
+
* - Inline function
|
|
1678
|
+
* - Inline variable
|
|
1679
|
+
* - Inline constant
|
|
1680
|
+
* - ...
|
|
1681
|
+
*/
|
|
1682
|
+
CodeActionKind.RefactorInline = 'refactor.inline';
|
|
1683
|
+
/**
|
|
1684
|
+
* Base kind for refactoring rewrite actions: 'refactor.rewrite'
|
|
1685
|
+
*
|
|
1686
|
+
* Example rewrite actions:
|
|
1687
|
+
*
|
|
1688
|
+
* - Convert JavaScript function to class
|
|
1689
|
+
* - Add or remove parameter
|
|
1690
|
+
* - Encapsulate field
|
|
1691
|
+
* - Make method static
|
|
1692
|
+
* - Move method to base class
|
|
1693
|
+
* - ...
|
|
1694
|
+
*/
|
|
1695
|
+
CodeActionKind.RefactorRewrite = 'refactor.rewrite';
|
|
1696
|
+
/**
|
|
1697
|
+
* Base kind for source actions: `source`
|
|
1698
|
+
*
|
|
1699
|
+
* Source code actions apply to the entire file.
|
|
1700
|
+
*/
|
|
1701
|
+
CodeActionKind.Source = 'source';
|
|
1702
|
+
/**
|
|
1703
|
+
* Base kind for an organize imports source action: `source.organizeImports`
|
|
1704
|
+
*/
|
|
1705
|
+
CodeActionKind.SourceOrganizeImports = 'source.organizeImports';
|
|
1706
|
+
/**
|
|
1707
|
+
* Base kind for auto-fix source actions: `source.fixAll`.
|
|
1708
|
+
*
|
|
1709
|
+
* Fix all actions automatically fix errors that have a clear fix that do not require user input.
|
|
1710
|
+
* They should not suppress errors or perform unsafe fixes such as generating new types or classes.
|
|
1711
|
+
*
|
|
1712
|
+
* @since 3.15.0
|
|
1713
|
+
*/
|
|
1714
|
+
CodeActionKind.SourceFixAll = 'source.fixAll';
|
|
1715
|
+
})(CodeActionKind = exports.CodeActionKind || (exports.CodeActionKind = {}));
|
|
1716
|
+
/**
|
|
1717
|
+
* The CodeActionContext namespace provides helper functions to work with
|
|
1718
|
+
* [CodeActionContext](#CodeActionContext) literals.
|
|
1719
|
+
*/
|
|
1720
|
+
var CodeActionContext;
|
|
1721
|
+
(function (CodeActionContext) {
|
|
1722
|
+
/**
|
|
1723
|
+
* Creates a new CodeActionContext literal.
|
|
1724
|
+
*/
|
|
1725
|
+
function create(diagnostics, only) {
|
|
1726
|
+
var result = { diagnostics: diagnostics };
|
|
1727
|
+
if (only !== undefined && only !== null) {
|
|
1728
|
+
result.only = only;
|
|
1729
|
+
}
|
|
1730
|
+
return result;
|
|
1731
|
+
}
|
|
1732
|
+
CodeActionContext.create = create;
|
|
1733
|
+
/**
|
|
1734
|
+
* Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.
|
|
1735
|
+
*/
|
|
1736
|
+
function is(value) {
|
|
1737
|
+
var candidate = value;
|
|
1738
|
+
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string));
|
|
1739
|
+
}
|
|
1740
|
+
CodeActionContext.is = is;
|
|
1741
|
+
})(CodeActionContext = exports.CodeActionContext || (exports.CodeActionContext = {}));
|
|
1742
|
+
var CodeAction;
|
|
1743
|
+
(function (CodeAction) {
|
|
1744
|
+
function create(title, kindOrCommandOrEdit, kind) {
|
|
1745
|
+
var result = { title: title };
|
|
1746
|
+
var checkKind = true;
|
|
1747
|
+
if (typeof kindOrCommandOrEdit === 'string') {
|
|
1748
|
+
checkKind = false;
|
|
1749
|
+
result.kind = kindOrCommandOrEdit;
|
|
1750
|
+
}
|
|
1751
|
+
else if (Command.is(kindOrCommandOrEdit)) {
|
|
1752
|
+
result.command = kindOrCommandOrEdit;
|
|
1753
|
+
}
|
|
1754
|
+
else {
|
|
1755
|
+
result.edit = kindOrCommandOrEdit;
|
|
1756
|
+
}
|
|
1757
|
+
if (checkKind && kind !== undefined) {
|
|
1758
|
+
result.kind = kind;
|
|
1759
|
+
}
|
|
1760
|
+
return result;
|
|
1761
|
+
}
|
|
1762
|
+
CodeAction.create = create;
|
|
1763
|
+
function is(value) {
|
|
1764
|
+
var candidate = value;
|
|
1765
|
+
return candidate && Is.string(candidate.title) &&
|
|
1766
|
+
(candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
|
|
1767
|
+
(candidate.kind === undefined || Is.string(candidate.kind)) &&
|
|
1768
|
+
(candidate.edit !== undefined || candidate.command !== undefined) &&
|
|
1769
|
+
(candidate.command === undefined || Command.is(candidate.command)) &&
|
|
1770
|
+
(candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&
|
|
1771
|
+
(candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));
|
|
1772
|
+
}
|
|
1773
|
+
CodeAction.is = is;
|
|
1774
|
+
})(CodeAction = exports.CodeAction || (exports.CodeAction = {}));
|
|
1775
|
+
/**
|
|
1776
|
+
* The CodeLens namespace provides helper functions to work with
|
|
1777
|
+
* [CodeLens](#CodeLens) literals.
|
|
1778
|
+
*/
|
|
1779
|
+
var CodeLens;
|
|
1780
|
+
(function (CodeLens) {
|
|
1781
|
+
/**
|
|
1782
|
+
* Creates a new CodeLens literal.
|
|
1783
|
+
*/
|
|
1784
|
+
function create(range, data) {
|
|
1785
|
+
var result = { range: range };
|
|
1786
|
+
if (Is.defined(data)) {
|
|
1787
|
+
result.data = data;
|
|
1788
|
+
}
|
|
1789
|
+
return result;
|
|
1790
|
+
}
|
|
1791
|
+
CodeLens.create = create;
|
|
1792
|
+
/**
|
|
1793
|
+
* Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.
|
|
1794
|
+
*/
|
|
1795
|
+
function is(value) {
|
|
1796
|
+
var candidate = value;
|
|
1797
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
|
1798
|
+
}
|
|
1799
|
+
CodeLens.is = is;
|
|
1800
|
+
})(CodeLens = exports.CodeLens || (exports.CodeLens = {}));
|
|
1801
|
+
/**
|
|
1802
|
+
* The FormattingOptions namespace provides helper functions to work with
|
|
1803
|
+
* [FormattingOptions](#FormattingOptions) literals.
|
|
1804
|
+
*/
|
|
1805
|
+
var FormattingOptions;
|
|
1806
|
+
(function (FormattingOptions) {
|
|
1807
|
+
/**
|
|
1808
|
+
* Creates a new FormattingOptions literal.
|
|
1809
|
+
*/
|
|
1810
|
+
function create(tabSize, insertSpaces) {
|
|
1811
|
+
return { tabSize: tabSize, insertSpaces: insertSpaces };
|
|
1812
|
+
}
|
|
1813
|
+
FormattingOptions.create = create;
|
|
1814
|
+
/**
|
|
1815
|
+
* Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.
|
|
1816
|
+
*/
|
|
1817
|
+
function is(value) {
|
|
1818
|
+
var candidate = value;
|
|
1819
|
+
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
|
1820
|
+
}
|
|
1821
|
+
FormattingOptions.is = is;
|
|
1822
|
+
})(FormattingOptions = exports.FormattingOptions || (exports.FormattingOptions = {}));
|
|
1823
|
+
/**
|
|
1824
|
+
* The DocumentLink namespace provides helper functions to work with
|
|
1825
|
+
* [DocumentLink](#DocumentLink) literals.
|
|
1826
|
+
*/
|
|
1827
|
+
var DocumentLink;
|
|
1828
|
+
(function (DocumentLink) {
|
|
1829
|
+
/**
|
|
1830
|
+
* Creates a new DocumentLink literal.
|
|
1831
|
+
*/
|
|
1832
|
+
function create(range, target, data) {
|
|
1833
|
+
return { range: range, target: target, data: data };
|
|
1834
|
+
}
|
|
1835
|
+
DocumentLink.create = create;
|
|
1836
|
+
/**
|
|
1837
|
+
* Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.
|
|
1838
|
+
*/
|
|
1839
|
+
function is(value) {
|
|
1840
|
+
var candidate = value;
|
|
1841
|
+
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
|
1842
|
+
}
|
|
1843
|
+
DocumentLink.is = is;
|
|
1844
|
+
})(DocumentLink = exports.DocumentLink || (exports.DocumentLink = {}));
|
|
1845
|
+
/**
|
|
1846
|
+
* The SelectionRange namespace provides helper function to work with
|
|
1847
|
+
* SelectionRange literals.
|
|
1848
|
+
*/
|
|
1849
|
+
var SelectionRange;
|
|
1850
|
+
(function (SelectionRange) {
|
|
1851
|
+
/**
|
|
1852
|
+
* Creates a new SelectionRange
|
|
1853
|
+
* @param range the range.
|
|
1854
|
+
* @param parent an optional parent.
|
|
1855
|
+
*/
|
|
1856
|
+
function create(range, parent) {
|
|
1857
|
+
return { range: range, parent: parent };
|
|
1858
|
+
}
|
|
1859
|
+
SelectionRange.create = create;
|
|
1860
|
+
function is(value) {
|
|
1861
|
+
var candidate = value;
|
|
1862
|
+
return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
|
|
1863
|
+
}
|
|
1864
|
+
SelectionRange.is = is;
|
|
1865
|
+
})(SelectionRange = exports.SelectionRange || (exports.SelectionRange = {}));
|
|
1866
|
+
exports.EOL = ['\n', '\r\n', '\r'];
|
|
1867
|
+
/**
|
|
1868
|
+
* @deprecated Use the text document from the new vscode-languageserver-textdocument package.
|
|
1869
|
+
*/
|
|
1870
|
+
var TextDocument;
|
|
1871
|
+
(function (TextDocument) {
|
|
1872
|
+
/**
|
|
1873
|
+
* Creates a new ITextDocument literal from the given uri and content.
|
|
1874
|
+
* @param uri The document's uri.
|
|
1875
|
+
* @param languageId The document's language Id.
|
|
1876
|
+
* @param content The document's content.
|
|
1877
|
+
*/
|
|
1878
|
+
function create(uri, languageId, version, content) {
|
|
1879
|
+
return new FullTextDocument(uri, languageId, version, content);
|
|
1880
|
+
}
|
|
1881
|
+
TextDocument.create = create;
|
|
1882
|
+
/**
|
|
1883
|
+
* Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.
|
|
1884
|
+
*/
|
|
1885
|
+
function is(value) {
|
|
1886
|
+
var candidate = value;
|
|
1887
|
+
return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
|
|
1888
|
+
&& Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
|
|
1889
|
+
}
|
|
1890
|
+
TextDocument.is = is;
|
|
1891
|
+
function applyEdits(document, edits) {
|
|
1892
|
+
var text = document.getText();
|
|
1893
|
+
var sortedEdits = mergeSort(edits, function (a, b) {
|
|
1894
|
+
var diff = a.range.start.line - b.range.start.line;
|
|
1895
|
+
if (diff === 0) {
|
|
1896
|
+
return a.range.start.character - b.range.start.character;
|
|
1897
|
+
}
|
|
1898
|
+
return diff;
|
|
1899
|
+
});
|
|
1900
|
+
var lastModifiedOffset = text.length;
|
|
1901
|
+
for (var i = sortedEdits.length - 1; i >= 0; i--) {
|
|
1902
|
+
var e = sortedEdits[i];
|
|
1903
|
+
var startOffset = document.offsetAt(e.range.start);
|
|
1904
|
+
var endOffset = document.offsetAt(e.range.end);
|
|
1905
|
+
if (endOffset <= lastModifiedOffset) {
|
|
1906
|
+
text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
|
1907
|
+
}
|
|
1908
|
+
else {
|
|
1909
|
+
throw new Error('Overlapping edit');
|
|
1910
|
+
}
|
|
1911
|
+
lastModifiedOffset = startOffset;
|
|
1912
|
+
}
|
|
1913
|
+
return text;
|
|
1914
|
+
}
|
|
1915
|
+
TextDocument.applyEdits = applyEdits;
|
|
1916
|
+
function mergeSort(data, compare) {
|
|
1917
|
+
if (data.length <= 1) {
|
|
1918
|
+
// sorted
|
|
1919
|
+
return data;
|
|
1920
|
+
}
|
|
1921
|
+
var p = (data.length / 2) | 0;
|
|
1922
|
+
var left = data.slice(0, p);
|
|
1923
|
+
var right = data.slice(p);
|
|
1924
|
+
mergeSort(left, compare);
|
|
1925
|
+
mergeSort(right, compare);
|
|
1926
|
+
var leftIdx = 0;
|
|
1927
|
+
var rightIdx = 0;
|
|
1928
|
+
var i = 0;
|
|
1929
|
+
while (leftIdx < left.length && rightIdx < right.length) {
|
|
1930
|
+
var ret = compare(left[leftIdx], right[rightIdx]);
|
|
1931
|
+
if (ret <= 0) {
|
|
1932
|
+
// smaller_equal -> take left to preserve order
|
|
1933
|
+
data[i++] = left[leftIdx++];
|
|
1934
|
+
}
|
|
1935
|
+
else {
|
|
1936
|
+
// greater -> take right
|
|
1937
|
+
data[i++] = right[rightIdx++];
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
while (leftIdx < left.length) {
|
|
1941
|
+
data[i++] = left[leftIdx++];
|
|
1942
|
+
}
|
|
1943
|
+
while (rightIdx < right.length) {
|
|
1944
|
+
data[i++] = right[rightIdx++];
|
|
1945
|
+
}
|
|
1946
|
+
return data;
|
|
1947
|
+
}
|
|
1948
|
+
})(TextDocument = exports.TextDocument || (exports.TextDocument = {}));
|
|
1949
|
+
/**
|
|
1950
|
+
* @deprecated Use the text document from the new vscode-languageserver-textdocument package.
|
|
1951
|
+
*/
|
|
1952
|
+
var FullTextDocument = /** @class */ (function () {
|
|
1953
|
+
function FullTextDocument(uri, languageId, version, content) {
|
|
1954
|
+
this._uri = uri;
|
|
1955
|
+
this._languageId = languageId;
|
|
1956
|
+
this._version = version;
|
|
1957
|
+
this._content = content;
|
|
1958
|
+
this._lineOffsets = undefined;
|
|
1959
|
+
}
|
|
1960
|
+
Object.defineProperty(FullTextDocument.prototype, "uri", {
|
|
1961
|
+
get: function () {
|
|
1962
|
+
return this._uri;
|
|
1963
|
+
},
|
|
1964
|
+
enumerable: false,
|
|
1965
|
+
configurable: true
|
|
1966
|
+
});
|
|
1967
|
+
Object.defineProperty(FullTextDocument.prototype, "languageId", {
|
|
1968
|
+
get: function () {
|
|
1969
|
+
return this._languageId;
|
|
1970
|
+
},
|
|
1971
|
+
enumerable: false,
|
|
1972
|
+
configurable: true
|
|
1973
|
+
});
|
|
1974
|
+
Object.defineProperty(FullTextDocument.prototype, "version", {
|
|
1975
|
+
get: function () {
|
|
1976
|
+
return this._version;
|
|
1977
|
+
},
|
|
1978
|
+
enumerable: false,
|
|
1979
|
+
configurable: true
|
|
1980
|
+
});
|
|
1981
|
+
FullTextDocument.prototype.getText = function (range) {
|
|
1982
|
+
if (range) {
|
|
1983
|
+
var start = this.offsetAt(range.start);
|
|
1984
|
+
var end = this.offsetAt(range.end);
|
|
1985
|
+
return this._content.substring(start, end);
|
|
1986
|
+
}
|
|
1987
|
+
return this._content;
|
|
1988
|
+
};
|
|
1989
|
+
FullTextDocument.prototype.update = function (event, version) {
|
|
1990
|
+
this._content = event.text;
|
|
1991
|
+
this._version = version;
|
|
1992
|
+
this._lineOffsets = undefined;
|
|
1993
|
+
};
|
|
1994
|
+
FullTextDocument.prototype.getLineOffsets = function () {
|
|
1995
|
+
if (this._lineOffsets === undefined) {
|
|
1996
|
+
var lineOffsets = [];
|
|
1997
|
+
var text = this._content;
|
|
1998
|
+
var isLineStart = true;
|
|
1999
|
+
for (var i = 0; i < text.length; i++) {
|
|
2000
|
+
if (isLineStart) {
|
|
2001
|
+
lineOffsets.push(i);
|
|
2002
|
+
isLineStart = false;
|
|
2003
|
+
}
|
|
2004
|
+
var ch = text.charAt(i);
|
|
2005
|
+
isLineStart = (ch === '\r' || ch === '\n');
|
|
2006
|
+
if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
|
|
2007
|
+
i++;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
if (isLineStart && text.length > 0) {
|
|
2011
|
+
lineOffsets.push(text.length);
|
|
2012
|
+
}
|
|
2013
|
+
this._lineOffsets = lineOffsets;
|
|
2014
|
+
}
|
|
2015
|
+
return this._lineOffsets;
|
|
2016
|
+
};
|
|
2017
|
+
FullTextDocument.prototype.positionAt = function (offset) {
|
|
2018
|
+
offset = Math.max(Math.min(offset, this._content.length), 0);
|
|
2019
|
+
var lineOffsets = this.getLineOffsets();
|
|
2020
|
+
var low = 0, high = lineOffsets.length;
|
|
2021
|
+
if (high === 0) {
|
|
2022
|
+
return Position.create(0, offset);
|
|
2023
|
+
}
|
|
2024
|
+
while (low < high) {
|
|
2025
|
+
var mid = Math.floor((low + high) / 2);
|
|
2026
|
+
if (lineOffsets[mid] > offset) {
|
|
2027
|
+
high = mid;
|
|
2028
|
+
}
|
|
2029
|
+
else {
|
|
2030
|
+
low = mid + 1;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
// low is the least x for which the line offset is larger than the current offset
|
|
2034
|
+
// or array.length if no line offset is larger than the current offset
|
|
2035
|
+
var line = low - 1;
|
|
2036
|
+
return Position.create(line, offset - lineOffsets[line]);
|
|
2037
|
+
};
|
|
2038
|
+
FullTextDocument.prototype.offsetAt = function (position) {
|
|
2039
|
+
var lineOffsets = this.getLineOffsets();
|
|
2040
|
+
if (position.line >= lineOffsets.length) {
|
|
2041
|
+
return this._content.length;
|
|
2042
|
+
}
|
|
2043
|
+
else if (position.line < 0) {
|
|
2044
|
+
return 0;
|
|
2045
|
+
}
|
|
2046
|
+
var lineOffset = lineOffsets[position.line];
|
|
2047
|
+
var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
|
|
2048
|
+
return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
|
2049
|
+
};
|
|
2050
|
+
Object.defineProperty(FullTextDocument.prototype, "lineCount", {
|
|
2051
|
+
get: function () {
|
|
2052
|
+
return this.getLineOffsets().length;
|
|
2053
|
+
},
|
|
2054
|
+
enumerable: false,
|
|
2055
|
+
configurable: true
|
|
2056
|
+
});
|
|
2057
|
+
return FullTextDocument;
|
|
2058
|
+
}());
|
|
2059
|
+
var Is;
|
|
2060
|
+
(function (Is) {
|
|
2061
|
+
var toString = Object.prototype.toString;
|
|
2062
|
+
function defined(value) {
|
|
2063
|
+
return typeof value !== 'undefined';
|
|
2064
|
+
}
|
|
2065
|
+
Is.defined = defined;
|
|
2066
|
+
function undefined(value) {
|
|
2067
|
+
return typeof value === 'undefined';
|
|
2068
|
+
}
|
|
2069
|
+
Is.undefined = undefined;
|
|
2070
|
+
function boolean(value) {
|
|
2071
|
+
return value === true || value === false;
|
|
2072
|
+
}
|
|
2073
|
+
Is.boolean = boolean;
|
|
2074
|
+
function string(value) {
|
|
2075
|
+
return toString.call(value) === '[object String]';
|
|
2076
|
+
}
|
|
2077
|
+
Is.string = string;
|
|
2078
|
+
function number(value) {
|
|
2079
|
+
return toString.call(value) === '[object Number]';
|
|
2080
|
+
}
|
|
2081
|
+
Is.number = number;
|
|
2082
|
+
function numberRange(value, min, max) {
|
|
2083
|
+
return toString.call(value) === '[object Number]' && min <= value && value <= max;
|
|
2084
|
+
}
|
|
2085
|
+
Is.numberRange = numberRange;
|
|
2086
|
+
function integer(value) {
|
|
2087
|
+
return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;
|
|
2088
|
+
}
|
|
2089
|
+
Is.integer = integer;
|
|
2090
|
+
function uinteger(value) {
|
|
2091
|
+
return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;
|
|
2092
|
+
}
|
|
2093
|
+
Is.uinteger = uinteger;
|
|
2094
|
+
function func(value) {
|
|
2095
|
+
return toString.call(value) === '[object Function]';
|
|
2096
|
+
}
|
|
2097
|
+
Is.func = func;
|
|
2098
|
+
function objectLiteral(value) {
|
|
2099
|
+
// Strictly speaking class instances pass this check as well. Since the LSP
|
|
2100
|
+
// doesn't use classes we ignore this for now. If we do we need to add something
|
|
2101
|
+
// like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
|
|
2102
|
+
return value !== null && typeof value === 'object';
|
|
2103
|
+
}
|
|
2104
|
+
Is.objectLiteral = objectLiteral;
|
|
2105
|
+
function typedArray(value, check) {
|
|
2106
|
+
return Array.isArray(value) && value.every(check);
|
|
2107
|
+
}
|
|
2108
|
+
Is.typedArray = typedArray;
|
|
2109
|
+
})(Is || (Is = {}));
|
|
2110
|
+
});
|
|
2111
|
+
//# sourceMappingURL=main.js.map;
|
|
1730
2112
|
define('vscode-languageserver-types', ['vscode-languageserver-types/main'], function (main) { return main; });
|
|
1731
2113
|
|
|
1732
2114
|
/**
|
|
@@ -1891,20 +2273,20 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
1891
2273
|
this._configurationListener = Object.create(null);
|
|
1892
2274
|
this._schemaListener = Object.create(null);
|
|
1893
2275
|
var onModelAdd = function (model) {
|
|
1894
|
-
var
|
|
1895
|
-
if (
|
|
2276
|
+
var languageId = model.getLanguageId();
|
|
2277
|
+
if (languageId !== _this._languageId) {
|
|
1896
2278
|
return;
|
|
1897
2279
|
}
|
|
1898
|
-
var debouncedValidation = _.debounce(function (intervals) { return _this._doValidate(model,
|
|
2280
|
+
var debouncedValidation = _.debounce(function (intervals) { return _this._doValidate(model, languageId, intervals); }, 500);
|
|
1899
2281
|
_this._contentListener[model.uri.toString()] = model.onDidChangeContent(function (e) {
|
|
1900
2282
|
var intervalsToValidate = changeEventToIntervals(e);
|
|
1901
2283
|
debouncedValidation(intervalsToValidate);
|
|
1902
2284
|
});
|
|
1903
2285
|
_this._configurationListener[model.uri.toString()] = _this.defaults.onDidChange(function () {
|
|
1904
|
-
self.setTimeout(function () { return _this._doValidate(model,
|
|
2286
|
+
self.setTimeout(function () { return _this._doValidate(model, languageId, []); }, 0);
|
|
1905
2287
|
});
|
|
1906
2288
|
_this._schemaListener[model.uri.toString()] = onSchemaChange(function () {
|
|
1907
|
-
self.setTimeout(function () { return _this._doValidate(model,
|
|
2289
|
+
self.setTimeout(function () { return _this._doValidate(model, languageId, []); }, 0);
|
|
1908
2290
|
});
|
|
1909
2291
|
};
|
|
1910
2292
|
var onModelRemoved = function (model) {
|
|
@@ -1964,20 +2346,21 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
1964
2346
|
}
|
|
1965
2347
|
var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); });
|
|
1966
2348
|
var model = _this._monacoInstance.editor.getModel(resource);
|
|
1967
|
-
var oldDecorations = model
|
|
1968
|
-
.
|
|
2349
|
+
var oldDecorations = model
|
|
2350
|
+
.getAllDecorations()
|
|
2351
|
+
.filter(function (decoration) { return decoration.options.className == 'squiggly-error'; })
|
|
1969
2352
|
.map(function (decoration) { return decoration.id; });
|
|
1970
|
-
if (model && model.
|
|
2353
|
+
if (model && model.getLanguageId() === languageId) {
|
|
1971
2354
|
var syntaxErrorAsMarkDown = _this.defaults.languageSettings.syntaxErrorAsMarkDown;
|
|
1972
2355
|
if (!syntaxErrorAsMarkDown || !syntaxErrorAsMarkDown.enableSyntaxErrorAsMarkDown) {
|
|
1973
|
-
// Remove previous syntax error decorations and set the new markers (for example, when disabling syntaxErrorAsMarkDown after it was enabled)
|
|
2356
|
+
// Remove previous syntax error decorations and set the new markers (for example, when disabling syntaxErrorAsMarkDown after it was enabled)
|
|
1974
2357
|
model.deltaDecorations(oldDecorations, []);
|
|
1975
2358
|
_this._monacoInstance.editor.setModelMarkers(model, languageId, markers);
|
|
1976
2359
|
}
|
|
1977
2360
|
else {
|
|
1978
2361
|
// Add custom popup for syntax error: icon, header and message as markdown
|
|
1979
|
-
var header = syntaxErrorAsMarkDown.header ? "**" + syntaxErrorAsMarkDown.header + "** \n\n" :
|
|
1980
|
-
var icon = syntaxErrorAsMarkDown.icon ? "" :
|
|
2362
|
+
var header = syntaxErrorAsMarkDown.header ? "**" + syntaxErrorAsMarkDown.header + "** \n\n" : '';
|
|
2363
|
+
var icon = syntaxErrorAsMarkDown.icon ? "" : '';
|
|
1981
2364
|
var popupErrorHoverHeaderMessage_1 = icon + " " + header;
|
|
1982
2365
|
var newDecorations = markers.map(function (marker) {
|
|
1983
2366
|
return {
|
|
@@ -1985,30 +2368,31 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
1985
2368
|
startLineNumber: marker.startLineNumber,
|
|
1986
2369
|
startColumn: marker.startColumn,
|
|
1987
2370
|
endLineNumber: marker.endLineNumber,
|
|
1988
|
-
endColumn: marker.endColumn
|
|
2371
|
+
endColumn: marker.endColumn,
|
|
1989
2372
|
},
|
|
1990
2373
|
options: {
|
|
1991
2374
|
hoverMessage: {
|
|
1992
|
-
value: popupErrorHoverHeaderMessage_1 + marker.message
|
|
2375
|
+
value: popupErrorHoverHeaderMessage_1 + marker.message,
|
|
1993
2376
|
},
|
|
1994
|
-
className:
|
|
2377
|
+
className: 'squiggly-error',
|
|
1995
2378
|
zIndex: 100,
|
|
1996
2379
|
overviewRuler: {
|
|
1997
2380
|
// The color indication on the right ruler
|
|
1998
|
-
color:
|
|
1999
|
-
position: monaco.editor.OverviewRulerLane.Right
|
|
2381
|
+
color: 'rgb(255, 18, 18, 0.7)',
|
|
2382
|
+
position: monaco.editor.OverviewRulerLane.Right,
|
|
2000
2383
|
},
|
|
2001
2384
|
minimap: {
|
|
2002
|
-
color:
|
|
2003
|
-
position: monaco.editor.MinimapPosition.Inline
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2385
|
+
color: 'rgb(255, 18, 18, 0.7)',
|
|
2386
|
+
position: monaco.editor.MinimapPosition.Inline,
|
|
2387
|
+
},
|
|
2388
|
+
},
|
|
2006
2389
|
};
|
|
2007
2390
|
});
|
|
2008
|
-
var oldMarkers = monaco.editor
|
|
2391
|
+
var oldMarkers = monaco.editor
|
|
2392
|
+
.getModelMarkers({
|
|
2009
2393
|
owner: languageId,
|
|
2010
|
-
resource: resource
|
|
2011
|
-
})
|
|
2394
|
+
resource: resource,
|
|
2395
|
+
});
|
|
2012
2396
|
if (oldMarkers && oldMarkers.length > 0) {
|
|
2013
2397
|
// In case there were previous markers, remove their decorations (for example, when enabling syntaxErrorAsMarkDown after it was disabled)
|
|
2014
2398
|
oldDecorations = [];
|
|
@@ -2155,11 +2539,11 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2155
2539
|
this.decorations = [];
|
|
2156
2540
|
injectCss();
|
|
2157
2541
|
var onModelAdd = function (model) {
|
|
2158
|
-
var
|
|
2159
|
-
if (
|
|
2542
|
+
var languageId = model.getLanguageId();
|
|
2543
|
+
if (languageId !== _this._languageId) {
|
|
2160
2544
|
return;
|
|
2161
2545
|
}
|
|
2162
|
-
var debouncedColorization = _.debounce(function (intervals) { return _this._doColorization(model,
|
|
2546
|
+
var debouncedColorization = _.debounce(function (intervals) { return _this._doColorization(model, languageId, intervals); }, 500);
|
|
2163
2547
|
var handle;
|
|
2164
2548
|
_this._contentListener[model.uri.toString()] = model.onDidChangeContent(function (e) {
|
|
2165
2549
|
// Changes are represented as a range in doc before change, plus the text that it was replaced with.
|
|
@@ -2169,10 +2553,10 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2169
2553
|
debouncedColorization(intervalsToColorize);
|
|
2170
2554
|
});
|
|
2171
2555
|
_this._configurationListener[model.uri.toString()] = defaults.onDidChange(function () {
|
|
2172
|
-
self.setTimeout(function () { return _this._doColorization(model,
|
|
2556
|
+
self.setTimeout(function () { return _this._doColorization(model, languageId, []); }, 0);
|
|
2173
2557
|
});
|
|
2174
2558
|
_this._schemaListener[model.uri.toString()] = onSchemaChange(function () {
|
|
2175
|
-
self.setTimeout(function () { return _this._doColorization(model,
|
|
2559
|
+
self.setTimeout(function () { return _this._doColorization(model, languageId, []); }, 0);
|
|
2176
2560
|
});
|
|
2177
2561
|
};
|
|
2178
2562
|
var onModelRemoved = function (model) {
|
|
@@ -2270,7 +2654,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2270
2654
|
.reduce(function (prev, curr) { return prev.concat(curr); }, []);
|
|
2271
2655
|
// Flatten decoration groups to an array of decorations
|
|
2272
2656
|
var newDecorations = decorationRanges.reduce(function (prev, next) { return prev.concat(next.decorations); }, []);
|
|
2273
|
-
if (model && model.
|
|
2657
|
+
if (model && model.getLanguageId() === languageId) {
|
|
2274
2658
|
_this.decorations = model.deltaDecorations(oldDecorations, newDecorations);
|
|
2275
2659
|
}
|
|
2276
2660
|
})
|
|
@@ -2428,8 +2812,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2428
2812
|
var wordInfo = model.getWordUntilPosition(position);
|
|
2429
2813
|
var wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
2430
2814
|
var resource = model.uri;
|
|
2431
|
-
var onDidProvideCompletionItems = this.languageSettings
|
|
2432
|
-
.onDidProvideCompletionItems;
|
|
2815
|
+
var onDidProvideCompletionItems = this.languageSettings.onDidProvideCompletionItems;
|
|
2433
2816
|
return this._worker(resource)
|
|
2434
2817
|
.then(function (worker) {
|
|
2435
2818
|
return worker.doComplete(resource.toString(), fromPosition(position));
|