@codingame/monaco-editor-wrapper 1.14.8 → 2.0.0

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.
Files changed (49) hide show
  1. package/dist/cpp.tmLanguage.js +50 -15
  2. package/dist/cpptools.js +44 -3
  3. package/dist/dart3.js +37 -1
  4. package/dist/directives.tmLanguage.js +20 -0
  5. package/dist/erlang.js +4 -4
  6. package/dist/features/extensionConfigurations.js +11 -1
  7. package/dist/fsharp.tmLanguage.js +24 -4
  8. package/dist/index.js +7 -0
  9. package/dist/interpolations.tmLanguage.js +20 -0
  10. package/dist/java2.js +6 -0
  11. package/dist/json.js +1 -1
  12. package/dist/jsonc.js +1 -1
  13. package/dist/lua2.js +1089 -125
  14. package/dist/main.js +434 -333
  15. package/dist/markdown-svelte-css.js +37 -0
  16. package/dist/markdown-svelte-js.js +37 -0
  17. package/dist/markdown-svelte.js +59 -0
  18. package/dist/markdown-vue.js +59 -0
  19. package/dist/monaco.d.ts +1 -1
  20. package/dist/omnisharp.js +2 -2
  21. package/dist/postcss.src.yaml.js +393 -0
  22. package/dist/pug-svelte-dotblock.js +69 -0
  23. package/dist/pug-svelte-tags.js +215 -0
  24. package/dist/pug-svelte.js +307 -0
  25. package/dist/scalameta.js +5 -3
  26. package/dist/sql.tmLanguage.js +21 -5
  27. package/dist/svelte.js +118 -0
  28. package/dist/svelte.svelte-vscode-svelte.js +46 -0
  29. package/dist/svelte.svelte-vscode.js +373 -0
  30. package/dist/svelte.tmLanguage.src.yaml.js +1099 -0
  31. package/dist/theme-defaults~light_vs.js +2 -1
  32. package/dist/tools/EditorOpenHandlerRegistry.d.ts +8 -0
  33. package/dist/typescript-language-features.js +16 -0
  34. package/dist/typescript.js +20 -1
  35. package/dist/typescriptreact.js +20 -1
  36. package/dist/vetur.js +407 -0
  37. package/dist/vscode-R.js +55 -0
  38. package/dist/vscode-python.js +6 -6
  39. package/dist/vue-generated.js +1301 -0
  40. package/dist/vue-html.js +99 -0
  41. package/dist/vue-html.tmLanguage.js +573 -0
  42. package/dist/vue-postcss.js +72 -0
  43. package/dist/vue-sugarss.js +60 -0
  44. package/dist/vue-sugarss2.js +396 -0
  45. package/dist/vue.js +106 -0
  46. package/package.json +54 -7
  47. package/stats.html +1 -1
  48. package/dist/services/MultiEditorStandaloneCodeEditorService.d.ts +0 -9
  49. package/dist/services/TextModelService.d.ts +0 -25
package/dist/main.js CHANGED
@@ -5,6 +5,8 @@ import onigFile from 'vscode-oniguruma/release/onig.wasm';
5
5
  import { loadWASM, createOnigScanner, createOnigString } from 'vscode-oniguruma';
6
6
  import { e as extensions, g as getConfiguration$1, o as onConfigurationChanged } from './index.js';
7
7
  export { g as getConfiguration, o as onConfigurationChanged, r as registerConfigurations, a as registerDefaultConfigurations, u as updateUserConfiguration } from './index.js';
8
+ import getModelEditorServiceOverride from 'vscode/service-override/modelEditor';
9
+ import getMessageServiceOverride from 'vscode/service-override/messages';
8
10
  import './worker.js';
9
11
  import 'monaco-editor/esm/vs/editor/editor.all';
10
12
  import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp';
