@codingame/monaco-languageclient-wrapper 1.6.0 → 1.7.2

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.
@@ -289,410 +289,15 @@ var proxy = function proxyPolyfill() {
289
289
  : self
290
290
  );
291
291
 
292
- const asLanguageClientOptionsById = options => options;
292
+ var lib$1 = {};
293
293
 
294
- const staticOptions = asLanguageClientOptionsById({
295
- angular: {
296
- documentSelector: [{
297
- scheme: 'file',
298
- pattern: '**/*.ts'
299
- }],
300
- mutualizable: true,
301
- vscodeExtensionIds: ['typescript-language-features', 'angular']
302
- },
303
- bash: {
304
- documentSelector: [{
305
- scheme: 'file',
306
- pattern: '**/*.bash'
307
- }],
308
- mutualizable: true
309
- },
310
- c: {
311
- documentSelector: [{
312
- scheme: 'file',
313
- language: 'c'
314
- }, {
315
- scheme: 'file',
316
- language: 'cpp'
317
- }],
318
- mutualizable: false // The extension is cpptools BUT the language server is unable to use the configuration
319
- // vscodeExtensionIds: ['cpptools']
294
+ var disposable$2 = {};
320
295
 
321
- },
322
- csharp: {
323
- documentSelector: [{
324
- language: 'csharp'
325
- }],
326
- mutualizable: true,
327
- vscodeExtensionIds: ['omnisharp']
328
- },
329
- cpp: {
330
- documentSelector: [{
331
- scheme: 'file',
332
- language: 'c'
333
- }, {
334
- scheme: 'file',
335
- language: 'cpp'
336
- }, {
337
- scheme: 'file',
338
- language: 'cuda-cpp'
339
- }],
340
- mutualizable: false // The extension is cpptools BUT the language server is unable to use the configuration
341
- // vscodeExtensionIds: ['cpptools']
296
+ var services$1 = {};
342
297
 
343
- },
344
- clojure: {
345
- documentSelector: [{
346
- scheme: 'file',
347
- pattern: '**/*.clj',
348
- language: 'clojure'
349
- }],
350
- mutualizable: true
351
- },
352
- cobol: {
353
- documentSelector: ['COBOL'],
354
- synchronize: {
355
- configurationSection: 'cobol-lsp'
356
- },
357
- mutualizable: false,
358
- vscodeExtensionIds: ['cobol']
359
- },
360
- dart: {
361
- documentSelector: [{
362
- scheme: 'file',
363
- pattern: '**/*.dart',
364
- language: 'dart'
365
- }],
366
- mutualizable: true,
367
- vscodeExtensionIds: ['dart']
368
- },
369
- go: {
370
- documentSelector: [{
371
- language: 'go',
372
- scheme: 'file'
373
- }, {
374
- language: 'go.mod',
375
- scheme: 'file'
376
- }, {
377
- language: 'go.sum',
378
- scheme: 'file'
379
- }, {
380
- language: 'go.work',
381
- scheme: 'file'
382
- }, {
383
- language: 'tmpl',
384
- scheme: 'file'
385
- }],
386
- mutualizable: true
387
- },
388
- groovy: {
389
- documentSelector: [{
390
- scheme: 'file',
391
- language: 'groovy'
392
- }],
393
- synchronize: {
394
- configurationSection: 'groovy'
395
- },
396
- mutualizable: true,
397
- vscodeExtensionIds: ['vscode-groovy']
398
- },
399
- java: {
400
- documentSelector: [{
401
- scheme: 'file',
402
- language: 'java'
403
- }, {
404
- scheme: 'jdt',
405
- language: 'java'
406
- }, {
407
- scheme: 'untitled',
408
- language: 'java'
409
- }],
410
- synchronize: {
411
- configurationSection: ['java', 'editor.insertSpaces', 'editor.tabSize']
412
- },
413
- mutualizable: true,
414
- vscodeExtensionIds: ['java']
415
- },
416
- javascript: {
417
- documentSelector: [{
418
- pattern: '**/*.{js}',
419
- language: 'javascript'
420
- }, {
421
- pattern: '**/**.{js,jsx}',
422
- language: 'javascript'
423
- }],
424
- mutualizable: true,
425
- vscodeExtensionIds: ['typescript-language-features']
426
- },
427
- kotlin: {
428
- // https://github.com/fwcd/vscode-kotlin/blob/db5916080868a6a8e064c60d49624926c2fa61bd/src/languageSetup.ts#L104
429
- documentSelector: [{
430
- language: 'kotlin',
431
- scheme: 'file'
432
- }, {
433
- language: 'kotlin',
434
- scheme: 'kls'
435
- }],
436
- synchronize: {
437
- configurationSection: 'kotlin'
438
- },
439
- mutualizable: false
440
- },
441
- lua: {
442
- documentSelector: [{
443
- scheme: 'file',
444
- language: 'lua'
445
- }],
446
- synchronize: {
447
- configurationSection: 'Lua'
448
- },
449
- mutualizable: true,
450
- vscodeExtensionIds: ['lua']
451
- },
452
- mysql: {
453
- documentSelector: [{
454
- language: 'sql'
455
- }],
456
- // Disable code actions
457
- middleware: {
458
- provideCodeActions() {
459
- return [];
460
- }
298
+ var main$3 = {};
461
299
 
462
- },
463
- mutualizable: false
464
- },
465
- ocaml: {
466
- documentSelector: [{
467
- scheme: 'file',
468
- language: 'ocaml'
469
- }],
470
- mutualizable: false
471
- },
472
- 'php-serenata': {
473
- // https://gitlab.com/Serenata/visual-studio-code-client/-/blob/master/src/extension.ts#L120
474
- documentSelector: [{
475
- pattern: '**/*.php',
476
- scheme: 'file'
477
- }],
478
- synchronize: {
479
- configurationSection: 'serenata'
480
- },
481
- initializationOptions: {
482
- configuration: {
483
- uris: ['file:///tmp/project'],
484
- phpVersion: 7.3,
485
- fileExtensions: ['php'],
486
- indexDatabaseUri: 'file:///tmp/index.sqlite',
487
- excludedPathExpressions: ['file:///opt/serenata']
488
- }
489
- },
490
- mutualizable: true
491
- },
492
- php: {
493
- documentSelector: [{
494
- pattern: '**/*.php',
495
- language: 'php'
496
- }],
497
- mutualizable: true
498
- },
499
- postgresql: {
500
- documentSelector: [{
501
- language: 'postgresql'
502
- }],
503
- // Disable code actions
504
- middleware: {
505
- provideCodeActions() {
506
- return [];
507
- }
508
-
509
- },
510
- mutualizable: false
511
- },
512
- python: {
513
- documentSelector: [{
514
- language: 'python'
515
- }],
516
- synchronize: {
517
- configurationSection: 'python'
518
- },
519
- mutualizable: true,
520
- vscodeExtensionIds: ['vscode-python']
521
- },
522
- r: {
523
- // https://github.com/REditorSupport/vscode-R/blob/96ed4740101d8cd82f908b415df1dd205b4be824/src/languageService.ts#L186
524
- documentSelector: [{
525
- scheme: 'file',
526
- language: 'r'
527
- }, {
528
- scheme: 'file',
529
- language: 'rmd'
530
- }],
531
- synchronize: {
532
- configurationSection: 'r.lsp'
533
- },
534
- mutualizable: true,
535
- vscodeExtensionIds: ['vscode-R']
536
- },
537
- react: {
538
- documentSelector: [{
539
- pattern: '**/*.{tsx,jsx}'
540
- }],
541
- synchronize: {},
542
- mutualizable: true,
543
- vscodeExtensionIds: ['typescript-language-features']
544
- },
545
- ruby: {
546
- // https://github.com/castwide/vscode-solargraph/blob/3ebd9241f013305a84ec64334fca45b487bde904/src/language-client.ts#L56
547
- documentSelector: [{
548
- scheme: 'file',
549
- language: 'ruby'
550
- }],
551
- mutualizable: true,
552
- vscodeExtensionIds: ['solargraph'],
553
- synchronize: {
554
- configurationSection: 'solargraph'
555
- }
556
- },
557
- rust: {
558
- // https://github.com/rust-lang/vscode-rust/blob/b1ae67b06640ffab6e1ebb72e07364b4477dfbf1/rust-analyzer/editors/code/src/client.ts#L42
559
- documentSelector: [{
560
- scheme: 'file',
561
- language: 'rust'
562
- }],
563
- mutualizable: false
564
- },
565
- scala: {
566
- documentSelector: [{
567
- scheme: 'file',
568
- language: 'scala'
569
- }],
570
- synchronize: {
571
- configurationSection: 'metals'
572
- },
573
- mutualizable: false,
574
- vscodeExtensionIds: ['scalameta']
575
- },
576
- sql: {
577
- documentSelector: [{
578
- language: 'sql'
579
- }],
580
- // Disable code actions
581
- middleware: {
582
- provideCodeActions() {
583
- return [];
584
- }
585
-
586
- },
587
- mutualizable: false
588
- },
589
- swift: {
590
- // https://github.com/apple/sourcekit-lsp/blob/59b5e68f7f8408b5bc44bd47f71ef1afdc63e7a6/Editors/vscode/src/extension.ts#L22
591
- documentSelector: ['swift', 'cpp', 'c', 'objective-c', 'objective-cpp'],
592
- synchronize: {},
593
- mutualizable: true
594
- },
595
- typescript: {
596
- documentSelector: [{
597
- pattern: '**/*.{ts}',
598
- language: 'typescript'
599
- }],
600
- synchronize: {},
601
- mutualizable: true,
602
- vscodeExtensionIds: ['typescript-language-features']
603
- },
604
- vue: {
605
- documentSelector: [{
606
- pattern: '**/*.js',
607
- language: 'javascript'
608
- }],
609
- synchronize: {},
610
- mutualizable: true,
611
- vscodeExtensionIds: ['typescript-language-features']
612
- }
613
- });
614
-
615
- /**
616
- * Load the configuration schemas from vscode extensions
617
- * @param forLanguageClientIds Load the extensions related to these language client ids
618
- * @param useMutualizedProxy The language server proxy is used, so we only need to load configurations for language servers which are not mutualized
619
- */
620
-
621
- async function loadExtensionConfigurations(forLanguageClientIds, useMutualizedProxy) {
622
- const extensionConfigurationToLoad = new Set();
623
-
624
- for (const languageClientId of forLanguageClientIds) {
625
- const config = staticOptions[languageClientId];
626
-
627
- if (!config.mutualizable || !useMutualizedProxy) {
628
- var _config$vscodeExtensi;
629
-
630
- (_config$vscodeExtensi = config.vscodeExtensionIds) === null || _config$vscodeExtensi === void 0 ? void 0 : _config$vscodeExtensi.forEach(extensionId => {
631
- extensionConfigurationToLoad.add(extensionId);
632
- });
633
- }
634
- }
635
-
636
- await Promise.all(Array.from(extensionConfigurationToLoad).map(extensionId => loadConfigurationForExtension(extensionId)));
637
- }
638
-
639
- monaco.editor.onWillDisposeModel(model => {
640
- // We need to do it in a timeout or else the marker change event is delayed
641
- setTimeout(() => {
642
- monaco.editor.setModelMarkers(model, 'default', []);
643
- });
644
- });
645
-
646
- function ownKeys(object, enumerableOnly) {
647
- var keys = Object.keys(object);
648
-
649
- if (Object.getOwnPropertySymbols) {
650
- var symbols = Object.getOwnPropertySymbols(object);
651
- enumerableOnly && (symbols = symbols.filter(function (sym) {
652
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
653
- })), keys.push.apply(keys, symbols);
654
- }
655
-
656
- return keys;
657
- }
658
-
659
- function _objectSpread2(target) {
660
- for (var i = 1; i < arguments.length; i++) {
661
- var source = null != arguments[i] ? arguments[i] : {};
662
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
663
- _defineProperty(target, key, source[key]);
664
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
665
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
666
- });
667
- }
668
-
669
- return target;
670
- }
671
-
672
- function _defineProperty(obj, key, value) {
673
- if (key in obj) {
674
- Object.defineProperty(obj, key, {
675
- value: value,
676
- enumerable: true,
677
- configurable: true,
678
- writable: true
679
- });
680
- } else {
681
- obj[key] = value;
682
- }
683
-
684
- return obj;
685
- }
686
-
687
- var lib$1 = {};
688
-
689
- var disposable$2 = {};
690
-
691
- var services$1 = {};
692
-
693
- var main$3 = {};
694
-
695
- var main$2 = {};
300
+ var main$2 = {};
696
301
 
