@codingame/monaco-editor-wrapper 1.1.3 → 1.2.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.
@@ -3,11 +3,11 @@ import 'monaco-editor/esm/vs/language/json/monaco.contribution';
3
3
  import * as monaco from 'monaco-editor/esm/vs/editor/edcore.main';
4
4
  import { r as registerWorkerLoader } from './worker.js';
5
5
 
6
- const schemasById = monaco.extra.Registry.as(monaco.extra.JsonContributionExtensions.JSONContribution).getSchemaContributions().schemas; // Hack because the commands are filled by a code not run in monaco-editor
6
+ const registry = monaco.extra.Registry.as(monaco.extra.JsonContributionExtensions.JSONContribution); // Hack because the commands are filled by a code not run in monaco-editor
7
7
 
8
8
  {
9
9
  const allCommands = monaco.extra.CommandsRegistry.getCommands();
10
- const keybindingsCommandSchema = schemasById['vscode://schemas/keybindings'].items.properties.command.anyOf[0];
10
+ const keybindingsCommandSchema = registry.getSchemaContributions().schemas['vscode://schemas/keybindings'].items.properties.command.anyOf[0];
11
11
  keybindingsCommandSchema.enum = Array.from(allCommands.keys());
12
12
  keybindingsCommandSchema.enumDescriptions = Array.from(allCommands.values()).map(command => {
13
13
  var _command$description;
@@ -32,44 +32,50 @@ const vimKeybindingsSchema = {
32
32
  }
33
33
  }
34
34
  };
35
- monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
36
- comments: 'ignore',
37
- validate: true,
38
- schemas: [{
39
- uri: 'vscode://schemas/settings/resourceLanguage',
40
- schema: schemasById['vscode://schemas/settings/resourceLanguage']
41
- }, {
42
- uri: 'vscode://schemas/keybindings',
43
- fileMatch: ['file:///keybindings.json'],
44
- schema: schemasById['vscode://schemas/keybindings']
45
- }, {
46
- uri: 'vscode://schemas/settings/user',
47
- fileMatch: ['file:///settings.json'],
48
- schema: {
49
- properties: _objectSpread2(_objectSpread2({}, monaco.extra.allSettings.properties), {}, {
50
- 'vim.normalModeKeyBindings': {
51
- type: 'array',
52
- description: 'Remapped keys in Normal mode.',
53
- items: vimKeybindingsSchema
54
- },
55
- 'vim.insertModeKeyBindings': {
56
- type: 'array',
57
- description: 'Remapped keys in Insert mode.',
58
- items: vimKeybindingsSchema
59
- },
60
- 'vim.visualModeKeyBindings': {
61
- type: 'array',
62
- description: 'Remapped keys in Visual mode.',
63
- items: vimKeybindingsSchema
64
- }
65
- }),
66
- patternProperties: monaco.extra.allSettings.patternProperties,
67
- additionalProperties: true,
68
- allowTrailingCommas: true,
69
- allowComments: true
70
- }
71
- }]
72
- });
35
+
36
+ function updateDiagnosticsOptions() {
37
+ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
38
+ comments: 'ignore',
39
+ validate: true,
40
+ schemas: [{
41
+ uri: 'vscode://schemas/settings/resourceLanguage',
42
+ schema: registry.getSchemaContributions().schemas['vscode://schemas/settings/resourceLanguage']
43
+ }, {
44
+ uri: 'vscode://schemas/keybindings',
45
+ fileMatch: ['file:///keybindings.json'],
46
+ schema: registry.getSchemaContributions().schemas['vscode://schemas/keybindings']
47
+ }, {
48
+ uri: 'vscode://schemas/settings/user',
49
+ fileMatch: ['file:///settings.json'],
50
+ schema: {
51
+ properties: _objectSpread2(_objectSpread2({}, monaco.extra.allSettings.properties), {}, {
52
+ 'vim.normalModeKeyBindings': {
53
+ type: 'array',
54
+ description: 'Remapped keys in Normal mode.',
55
+ items: vimKeybindingsSchema
56
+ },
57
+ 'vim.insertModeKeyBindings': {
58
+ type: 'array',
59
+ description: 'Remapped keys in Insert mode.',
60
+ items: vimKeybindingsSchema
61
+ },
62
+ 'vim.visualModeKeyBindings': {
63
+ type: 'array',
64
+ description: 'Remapped keys in Visual mode.',
65
+ items: vimKeybindingsSchema
66
+ }
67
+ }),
68
+ patternProperties: monaco.extra.allSettings.patternProperties,
69
+ additionalProperties: true,
70
+ allowTrailingCommas: true,
71
+ allowComments: true
72
+ }
73
+ }]
74
+ });
75
+ }
76
+
77
+ updateDiagnosticsOptions();
78
+ registry.onDidChangeSchema(updateDiagnosticsOptions);
73
79
 
74
80
  const workerLoader = async () => (await import(
75
81
  /* webpackChunkName: "MonacoJsonWorker" */
@@ -668,6 +668,19 @@ declare const _default: {
668
668
  };
669
669
  };
670
670
  }>;
671
+ sql: () => Promise<{
672
+ comments: {
673
+ lineComment: string;
674
+ blockComment: string[];
675
+ };
676
+ brackets: string[][];
677
+ autoClosingPairs: (string[] | {
678
+ open: string;
679
+ close: string;
680
+ notIn: string[];
681
+ })[];
682
+ surroundingPairs: string[][];
683
+ }>;
671
684
  swift: () => Promise<{
672
685
  comments: {
673
686
  lineComment: string;
@@ -1078,7 +1091,6 @@ declare const _default: {
1078
1091
  };
1079
1092
  };
1080
1093
  }>;
1081
- sql: () => Promise<{}>;
1082
1094
  scala: () => Promise<{
1083
1095
  comments: {
1084
1096
  lineComment: string;