@@ -490,6 +492,7 @@ var rawGrammars = [
490
492
  "meta.embedded.block.javascript": "javascript",
491
493
  "meta.embedded.block.json": "json",
492
494
  "meta.embedded.block.jsonc": "jsonc",
495
+ "meta.embedded.block.latex": "latex",
493
496
  "meta.embedded.block.less": "less",
494
497
  "meta.embedded.block.objc": "objc",
495
498
  "meta.embedded.block.scss": "scss",
@@ -585,6 +588,13 @@ var rawGrammars = [
585
588
  {
586
589
  "language": "typescript",
587
590
  "scopeName": "source.ts",
591
+ "unbalancedBracketScopes": [
592
+ "keyword.operator.relational",
593
+ "storage.type.function.arrow",
594
+ "keyword.operator.bitwise.shift",
595
+ "meta.brace.angle",
596
+ "punctuation.definition.tag"
597
+ ],
588
598
  "tokenTypes": {
589
599
  "meta.template.expression": "other",
590
600
  "meta.template.expression string": "string",
@@ -598,6 +608,12 @@ var rawGrammars = [
598
608
  {
599
609
  "language": "typescriptreact",
600
610
  "scopeName": "source.tsx",
611
+ "unbalancedBracketScopes": [
612
+ "keyword.operator.relational",
613
+ "storage.type.function.arrow",
614
+ "keyword.operator.bitwise.shift",
615
+ "punctuation.definition.tag"
616
+ ],
601
617
  "embeddedLanguages": {
602
618
  "meta.tag.tsx": "jsx-tags",
603
619
  "meta.tag.without-attributes.tsx": "jsx-tags",
@@ -1001,6 +1017,144 @@ var rawGrammars = [
1001
1017
  {
1002
1018
  "language": "solidity",
1003
1019
  "scopeName": "source.solidity"
1020
+ },
1021
+ {
1022
+ "language": "vue",
1023
+ "scopeName": "source.vue",
1024
+ "embeddedLanguages": {
1025
+ "text.html.basic": "html",
1026
+ "text.html.vue-html": "vue-html",
1027
+ "text.jade.slm": "slm",
1028
+ "text.pug": "jade",
1029
+ "text.haml": "haml",
1030
+ "text.slim": "slim",
1031
+ "text.html.liquid": "liquid",
1032
+ "source.css": "css",
1033
+ "source.css.scss": "scss",
1034
+ "source.css.less": "less",
1035
+ "source.css.postcss": "vue-postcss",
1036
+ "source.css.sugarss": "vue-sugarss",
1037
+ "source.sass": "sass",
1038
+ "source.stylus": "stylus",
1039
+ "source.js": "javascript",
1040
+ "source.ts": "typescript",
1041
+ "source.coffee": "coffeescript",
1042
+ "text.html.markdown": "md",
1043
+ "source.yaml": "yaml",
1044
+ "source.json": "json",
1045
+ "source.php": "php",
1046
+ "source.graphql": "graphql"
1047
+ }
1048
+ },
1049
+ {
1050
+ "language": "vue-postcss",
1051
+ "scopeName": "source.css.postcss"
1052
+ },
1053
+ {
1054
+ "language": "vue-sugarss",
1055
+ "scopeName": "source.css.sugarss"
1056
+ },
1057
+ {
1058
+ "language": "vue-html",
1059
+ "scopeName": "text.html.vue-html",
1060
+ "embeddedLanguages": {
1061
+ "source.js": "javascript"
1062
+ }
1063
+ },
1064
+ {
1065
+ "scopeName": "vue.pug.directives",
1066
+ "injectTo": [
1067
+ "source.vue"
1068
+ ]
1069
+ },
1070
+ {
1071
+ "scopeName": "vue.pug.interpolations",
1072
+ "injectTo": [
1073
+ "source.vue"
1074
+ ]
1075
+ },
1076
+ {
1077
+ "scopeName": "markdown.vue.codeblock",
1078
+ "injectTo": [
1079
+ "text.html.markdown"
1080
+ ],
1081
+ "embeddedLanguages": {
1082
+ "meta.embedded.block.vue": "vue"
1083
+ }
1084
+ },
1085
+ {
1086
+ "language": "svelte",
1087
+ "scopeName": "source.svelte",
1088
+ "embeddedLanguages": {
1089
+ "text.html.basic": "html",
1090
+ "text.html.markdown": "markdown",
1091
+ "text.pug": "jade",
1092
+ "source.css": "css",
1093
+ "source.css.less": "less",
1094
+ "source.css.scss": "scss",
1095
+ "source.css.postcss": "postcss",
1096
+ "source.sass": "sass",
1097
+ "source.stylus": "stylus",
1098
+ "source.js": "javascript",
1099
+ "source.ts": "typescript",
1100
+ "source.coffee": "coffeescript"
1101
+ }
1102
+ },
1103
+ {
1104
+ "scopeName": "svelte.pug",
1105
+ "injectTo": [
1106
+ "source.svelte"
1107
+ ],
1108
+ "embeddedLanguages": {
1109
+ "source.ts": "typescript",
1110
+ "text.pug": "jade"
1111
+ }
1112
+ },
1113
+ {
1114
+ "scopeName": "svelte.pug.tags",
1115
+ "injectTo": [
1116
+ "source.svelte"
1117
+ ],
1118
+ "embeddedLanguages": {
1119
+ "source.ts": "typescript",
1120
+ "text.pug": "jade"
1121
+ }
1122
+ },
1123
+ {
1124
+ "scopeName": "svelte.pug.dotblock",
1125
+ "injectTo": [
1126
+ "source.svelte"
1127
+ ],
1128
+ "embeddedLanguages": {
1129
+ "source.ts": "typescript"
1130
+ }
1131
+ },
1132
+ {
1133
+ "scopeName": "markdown.svelte.codeblock",
1134
+ "injectTo": [
1135
+ "text.html.markdown"
1136
+ ],
1137
+ "embeddedLanguages": {
1138
+ "meta.embedded.block.svelte": "svelte"
1139
+ }
1140
+ },
1141
+ {
1142
+ "scopeName": "markdown.svelte.codeblock.script",
1143
+ "injectTo": [
1144
+ "text.html.markdown"
1145
+ ]
1146
+ },
1147
+ {
1148
+ "scopeName": "markdown.svelte.codeblock.style",
1149
+ "injectTo": [
1150
+ "text.html.markdown"
1151
+ ]
1152
+ },
1153
+ {
1154
+ "scopeName": "source.css.postcss",
1155
+ "injectTo": [
1156
+ "source.svelte"
1157
+ ]
1004
1158
  }
1005
1159
  ];
1006
1160
 
@@ -1497,7 +1651,77 @@ const loader$3 = {
1497
1651
  /* webpackChunkName: "grammar-source-solidity" */
1498
1652
 
1499
1653
  /* webpackMode: "lazy" */
1500
- './solidity2.js').then(module => module)).default
1654
+ './solidity2.js').then(module => module)).default,
1655
+ 'source.vue': async () => (await import(
1656
+ /* webpackChunkName: "grammar-source-vue" */
1657
+
1658
+ /* webpackMode: "lazy" */
1659
+ './vue-generated.js').then(module => module)).default,
1660
+ 'source.css.postcss': async () => (await import(
1661
+ /* webpackChunkName: "grammar-source-css-postcss" */
1662
+
1663
+ /* webpackMode: "lazy" */
1664
+ './postcss.src.yaml.js').then(module => module)).default,
1665
+ 'source.css.sugarss': async () => (await import(
1666
+ /* webpackChunkName: "grammar-source-css-sugarss" */
1667
+
1668
+ /* webpackMode: "lazy" */
1669
+ './vue-sugarss2.js').then(module => module)).default,
1670
+ 'text.html.vue-html': async () => (await import(
1671
+ /* webpackChunkName: "grammar-text-html-vue-html" */
1672
+
1673
+ /* webpackMode: "lazy" */
1674
+ './vue-html.tmLanguage.js').then(module => module)).default,
1675
+ 'vue.pug.directives': async () => (await import(
1676
+ /* webpackChunkName: "grammar-vue-pug-directives" */
1677
+
1678
+ /* webpackMode: "lazy" */
1679
+ './directives.tmLanguage.js').then(module => module)).default,
1680
+ 'vue.pug.interpolations': async () => (await import(
1681
+ /* webpackChunkName: "grammar-vue-pug-interpolations" */
1682
+
1683
+ /* webpackMode: "lazy" */
1684
+ './interpolations.tmLanguage.js').then(module => module)).default,
1685
+ 'markdown.vue.codeblock': async () => (await import(
1686
+ /* webpackChunkName: "grammar-markdown-vue-codeblock" */
1687
+
1688
+ /* webpackMode: "lazy" */
1689
+ './markdown-vue.js').then(module => module)).default,
1690
+ 'source.svelte': async () => (await import(
1691
+ /* webpackChunkName: "grammar-source-svelte" */
1692
+
1693
+ /* webpackMode: "lazy" */
1694
+ './svelte.tmLanguage.src.yaml.js').then(module => module)).default,
1695
+ 'svelte.pug': async () => (await import(
1696
+ /* webpackChunkName: "grammar-svelte-pug" */
1697
+
1698
+ /* webpackMode: "lazy" */
1699
+ './pug-svelte.js').then(module => module)).default,
1700
+ 'svelte.pug.tags': async () => (await import(
1701
+ /* webpackChunkName: "grammar-svelte-pug-tags" */
1702
+
1703
+ /* webpackMode: "lazy" */
1704
+ './pug-svelte-tags.js').then(module => module)).default,
1705
+ 'svelte.pug.dotblock': async () => (await import(
1706
+ /* webpackChunkName: "grammar-svelte-pug-dotblock" */
1707
+
1708
+ /* webpackMode: "lazy" */
1709
+ './pug-svelte-dotblock.js').then(module => module)).default,
1710
+ 'markdown.svelte.codeblock': async () => (await import(
1711
+ /* webpackChunkName: "grammar-markdown-svelte-codeblock" */
1712
+
1713
+ /* webpackMode: "lazy" */
1714
+ './markdown-svelte.js').then(module => module)).default,
1715
+ 'markdown.svelte.codeblock.script': async () => (await import(
1716
+ /* webpackChunkName: "grammar-markdown-svelte-codeblock-script" */
1717
+
1718
+ /* webpackMode: "lazy" */
1719
+ './markdown-svelte-js.js').then(module => module)).default,
1720
+ 'markdown.svelte.codeblock.style': async () => (await import(
1721
+ /* webpackChunkName: "grammar-markdown-svelte-codeblock-style" */
1722
+
1723
+ /* webpackMode: "lazy" */
1724
+ './markdown-svelte-css.js').then(module => module)).default
1501
1725
  };
1502
1726
 
1503
1727
  // Inpired by https://github.com/microsoft/vscode/blob/94c9ea46838a9a619aeafb7e8afd1170c967bb55/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts
@@ -2833,6 +3057,54 @@ var textMateLanguages = [
2833
3057
  "extensions": [
2834
3058
  ".sol"
2835
3059
  ]
3060
+ },
3061
+ {
3062
+ "id": "vue",
3063
+ "aliases": [
3064
+ "Vue",
3065
+ "vue"
3066
+ ],
3067
+ "extensions": [
3068
+ ".vue"
3069
+ ]
3070
+ },
3071
+ {
3072
+ "id": "vue-html",
3073
+ "aliases": [
3074
+ "Vue-html"
3075
+ ]
3076
+ },
3077
+ {
3078
+ "id": "vue-postcss",
3079
+ "aliases": [
3080
+ "Vue-PostCSS",
3081
+ "Vue-POSTCSS",
3082
+ "vue-postcss"
3083
+ ]
3084
+ },
3085
+ {
3086
+ "id": "vue-sugarss",
3087
+ "aliases": [
3088
+ "Vue-SugarSS",
3089
+ "Vue-SUGARSS",
3090
+ "vue-sugarss"
3091
+ ]
3092
+ },
3093
+ {
3094
+ "id": "svelte",
3095
+ "aliases": [
3096
+ "Svelte",
3097
+ "svelte"
3098
+ ],
3099
+ "extensions": [
3100
+ ".svelte"
3101
+ ]
3102
+ },
3103
+ {
3104
+ "id": "json",
3105
+ "filenames": [
3106
+ ".prettierrc"
3107
+ ]
2836
3108
  }
2837
3109
  ];
2838
3110
 
@@ -3299,7 +3571,32 @@ const loader$2 = {
3299
3571
  /* webpackChunkName: "language-configuration-solidity" */
3300
3572
 
3301
3573
  /* webpackMode: "lazy" */
3302
- './solidity.js').then(module => module)).default
3574
+ './solidity.js').then(module => module)).default,
3575
+ 'vue': async () => (await import(
3576
+ /* webpackChunkName: "language-configuration-vue" */
3577
+
3578
+ /* webpackMode: "lazy" */
3579
+ './vue.js').then(module => module)).default,
3580
+ 'vue-html': async () => (await import(
3581
+ /* webpackChunkName: "language-configuration-vue-html" */
3582
+
3583
+ /* webpackMode: "lazy" */
3584
+ './vue-html.js').then(module => module)).default,
3585
+ 'vue-postcss': async () => (await import(
3586
+ /* webpackChunkName: "language-configuration-vue-postcss" */
3587
+
3588
+ /* webpackMode: "lazy" */
3589
+ './vue-postcss.js').then(module => module)).default,
3590
+ 'vue-sugarss': async () => (await import(
3591
+ /* webpackChunkName: "language-configuration-vue-sugarss" */
3592
+
3593
+ /* webpackMode: "lazy" */
3594
+ './vue-sugarss.js').then(module => module)).default,
3595
+ 'svelte': async () => (await import(
3596
+ /* webpackChunkName: "language-configuration-svelte" */
3597
+
3598
+ /* webpackMode: "lazy" */
3599
+ './svelte.js').then(module => module)).default
3303
3600
  };