697
302
  var ril = {};
698
303
 
@@ -20055,80 +19660,490 @@ class ProtocolToMonacoConverter {
20055
19660
  }
20056
19661
  return undefined;
20057
19662
  }
20058
- asSemanticTokens(semanticTokens) {
20059
- return {
20060
- resultId: semanticTokens.resultId,
20061
- data: Uint32Array.from(semanticTokens.data)
20062
- };
19663
+ asSemanticTokens(semanticTokens) {
19664
+ return {
19665
+ resultId: semanticTokens.resultId,
19666
+ data: Uint32Array.from(semanticTokens.data)
19667
+ };
19668
+ }
19669
+ }
19670
+ exports.ProtocolToMonacoConverter = ProtocolToMonacoConverter;
19671
+
19672
+ }(monacoConverter));
19673
+
19674
+ (function (exports) {
19675
+ Object.defineProperty(exports, "__esModule", { value: true });
19676
+ exports.MonacoServices = void 0;
19677
+ const monaco_converter_1 = monacoConverter;
19678
+ const monaco_commands_1 = monacoCommands;
19679
+ const monaco_languages_1 = monacoLanguages;
19680
+ const monaco_workspace_1 = monacoWorkspace;
19681
+ const console_window_1 = consoleWindow;
19682
+ const services_1 = services$1;
19683
+ (function (MonacoServices) {
19684
+ function create(_monaco, options = {}) {
19685
+ const m2p = new monaco_converter_1.MonacoToProtocolConverter(_monaco);
19686
+ const p2m = new monaco_converter_1.ProtocolToMonacoConverter(_monaco);
19687
+ return {
19688
+ commands: new monaco_commands_1.MonacoCommands(_monaco),
19689
+ languages: new monaco_languages_1.MonacoLanguages(_monaco, p2m, m2p),
19690
+ workspace: new monaco_workspace_1.MonacoWorkspace(_monaco, p2m, m2p, options.rootUri),
19691
+ window: new console_window_1.ConsoleWindow()
19692
+ };
19693
+ }
19694
+ MonacoServices.create = create;
19695
+ function install(_monaco, options = {}) {
19696
+ const services = create(_monaco, options);
19697
+ services_1.Services.install(services);
19698
+ return services;
19699
+ }
19700
+ MonacoServices.install = install;
19701
+ function get() {
19702
+ return services_1.Services.get();
19703
+ }
19704
+ MonacoServices.get = get;
19705
+ })(exports.MonacoServices || (exports.MonacoServices = {}));
19706
+
19707
+ }(monacoServices));
19708
+
19709
+ (function (exports) {
19710
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19711
+ if (k2 === undefined) k2 = k;
19712
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19713
+ }) : (function(o, m, k, k2) {
19714
+ if (k2 === undefined) k2 = k;
19715
+ o[k2] = m[k];
19716
+ }));
19717
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
19718
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19719
+ };
19720
+ Object.defineProperty(exports, "__esModule", { value: true });
19721
+ /* --------------------------------------------------------------------------------------------
19722
+ * Copyright (c) 2018 TypeFox GmbH (http://www.typefox.io). All rights reserved.
19723
+ * Licensed under the MIT License. See License.txt in the project root for license information.
19724
+ * ------------------------------------------------------------------------------------------ */
19725
+ __exportStar(disposable$2, exports);
19726
+ __exportStar(services$1, exports);
19727
+ __exportStar(connection$2, exports);
19728
+ __exportStar(monacoLanguageClient, exports);
19729
+ __exportStar(monacoCommands, exports);
19730
+ __exportStar(consoleWindow, exports);
19731
+ __exportStar(monacoLanguages, exports);
19732
+ __exportStar(monacoWorkspace, exports);
19733
+ __exportStar(monacoServices, exports);
19734
+ __exportStar(monacoConverter, exports);
19735
+
19736
+ }(lib$1));
19737
+
19738
+ const asLanguageClientOptionsById = options => options;
19739
+
19740
+ const staticOptions = asLanguageClientOptionsById({
19741
+ angular: {
19742
+ documentSelector: [{
19743
+ scheme: 'file',
19744
+ pattern: '**/*.ts'
19745
+ }],
19746
+ mutualizable: true,
19747
+ vscodeExtensionIds: ['typescript-language-features', 'angular']
19748
+ },
19749
+ bash: {
19750
+ documentSelector: [{
19751
+ scheme: 'file',
19752
+ pattern: '**/*.bash'
19753
+ }],
19754
+ mutualizable: true
19755
+ },
19756
+ c: {
19757
+ documentSelector: [{
19758
+ scheme: 'file',
19759
+ language: 'c'
19760
+ }, {
19761
+ scheme: 'file',
19762
+ language: 'cpp'
19763
+ }],
19764
+ mutualizable: false // The extension is cpptools BUT the language server is unable to use the configuration
19765
+ // vscodeExtensionIds: ['cpptools']
19766
+
19767
+ },
19768
+ csharp: {
19769
+ documentSelector: [{
19770
+ language: 'csharp'
19771
+ }],
19772
+ mutualizable: true,
19773
+ vscodeExtensionIds: ['omnisharp']
19774
+ },
19775
+ cpp: {
19776
+ documentSelector: [{
19777
+ scheme: 'file',
19778
+ language: 'c'
19779
+ }, {
19780
+ scheme: 'file',
19781
+ language: 'cpp'
19782
+ }, {
19783
+ scheme: 'file',
19784
+ language: 'cuda-cpp'
19785
+ }],
19786
+ mutualizable: false // The extension is cpptools BUT the language server is unable to use the configuration
19787
+ // vscodeExtensionIds: ['cpptools']
19788
+
19789
+ },
19790
+ clojure: {
19791
+ documentSelector: [{
19792
+ scheme: 'file',
19793
+ pattern: '**/*.clj',
19794
+ language: 'clojure'
19795
+ }],
19796
+ mutualizable: true
19797
+ },
19798
+ cobol: {
19799
+ documentSelector: ['COBOL'],
19800
+ synchronize: {
19801
+ configurationSection: 'cobol-lsp'
19802
+ },
19803
+ mutualizable: false,
19804
+ vscodeExtensionIds: ['cobol']
19805
+ },
19806
+ dart: {
19807
+ documentSelector: [{
19808
+ scheme: 'file',
19809
+ pattern: '**/*.dart',
19810
+ language: 'dart'
19811
+ }],
19812
+ mutualizable: true,
19813
+ vscodeExtensionIds: ['dart']
19814
+ },
19815
+ go: {
19816
+ documentSelector: [{
19817
+ language: 'go',
19818
+ scheme: 'file'
19819
+ }, {
19820
+ language: 'go.mod',
19821
+ scheme: 'file'
19822
+ }, {
19823
+ language: 'go.sum',
19824
+ scheme: 'file'
19825
+ }, {
19826
+ language: 'go.work',
19827
+ scheme: 'file'
19828
+ }, {
19829
+ language: 'tmpl',
19830
+ scheme: 'file'
19831
+ }],
19832
+ mutualizable: true
19833
+ },
19834
+ groovy: {
19835
+ documentSelector: [{
19836
+ scheme: 'file',
19837
+ language: 'groovy'
19838
+ }],
19839
+ synchronize: {
19840
+ configurationSection: 'groovy'
19841
+ },
19842
+ mutualizable: true,
19843
+ vscodeExtensionIds: ['vscode-groovy']
19844
+ },
19845
+ java: {
19846
+ documentSelector: [{
19847
+ scheme: 'file',
19848
+ language: 'java'
19849
+ }, {
19850
+ scheme: 'jdt',
19851
+ language: 'java'
19852
+ }, {
19853
+ scheme: 'untitled',
19854
+ language: 'java'
19855
+ }],
19856
+ synchronize: {
19857
+ configurationSection: ['java', 'editor.insertSpaces', 'editor.tabSize']
19858
+ },
19859
+ mutualizable: true,
19860
+ vscodeExtensionIds: ['java']
19861
+ },
19862
+ javascript: {
19863
+ documentSelector: [{
19864
+ pattern: '**/*.{js}',
19865
+ language: 'javascript'
19866
+ }, {
19867
+ pattern: '**/**.{js,jsx}',
19868
+ language: 'javascript'
19869
+ }],
19870
+ mutualizable: true,
19871
+ vscodeExtensionIds: ['typescript-language-features']
19872
+ },
19873
+ kotlin: {
19874
+ // https://github.com/fwcd/vscode-kotlin/blob/db5916080868a6a8e064c60d49624926c2fa61bd/src/languageSetup.ts#L104
19875
+ documentSelector: [{
19876
+ language: 'kotlin',
19877
+ scheme: 'file'
19878
+ }, {
19879
+ language: 'kotlin',
19880
+ scheme: 'kls'
19881
+ }],
19882
+ synchronize: {
19883
+ configurationSection: 'kotlin'
19884
+ },
19885
+ mutualizable: false
19886
+ },
19887
+ lua: {
19888
+ documentSelector: [{
19889
+ scheme: 'file',
19890
+ language: 'lua'
19891
+ }],
19892
+ synchronize: {
19893
+ configurationSection: 'Lua'
19894
+ },
19895
+ mutualizable: true,
19896
+ vscodeExtensionIds: ['lua']
19897
+ },
19898
+ mysql: {
19899
+ documentSelector: [{
19900
+ language: 'sql'
19901
+ }],
19902
+ // Disable code actions
19903
+ middleware: {
19904
+ provideCodeActions() {
19905
+ return [];
19906
+ }
19907
+
19908
+ },
19909
+ mutualizable: false
19910
+ },
19911
+ ocaml: {
19912
+ documentSelector: [{
19913
+ scheme: 'file',
19914
+ language: 'ocaml'
19915
+ }],
19916
+ mutualizable: false
19917
+ },
19918
+ 'php-serenata': {
19919
+ // https://gitlab.com/Serenata/visual-studio-code-client/-/blob/master/src/extension.ts#L120
19920
+ documentSelector: [{
19921
+ pattern: '**/*.php',
19922
+ scheme: 'file'
19923
+ }],
19924
+ synchronize: {
19925
+ configurationSection: 'serenata'
19926
+ },
19927
+ initializationOptions: {
19928
+ configuration: {
19929
+ uris: ['file:///tmp/project'],
19930
+ phpVersion: 7.3,
19931
+ fileExtensions: ['php'],
19932
+ indexDatabaseUri: 'file:///tmp/index.sqlite',
19933
+ excludedPathExpressions: ['file:///opt/serenata']
19934
+ }
19935
+ },
19936
+ mutualizable: true
19937
+ },
19938
+ php: {
19939
+ documentSelector: [{
19940
+ pattern: '**/*.php',
19941
+ language: 'php'
19942
+ }],
19943
+ mutualizable: true
19944
+ },
19945
+ postgresql: {
19946
+ documentSelector: [{
19947
+ language: 'postgres'
19948
+ }],
19949
+ // Disable code actions
19950
+ middleware: {
19951
+ provideCodeActions() {
19952
+ return [];
19953
+ }
19954
+
19955
+ },
19956
+ mutualizable: false
19957
+ },
19958
+ python: {
19959
+ documentSelector: [{
19960
+ language: 'python'
19961
+ }],
19962
+ synchronize: {
19963
+ configurationSection: 'python'
19964
+ },
19965
+ mutualizable: true,
19966
+ vscodeExtensionIds: ['vscode-python']
19967
+ },
19968
+ r: {
19969
+ // https://github.com/REditorSupport/vscode-R/blob/96ed4740101d8cd82f908b415df1dd205b4be824/src/languageService.ts#L186
19970
+ documentSelector: [{
19971
+ scheme: 'file',
19972
+ language: 'r'
19973
+ }, {
19974
+ scheme: 'file',
19975
+ language: 'rmd'
19976
+ }],
19977
+ synchronize: {
19978
+ configurationSection: 'r.lsp'
19979
+ },
19980
+ mutualizable: true,
19981
+ vscodeExtensionIds: ['vscode-R']
19982
+ },
19983
+ react: {
19984
+ documentSelector: [{
19985
+ pattern: '**/*.{tsx,jsx}'
19986
+ }],
19987
+ synchronize: {},
19988
+ mutualizable: true,
19989
+ vscodeExtensionIds: ['typescript-language-features']
19990
+ },
19991
+ ruby: {
19992
+ // https://github.com/castwide/vscode-solargraph/blob/3ebd9241f013305a84ec64334fca45b487bde904/src/language-client.ts#L56
19993
+ documentSelector: [{
19994
+ scheme: 'file',
19995
+ language: 'ruby'
19996
+ }],
19997
+ mutualizable: true,
19998
+ vscodeExtensionIds: ['solargraph'],
19999
+ synchronize: {
20000
+ configurationSection: 'solargraph'
20001
+ }
20002
+ },
20003
+ rust: {
20004
+ // https://github.com/rust-lang/vscode-rust/blob/b1ae67b06640ffab6e1ebb72e07364b4477dfbf1/rust-analyzer/editors/code/src/client.ts#L42
20005
+ documentSelector: [{
20006
+ scheme: 'file',
20007
+ language: 'rust'
20008
+ }],
20009
+ mutualizable: false
20010
+ },
20011
+ scala: {
20012
+ documentSelector: [{
20013
+ scheme: 'file',
20014
+ language: 'scala'
20015
+ }],
20016
+ synchronize: {
20017
+ configurationSection: 'metals'
20018
+ },
20019
+ mutualizable: false,
20020
+ vscodeExtensionIds: ['scalameta']
20021
+ },
20022
+ sql: {
20023
+ documentSelector: [{
20024
+ language: 'sql'
20025
+ }],
20026
+ // Disable code actions
20027
+ middleware: {
20028
+ provideCodeActions() {
20029
+ return [];
20030
+ }
20031
+
20032
+ },
20033
+ mutualizable: false
20034
+ },
20035
+ swift: {
20036
+ // https://github.com/apple/sourcekit-lsp/blob/59b5e68f7f8408b5bc44bd47f71ef1afdc63e7a6/Editors/vscode/src/extension.ts#L22
20037
+ documentSelector: ['swift', 'cpp', 'c', 'objective-c', 'objective-cpp'],
20038
+ synchronize: {},
20039
+ mutualizable: true
20040
+ },
20041
+ typescript: {
20042
+ documentSelector: [{
20043
+ pattern: '**/*.{ts}',
20044
+ language: 'typescript'
20045
+ }],
20046
+ synchronize: {},
20047
+ mutualizable: true,
20048
+ vscodeExtensionIds: ['typescript-language-features']
20049
+ },
20050
+ vue: {
20051
+ documentSelector: [{
20052
+ pattern: '**/*.js',
20053
+ language: 'javascript'
20054
+ }],
20055
+ synchronize: {},
20056
+ mutualizable: true,
20057
+ vscodeExtensionIds: ['typescript-language-features']
20058
+ }
20059
+ });
20060
+
20061
+ const dynamicOptions = {};
20062
+ function registerLanguageClient(id, options) {
20063
+ dynamicOptions[id] = options;
20064
+ return lib$1.Disposable.create(() => {
20065
+ if (dynamicOptions[id] === options) {
20066
+ delete dynamicOptions[id];
20063
20067
  }
20068
+ });
20064
20069
  }
20065
- exports.ProtocolToMonacoConverter = ProtocolToMonacoConverter;
20070
+ function getLanguageClientOptions(id) {
20071
+ var _dynamicOptions$id;
20066
20072
 
20067
- }(monacoConverter));
20073
+ return (_dynamicOptions$id = dynamicOptions[id]) !== null && _dynamicOptions$id !== void 0 ? _dynamicOptions$id : staticOptions[id];
20074
+ }
20068
20075
 
20069
- (function (exports) {
20070
- Object.defineProperty(exports, "__esModule", { value: true });
20071
- exports.MonacoServices = void 0;
20072
- const monaco_converter_1 = monacoConverter;
20073
- const monaco_commands_1 = monacoCommands;
20074
- const monaco_languages_1 = monacoLanguages;
20075
- const monaco_workspace_1 = monacoWorkspace;
20076
- const console_window_1 = consoleWindow;
20077
- const services_1 = services$1;
20078
- (function (MonacoServices) {
20079
- function create(_monaco, options = {}) {
20080
- const m2p = new monaco_converter_1.MonacoToProtocolConverter(_monaco);
20081
- const p2m = new monaco_converter_1.ProtocolToMonacoConverter(_monaco);
20082
- return {
20083
- commands: new monaco_commands_1.MonacoCommands(_monaco),
20084
- languages: new monaco_languages_1.MonacoLanguages(_monaco, p2m, m2p),
20085
- workspace: new monaco_workspace_1.MonacoWorkspace(_monaco, p2m, m2p, options.rootUri),
20086
- window: new console_window_1.ConsoleWindow()
20087
- };
20088
- }
20089
- MonacoServices.create = create;
20090
- function install(_monaco, options = {}) {
20091
- const services = create(_monaco, options);
20092
- services_1.Services.install(services);
20093
- return services;
20094
- }
20095
- MonacoServices.install = install;
20096
- function get() {
20097
- return services_1.Services.get();
20076
+ /**
20077
+ * Load the configuration schemas from vscode extensions
20078
+ * @param forLanguageClientIds Load the extensions related to these language client ids
20079
+ * @param useMutualizedProxy The language server proxy is used, so we only need to load configurations for language servers which are not mutualized
20080
+ */
20081
+
20082
+ async function loadExtensionConfigurations(forLanguageClientIds, useMutualizedProxy) {
20083
+ const extensionConfigurationToLoad = new Set();
20084
+
20085
+ for (const languageClientId of forLanguageClientIds) {
20086
+ const config = getLanguageClientOptions(languageClientId);
20087
+
20088
+ if (!config.mutualizable || !useMutualizedProxy) {
20089
+ var _config$vscodeExtensi;
20090
+
20091
+ (_config$vscodeExtensi = config.vscodeExtensionIds) === null || _config$vscodeExtensi === void 0 ? void 0 : _config$vscodeExtensi.forEach(extensionId => {
20092
+ extensionConfigurationToLoad.add(extensionId);
20093
+ });
20098
20094
  }
20099
- MonacoServices.get = get;
20100
- })(exports.MonacoServices || (exports.MonacoServices = {}));
20095
+ }
20101
20096
 
20102
- }(monacoServices));
20097
+ await Promise.all(Array.from(extensionConfigurationToLoad).map(extensionId => loadConfigurationForExtension(extensionId)));
20098
+ }
20103
20099
 
20104
- (function (exports) {
20105
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
20106
- if (k2 === undefined) k2 = k;
20107
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20108
- }) : (function(o, m, k, k2) {
20109
- if (k2 === undefined) k2 = k;
20110
- o[k2] = m[k];
20111
- }));
20112
- var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
20113
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20114
- };
20115
- Object.defineProperty(exports, "__esModule", { value: true });
20116
- /* --------------------------------------------------------------------------------------------
20117
- * Copyright (c) 2018 TypeFox GmbH (http://www.typefox.io). All rights reserved.
20118
- * Licensed under the MIT License. See License.txt in the project root for license information.
20119
- * ------------------------------------------------------------------------------------------ */
20120
- __exportStar(disposable$2, exports);
20121
- __exportStar(services$1, exports);
20122
- __exportStar(connection$2, exports);
20123
- __exportStar(monacoLanguageClient, exports);
20124
- __exportStar(monacoCommands, exports);
20125
- __exportStar(consoleWindow, exports);
20126
- __exportStar(monacoLanguages, exports);
20127
- __exportStar(monacoWorkspace, exports);
20128
- __exportStar(monacoServices, exports);
20129
- __exportStar(monacoConverter, exports);
20100
+ monaco.editor.onWillDisposeModel(model => {
20101
+ // We need to do it in a timeout or else the marker change event is delayed
20102
+ setTimeout(() => {
20103
+ monaco.editor.setModelMarkers(model, 'default', []);
20104
+ });
20105
+ });
20130
20106
 