3304
3601
 
3305
3602
  // Generated file, do not modify
@@ -3460,7 +3757,12 @@ const loader$1 = {
3460
3757
  /* webpackChunkName: "snippet-solidity" */
3461
3758
 
3462
3759
  /* webpackMode: "lazy" */
3463
- './solidity-solidity.js').then(module => module)).default
3760
+ './solidity-solidity.js').then(module => module)).default,
3761
+ 'svelte': async () => (await import(
3762
+ /* webpackChunkName: "snippet-svelte" */
3763
+
3764
+ /* webpackMode: "lazy" */
3765
+ './svelte.svelte-vscode-svelte.js').then(module => module)).default
3464
3766
  };
3465
3767
 
3466
3768
  class SimpleSnippetService {
@@ -3780,326 +4082,6 @@ for (const themeExtensionPoint of defaultThemes) {
3780
4082
  });
3781
4083
  }
3782
4084
 
3783
- let popupEditorDisposable = null;
3784
-
3785
- function openNewCodeEditor(model) {
3786
- if (popupEditorDisposable != null) {
3787
- popupEditorDisposable.dispose();
3788
- popupEditorDisposable = null;
3789
- }
3790
-
3791
- const container = document.createElement('div');
3792
- container.style.position = 'fixed';
3793
- container.style.zIndex = '10000';
3794
- container.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
3795
- container.style.top = container.style.bottom = container.style.left = container.style.right = '0';
3796
- container.style.cursor = 'pointer';
3797
- const editorElem = document.createElement('div');
3798
- editorElem.style.position = 'absolute';
3799
- editorElem.style.top = editorElem.style.bottom = editorElem.style.left = editorElem.style.right = '0';
3800
- editorElem.style.margin = 'auto';
3801
- editorElem.style.width = '80%';
3802
- editorElem.style.height = '80%';
3803
- container.appendChild(editorElem);
3804
- document.body.appendChild(container);
3805
- const editor = createEditor(editorElem, _objectSpread2({
3806
- model,
3807
- readOnly: true,
3808
- automaticLayout: true
3809
- }, getConfiguration$1(model.getLanguageId(), 'editor')));
3810
- popupEditorDisposable = {
3811
- dispose: () => {
3812
- editor.dispose();
3813
- document.body.removeChild(container);
3814
- popupEditorDisposable = null;
3815
- }
3816
- };
3817
- container.addEventListener('mousedown', event => {
3818
- var _popupEditorDisposabl;
3819
-
3820
- if (event.target !== container) {
3821
- return;
3822
- }
3823
-
3824
- (_popupEditorDisposabl = popupEditorDisposable) === null || _popupEditorDisposabl === void 0 ? void 0 : _popupEditorDisposabl.dispose();
3825
- });
3826
- return editor;
3827
- }
3828
-
3829
- class MultiEditorStandaloneCodeEditorServiceImpl extends monaco$2.extra.StandaloneCodeEditorService {
3830
- constructor(contextKeyService, themeService, textModelService) {
3831
- super(contextKeyService, themeService);
3832
-
3833
- _defineProperty(this, "textModelService", void 0);
3834
-
3835
- _defineProperty(this, "handlers", []);
3836
-
3837
- this.textModelService = textModelService;
3838
- }
3839
-
3840
- registerEditorOpenHandler(handler) {
3841
- this.handlers.push(handler);
3842
- return {
3843
- dispose: () => {
3844
- const index = this.handlers.indexOf(handler);
3845
-
3846
- if (index >= 0) {
3847
- this.handlers.splice(index, 1);
3848
- }
3849
- }
3850
- };
3851
- }
3852
-
3853
- async openCodeEditor(input, editor, sideBySide) {
3854
- var _modelEditor$getDomNo;
3855
-
3856
- const reference = await this.textModelService.createModelReference(input.resource);
3857
- const model = reference.object.textEditorModel;
3858
- let modelEditor;
3859
-
3860
- if (editor != null && editor.getModel() === model) {
3861
- modelEditor = editor;
3862
- }
3863
-
3864
- if (modelEditor == null) {
3865
- const codeEditors = monaco$2.extra.StandaloneServices.get(monaco$2.extra.ICodeEditorService).listCodeEditors();
3866
- modelEditor = codeEditors.find(editor => editor.getModel() === model);
3867
- }
3868
-
3869
- if (modelEditor == null) {
3870
- for (const handler of this.handlers) {
3871
- const handlerEditor = await handler(model, input, editor, sideBySide);
3872
-
3873
- if (handlerEditor != null) {
3874
- modelEditor = handlerEditor;
3875
- break;
3876
- }
3877
- }
3878
- }
3879
-
3880
- if (modelEditor == null) {
3881
- modelEditor = openNewCodeEditor(model);
3882
- }
3883
-
3884
- super.doOpenEditor(modelEditor, input);
3885
- modelEditor.focus();
3886
-
3887
- if (((_modelEditor$getDomNo = modelEditor.getDomNode()) === null || _modelEditor$getDomNo === void 0 ? void 0 : _modelEditor$getDomNo.scrollIntoView) != null) {
3888
- var _modelEditor$getDomNo2;
3889
-
3890
- (_modelEditor$getDomNo2 = modelEditor.getDomNode()) === null || _modelEditor$getDomNo2 === void 0 ? void 0 : _modelEditor$getDomNo2.scrollIntoView({
3891
- block: 'nearest',
3892
- inline: 'nearest'
3893
- });
3894
- }
3895
-
3896
- const onModelUnmount = () => {
3897
- reference.dispose();
3898
- };
3899
-
3900
- const onDidDisposeDisposable = modelEditor.onDidDispose(() => {
3901
- onModelUnmount();
3902
- });
3903
- const onDidChangeModelDisposable = modelEditor.onDidChangeModel(e => {
3904
- if (e.newModelUrl == null || e.newModelUrl.toString() !== model.uri.toString()) {
3905
- onModelUnmount();
3906
- onDidDisposeDisposable.dispose();
3907
- onDidChangeModelDisposable.dispose();
3908
- }
3909
- });
3910
- return modelEditor;
3911
- }
3912
-
3913
- }
3914
-
3915
- class SimpleResolvedModel {
3916
- constructor(model, readonly) {
3917
- this.model = model;
3918
- this.readonly = readonly;
3919
-
3920
- _defineProperty(this, "_onWillDispose", void 0);
3921
-
3922
- _defineProperty(this, "disposed", false);
3923
-
3924
- this._onWillDispose = new monaco$2.Emitter();
3925
- }
3926
-
3927
- getLanguageId() {
3928
- return this.model.getLanguageId();
3929
- }
3930
-
3931
- get onWillDispose() {
3932
- return this._onWillDispose.event;
3933
- }
3934
-
3935
- resolve() {
3936
- return Promise.resolve();
3937
- }
3938
-
3939
- get textEditorModel() {
3940
- return this.model;
3941
- }
3942
-
3943
- createSnapshot() {
3944
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3945
- return this.model.createSnapshot();
3946
- }
3947
-
3948
- isReadonly() {
3949
- return this.readonly;
3950
- }
3951
-
3952
- dispose() {
3953
- this.disposed = true;
3954
-
3955
- this._onWillDispose.fire();
3956
- }
3957
-
3958
- isDisposed() {
3959
- return this.disposed;
3960
- }
3961
-
3962
- isResolved() {
3963
- return true;
3964
- }
3965
-
3966
- getMode() {
3967
- return this.model.getLanguageId();
3968
- }
3969
-
3970
- }
3971
-
3972
- class ResourceModelCollection extends monaco$2.extra.ReferenceCollection {
3973
- constructor() {
3974
- super(...arguments);
3975
-
3976
- _defineProperty(this, "providers", new Map());
3977
-
3978
- _defineProperty(this, "modelsToDispose", new Set());
3979
- }
3980
-
3981
- async createReferencedObject(key) {
3982
- // Untrack as being disposed
3983
- this.modelsToDispose.delete(key);
3984
- const resource = monaco$2.Uri.parse(key);
3985
- const existingModel = monaco$2.editor.getModel(resource);
3986
-
3987
- if (existingModel != null) {
3988
- return new SimpleResolvedModel(existingModel, false);
3989
- }
3990
-
3991
- if (this.providers.has(resource.scheme)) {
3992
- const model = await this.resolveTextModelContent(key);
3993
- const resolvedModel = new SimpleResolvedModel(model, true);
3994
- resolvedModel.onWillDispose(() => {
3995
- model.dispose();
3996
- });
3997
- return resolvedModel;
3998
- }
3999
-
4000
- throw new Error("Unable to resolve resource ".concat(key));
4001
- }
4002
-
4003
- destroyReferencedObject(key, modelPromise) {
4004
- const resource = monaco$2.Uri.parse(key);
4005
-
4006
- if (resource.scheme === 'untitled' || resource.scheme === 'inMemory') {
4007
- return;
4008
- }
4009
-
4010
- this.modelsToDispose.add(key);
4011
- (async () => {
4012
- try {
4013
- const model = await modelPromise;
4014
-
4015
- if (!this.modelsToDispose.has(key)) {
4016
- // return if model has been acquired again meanwhile
4017
- return;
4018
- } // Finally we can dispose the model
4019
-
4020
-
4021
- model.dispose();
4022
- } finally {
4023
- this.modelsToDispose.delete(key); // Untrack as being disposed
4024
- }
4025
- })().catch(() => {// ignore
4026
- });
4027
- }
4028
-
4029
- registerTextModelContentProvider(scheme, provider) {
4030
- let providers = this.providers.get(scheme);
4031
-
4032
- if (providers == null) {
4033
- providers = [];
4034
- this.providers.set(scheme, providers);
4035
- }
4036
-
4037
- providers.unshift(provider);
4038
- return monaco$2.extra.toDisposable(() => {
4039
- const providersForScheme = this.providers.get(scheme);
4040
-
4041
- if (providersForScheme == null) {
4042
- return;
4043
- }
4044
-
4045
- const index = providersForScheme.indexOf(provider);
4046
-
4047
- if (index === -1) {
4048
- return;
4049
- }
4050
-
4051
- providersForScheme.splice(index, 1);
4052
-
4053
- if (providersForScheme.length === 0) {
4054
- this.providers.delete(scheme);
4055
- }
4056
- });
4057
- }
4058
-
4059
- hasTextModelContentProvider(scheme) {
4060
- return this.providers.get(scheme) !== undefined;
4061
- }
4062
-
4063
- async resolveTextModelContent(key) {
4064
- var _this$providers$get;
4065
-
4066
- const resource = monaco$2.Uri.parse(key);
4067
- const providersForScheme = (_this$providers$get = this.providers.get(resource.scheme)) !== null && _this$providers$get !== void 0 ? _this$providers$get : [];
4068
-
4069
- for (const provider of providersForScheme) {
4070
- const value = await provider.provideTextContent(resource);
4071
-
4072
- if (value != null) {
4073
- return value;
4074
- }
4075
- }
4076
-
4077
- throw new Error("Unable to resolve text model content for resource ".concat(key));
4078
- }
4079
-
4080
- }
4081
-
4082
- class TextModelService extends monaco$2.extra.StandaloneTextModelService {
4083
- // eslint-disable-next-line @typescript-eslint/no-useless-constructor
4084
- constructor(modelService) {
4085
- super(modelService);
4086
-
4087
- _defineProperty(this, "resourceModelCollection", new ResourceModelCollection());
4088
-
4089
- _defineProperty(this, "asyncModelCollection", new monaco$2.extra.AsyncReferenceCollection(this.resourceModelCollection));
4090
- }
4091
-
4092
- registerTextModelContentProvider(scheme, provider) {
4093
- return this.resourceModelCollection.registerTextModelContentProvider(scheme, provider);
4094
- }
4095
-
4096
- async createModelReference(resource) {
4097
- const result = await this.asyncModelCollection.acquire(resource.toString());
4098
- return result;
4099
- }
4100
-
4101
- }
4102
-
4103
4085
  const fixedPositions = [0, 6, 7, 11];