20131
- }(lib$1));
20107
+ function ownKeys(object, enumerableOnly) {
20108
+ var keys = Object.keys(object);
20109
+
20110
+ if (Object.getOwnPropertySymbols) {
20111
+ var symbols = Object.getOwnPropertySymbols(object);
20112
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
20113
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20114
+ })), keys.push.apply(keys, symbols);
20115
+ }
20116
+
20117
+ return keys;
20118
+ }
20119
+
20120
+ function _objectSpread2(target) {
20121
+ for (var i = 1; i < arguments.length; i++) {
20122
+ var source = null != arguments[i] ? arguments[i] : {};
20123
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
20124
+ _defineProperty(target, key, source[key]);
20125
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
20126
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
20127
+ });
20128
+ }
20129
+
20130
+ return target;
20131
+ }
20132
+
20133
+ function _defineProperty(obj, key, value) {
20134
+ if (key in obj) {
20135
+ Object.defineProperty(obj, key, {
20136
+ value: value,
20137
+ enumerable: true,
20138
+ configurable: true,
20139
+ writable: true
20140
+ });
20141
+ } else {
20142
+ obj[key] = value;
20143
+ }
20144
+
20145
+ return obj;
20146
+ }
20132
20147
 
20133
20148
  var delay$2 = {exports: {}};