4104
4086
  const lastFixedPosition = fixedPositions[fixedPositions.length - 1];
4105
4087
 
@@ -4219,16 +4201,136 @@ function setup(editor) {
4219
4201
  setup$1(editor);
4220
4202
  }
4221
4203
 
4222
- monaco$2.extra.StandaloneServices.initialize({
4223
- get textModelService() {
4224
- return new TextModelService(monaco$2.extra.StandaloneServices.get(monaco$2.extra.IModelService));
4225
- },
4204
+ let currentEditor = null;
4205
+
4206
+ function openNewCodeEditor(model) {
4207
+ if (currentEditor != null && model === currentEditor.model) {
4208
+ return currentEditor.editor;
4209
+ }
4226
4210
 
4227
- get codeEditorService() {
4228
- return new MultiEditorStandaloneCodeEditorServiceImpl(monaco$2.extra.StandaloneServices.get(monaco$2.extra.IContextKeyService), monaco$2.extra.StandaloneServices.get(monaco$2.editor.IStandaloneThemeService), monaco$2.extra.StandaloneServices.get(monaco$2.extra.ITextModelService));
4211
+ if (currentEditor != null) {
4212
+ currentEditor.dispose();
4213
+ currentEditor = null;
4229
4214
  }
4230
4215
 
4231
- }); // Disable high contrast autodetection because it fallbacks on the hc-black no matter what
4216
+ const container = document.createElement('div');
4217
+ container.style.position = 'fixed';
4218
+ container.style.zIndex = '10000';
4219
+ container.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
4220
+ container.style.top = container.style.bottom = container.style.left = container.style.right = '0';
4221
+ container.style.cursor = 'pointer';
4222
+ const editorElem = document.createElement('div');
4223
+ editorElem.style.position = 'absolute';
4224
+ editorElem.style.top = editorElem.style.bottom = editorElem.style.left = editorElem.style.right = '0';
4225
+ editorElem.style.margin = 'auto';
4226
+ editorElem.style.width = '80%';
4227
+ editorElem.style.height = '80%';
4228
+ container.appendChild(editorElem);
4229
+ document.body.appendChild(container);
4230
+
4231
+ try {
4232
+ const editor = createEditor(editorElem, _objectSpread2({
4233
+ model,
4234
+ readOnly: true,
4235
+ automaticLayout: true
4236
+ }, getConfiguration$1(model.getLanguageId(), 'editor')));
4237
+ currentEditor = {
4238
+ dispose: () => {
4239
+ editor.dispose();
4240
+ document.body.removeChild(container);
4241
+ currentEditor = null;
4242
+ },
4243
+ model,
4244
+ editor
4245
+ };
4246
+ container.addEventListener('mousedown', event => {
4247
+ var _currentEditor;
4248
+
4249
+ if (event.target !== container) {
4250
+ return;
4251
+ }
4252
+
4253
+ (_currentEditor = currentEditor) === null || _currentEditor === void 0 ? void 0 : _currentEditor.dispose();
4254
+ });
4255
+ return editor;
4256
+ } catch (error) {
4257
+ document.body.removeChild(container);
4258
+ currentEditor = null;
4259
+ throw error;
4260
+ }
4261
+ }
4262
+
4263
+ class EditorOpenHandlerRegistry {
4264
+ constructor() {
4265
+ _defineProperty(this, "handlers", []);
4266
+
4267
+ _defineProperty(this, "openCodeEditor", async (model, options, sideBySide) => {
4268
+ var _modelEditor$getDomNo;
4269
+
4270
+ let modelEditor;
4271
+
4272
+ for (const handler of this.handlers) {
4273
+ const handlerEditor = await handler(model, options, null, sideBySide);
4274
+
4275
+ if (handlerEditor != null) {
4276
+ modelEditor = handlerEditor;
4277
+ break;
4278
+ }
4279
+ }
4280
+
4281
+ if (modelEditor == null) {
4282
+ modelEditor = openNewCodeEditor(model); // Destroy model ref when we close the editor popup
4283
+
4284
+ const onModelUnmount = () => {
4285
+ model.dispose();
4286
+ };
4287
+
4288
+ const onDidDisposeDisposable = modelEditor.onDidDispose(() => {
4289
+ onModelUnmount();
4290
+ });
4291
+ const onDidChangeModelDisposable = modelEditor.onDidChangeModel(e => {
4292
+ if (e.newModelUrl == null || e.newModelUrl.toString() !== model.uri.toString()) {
4293
+ onModelUnmount();
4294
+ onDidDisposeDisposable.dispose();
4295
+ onDidChangeModelDisposable.dispose();
4296
+ }
4297
+ });
4298
+ }
4299
+
4300
+ modelEditor.focus();
4301
+
4302
+ if (((_modelEditor$getDomNo = modelEditor.getDomNode()) === null || _modelEditor$getDomNo === void 0 ? void 0 : _modelEditor$getDomNo.scrollIntoView) != null) {
4303
+ var _modelEditor$getDomNo2;
4304
+
4305
+ (_modelEditor$getDomNo2 = modelEditor.getDomNode()) === null || _modelEditor$getDomNo2 === void 0 ? void 0 : _modelEditor$getDomNo2.scrollIntoView({
4306
+ block: 'nearest',
4307
+ inline: 'nearest'
4308
+ });
4309
+ }
4310
+
4311
+ return modelEditor;
4312
+ });
4313
+ }
4314
+
4315
+ registerEditorOpenHandler(handler) {
4316
+ this.handlers.push(handler);
4317
+ return {
4318
+ dispose: () => {
4319
+ const index = this.handlers.indexOf(handler);
4320
+
4321
+ if (index >= 0) {
4322
+ this.handlers.splice(index, 1);
4323
+ }
4324
+ }
4325
+ };
4326
+ }
4327
+
4328
+ }
4329
+
4330
+ const editorOpenHandlerRegistry = new EditorOpenHandlerRegistry();
4331
+ monaco$2.extra.StandaloneServices.initialize(_objectSpread2(_objectSpread2({}, getModelEditorServiceOverride((model, input, sideBySide) => {
4332
+ return editorOpenHandlerRegistry.openCodeEditor(model, input, sideBySide);
4333
+ })), getMessageServiceOverride(document.body))); // Disable high contrast autodetection because it fallbacks on the hc-black no matter what
4232
4334
 
4233
4335
  monaco$2.extra.StandaloneServices.get(monaco$2.editor.IStandaloneThemeService).setAutoDetectHighContrast(false); // Force EOL to be '\n' even on Windows
4234
4336
 
@@ -4254,8 +4356,7 @@ function registerTextModelContentProvider(scheme, provider) {
4254
4356
  }
4255
4357
 
4256
4358
  function registerEditorOpenHandler(handler) {
4257
- const codeEditorService = monaco$2.extra.StandaloneServices.get(monaco$2.extra.ICodeEditorService);
4258
- return codeEditorService.registerEditorOpenHandler(handler);
4359
+ return editorOpenHandlerRegistry.registerEditorOpenHandler(handler);
4259
4360
  }
4260
4361
 
4261
4362
  var lib$1 = {};
@@ -16093,8 +16194,8 @@ function initVimMode(editor, statusBarElement) {
16093
16194
  return lib.initVimMode(editor, statusBarElement);
16094
16195
  }
16095
16196
 
16096
- const keybindingService = monaco$2.extra.StandaloneServices.get(monaco$2.extra.IKeybindingService);
16097
16197
  function updateKeybindings(bindings) {
16198
+ const keybindingService = monaco$2.extra.StandaloneServices.get(monaco$2.extra.IKeybindingService);
16098
16199
  keybindingService.setUserKeybindings(bindings);
16099
16200
  }
16100
16201
  function updateEditorKeybindingsMode(editor) {