20134
20149
 
@@ -21097,7 +21112,7 @@ class LanguageClientManager {
21097
21112
 
21098
21113
  _defineProperty(this, "onWillShutdownEmitter", new lib$1.Emitter());
21099
21114
 
21100
- _defineProperty(this, "currentStatus", void 0);
21115
+ _defineProperty(this, "currentStatus", 'connecting');
21101
21116
 
21102
21117
  _defineProperty(this, "handleClose", () => {
21103
21118
  if (this.isDisposed()) {
@@ -21109,10 +21124,7 @@ class LanguageClientManager {
21109
21124
 
21110
21125
  _defineProperty(this, "handleError", error => {
21111
21126
  this.onErrorEmitter.fire(error);
21112
- this.updateStatus({
21113
- type: 'error',
21114
- message: error.message
21115
- });
21127
+ this.updateStatus('error');
21116
21128
  return lib$1.ErrorAction.Continue;
21117
21129
  });
21118
21130
  }
@@ -21123,17 +21135,13 @@ class LanguageClientManager {
21123
21135
  }
21124
21136
 
21125
21137
  notifyStatusChanged() {
21126
- if (this.currentStatus != null) {
21127
- this.onDidChangeStatusEmitter.fire({
21128
- status: this.currentStatus
21129
- });
21130
- }
21138
+ this.onDidChangeStatusEmitter.fire({
21139
+ status: this.currentStatus
21140
+ });
21131
21141
  }
21132
21142
 
21133
21143
  isReady() {
21134
- var _this$currentStatus;
21135
-
21136
- return ((_this$currentStatus = this.currentStatus) === null || _this$currentStatus === void 0 ? void 0 : _this$currentStatus.type) === 'ready';
21144
+ return this.currentStatus === 'ready';
21137
21145
  }
21138
21146
 
21139
21147
  async dispose() {
@@ -21278,16 +21286,13 @@ class LanguageClientManager {
21278
21286
  switch (state.newState) {
21279
21287
  case lib$1.State.Starting:
21280
21288
  {
21281
- this.updateStatus({
21282
- type: 'connecting',
21283
- message: 'Connecting language server...'
21284
- });
21289
+ this.updateStatus('connecting');
21285
21290
  readyPromise = languageClient.onReady().then(async () => {
21286
- let disposable = null;
21291
+ const disposableCollection = new lib$1.DisposableCollection();
21287
21292
  await Promise.race([new Promise(resolve => {
21288
- disposable = onServerResponse.event(resolve);
21293
+ disposableCollection.push(onServerResponse.event(resolve));
21289
21294
  }), delay$1(15000)]);
21290
- disposable.dispose();
21295
+ disposableCollection.dispose();
21291
21296
  }, error => {
21292
21297
  console.error('[LSP]', 'Error while waiting for the language client to be ready', error);
21293
21298
  });
@@ -21296,24 +21301,15 @@ class LanguageClientManager {
21296
21301
 
21297
21302
  case lib$1.State.Running:
21298
21303
  {
21299
- this.updateStatus({
21300
- type: 'connected',
21301
- message: 'Connected to language server'
21302
- });
21304
+ this.updateStatus('connected');
21303
21305
  await readyPromise;
21304
- this.updateStatus({
21305
- type: 'ready',
21306
- message: 'Language server ready'
21307
- });
21306
+ this.updateStatus('ready');
21308
21307
  break;
21309
21308
  }
21310
21309
 
21311
21310
  case lib$1.State.Stopped:
21312
21311
  {
21313
- this.updateStatus({
21314
- type: 'closed',
21315
- message: 'Connection closed'
21316
- });
21312
+ this.updateStatus('closed');
21317
21313
  break;
21318
21314
  }
21319
21315
  }
@@ -21350,7 +21346,7 @@ function createLanguageClientManager(id, sessionId, languageServerAddress, getSe
21350
21346
  throw new Error("Language client for language ".concat(id, " already started"));
21351
21347
  }
21352
21348
 
21353
- let languageServerOptions = staticOptions[id]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
21349
+ let languageServerOptions = getLanguageClientOptions(id); // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
21354
21350
 
21355
21351
  if (languageServerOptions == null) {
21356
21352
  throw new Error("Unknown ".concat(id, " language server"));
@@ -21394,4 +21390,4 @@ function getAllLanguageClientManagersByTextDocument(textDocument) {
21394
21390
  return getAllLanguageClientManagers().filter(manager => manager.isModelManaged(textDocument));
21395
21391
  }
21396
21392
 
21397
- export { LanguageClientManager, createLanguageClientManager, loadExtensionConfigurations };
21393
+ export { LanguageClientManager, createLanguageClientManager, loadExtensionConfigurations, registerLanguageClient };