@codingame/monaco-editor-wrapper 1.7.0 → 1.9.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 (60) hide show
  1. package/dist/Groovy2.js +28 -0
  2. package/dist/features/htmlContribution.d.ts +3 -0
  3. package/dist/features/htmlContribution.js +104 -0
  4. package/dist/features/mutualizedExtensionConfigurations.d.ts +1 -0
  5. package/dist/features/mutualizedExtensionConfigurations.js +4857 -0
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +1210 -0
  8. package/dist/languages/extensions/configurationLoader.d.ts +20 -2
  9. package/dist/languages/index.d.ts +2 -1
  10. package/dist/languages/textMate/index.d.ts +1 -1
  11. package/dist/main.js +33 -1218
  12. package/dist/markdown-basics-markdown.js +18 -0
  13. package/dist/services/CustomFoldingRulesLanguageConfigurationService.d.ts +4 -0
  14. package/dist/verilog-systemverilog.js +140 -327
  15. package/dist/verilog2.js +65 -56
  16. package/dist/vscode-R-rmd.js +2 -2
  17. package/package.json +1 -1
  18. package/stats.html +1 -1
  19. package/dist/COBOL Copybook2.js +0 -2017
  20. package/dist/COBOL2.js +0 -2017
  21. package/dist/SQL.plist.js +0 -482
  22. package/dist/bsv2.js +0 -49
  23. package/dist/c2.js +0 -18
  24. package/dist/coffeescript2.js +0 -18
  25. package/dist/configuration/hack.d.ts +0 -2
  26. package/dist/cpp2.js +0 -18
  27. package/dist/csharp2.js +0 -508
  28. package/dist/cssContribution.js +0 -10
  29. package/dist/diet3.js +0 -92
  30. package/dist/extensionConfigurations.js +0 -9475
  31. package/dist/fsharp2.js +0 -18
  32. package/dist/groovy2.js +0 -229
  33. package/dist/html (eex).js +0 -31
  34. package/dist/htmlContribution.js +0 -10
  35. package/dist/javascript2.js +0 -196
  36. package/dist/javascriptreact2.js +0 -196
  37. package/dist/jsonContribution.js +0 -78
  38. package/dist/kotlin2.js +0 -117
  39. package/dist/kotlinscript2.js +0 -117
  40. package/dist/languages/monarch/list.d.ts +0 -7
  41. package/dist/languages/textMate/TextMateTokensProvider.d.ts +0 -11
  42. package/dist/markdown-basics.js +0 -103
  43. package/dist/markdown2.js +0 -103
  44. package/dist/pgsql-sql.js +0 -21
  45. package/dist/pgsql.js +0 -21
  46. package/dist/php2.js +0 -265
  47. package/dist/powershell2.js +0 -18
  48. package/dist/r.tmLanguage.js +0 -572
  49. package/dist/reason2.js +0 -100
  50. package/dist/services/functional.d.ts +0 -1
  51. package/dist/services/lyfecycle.d.ts +0 -13
  52. package/dist/sql2.js +0 -21
  53. package/dist/swift2.js +0 -183
  54. package/dist/systemverilog2.js +0 -208
  55. package/dist/tcl2.js +0 -151
  56. package/dist/typescript-basics.js +0 -312
  57. package/dist/typescript2.js +0 -312
  58. package/dist/typescriptContribution.js +0 -36
  59. package/dist/typescriptreact2.js +0 -312
  60. package/dist/vb2.js +0 -88
@@ -0,0 +1,28 @@
1
+ var Groovy = [
2
+ {
3
+ "type": "object",
4
+ "description": "Groovy configuration",
5
+ "properties": {
6
+ "groovy.java.home": {
7
+ "type": [
8
+ "string",
9
+ "null"
10
+ ],
11
+ "default": null,
12
+ "description": "Specifies the folder path to the JDK. Use this setting if the extension cannot find Java automatically.",
13
+ "scope": 3
14
+ },
15
+ "groovy.classpath": {
16
+ "type": "array",
17
+ "default": null,
18
+ "description": "Specifies additional entries to add to the classpath. May contain both folders and individual .jar files.",
19
+ "items": {
20
+ "type": "string"
21
+ },
22
+ "scope": 3
23
+ }
24
+ }
25
+ }
26
+ ];
27
+
28
+ export { Groovy as default };
@@ -1 +1,4 @@
1
1
  import 'monaco-editor/esm/vs/language/html/monaco.contribution';
2
+ /**
3
+ * End autoclosing html tags
4
+ */
@@ -1,4 +1,6 @@
1
+ import * as monaco from 'monaco-editor/esm/vs/editor/edcore.main';
1
2
  import 'monaco-editor/esm/vs/language/html/monaco.contribution';
3
+ import { r as registerConfigurations, g as getConfiguration, o as onConfigurationChanged } from '../index.js';
2
4
  import { r as registerWorkerLoader } from '../worker.js';
3
5
 
4
6
  const workerLoader = async () => (await import(
@@ -8,3 +10,105 @@ const workerLoader = async () => (await import(
8
10
  registerWorkerLoader('html', workerLoader);
9
11
  registerWorkerLoader('handlebars', workerLoader);
10
12
  registerWorkerLoader('razor', workerLoader);
13
+ /**
14
+ * Start autoclosing html tags
15
+ * Inspired by https://github.com/microsoft/monaco-editor/issues/221
16
+ * and https://github.com/microsoft/vscode/blob/5943dac8ba32df1963a1760c660b3f16f5fcdc51/extensions/html-language-features/client/src/autoInsertion.ts
17
+ */
18
+
19
+ registerConfigurations([{
20
+ id: 'html',
21
+ order: 20,
22
+ type: 'object',
23
+ title: 'HTML',
24
+ properties: {
25
+ 'html.autoClosingTags': {
26
+ type: 'boolean',
27
+ scope: monaco.extra.ConfigurationScope.RESOURCE,
28
+ default: true,
29
+ description: 'Enable/disable autoclosing of HTML tags.'
30
+ }
31
+ }
32
+ }]);
33
+ let autoClosingTags = getConfiguration(undefined, 'html.autoClosingTags');
34
+ onConfigurationChanged(e => {
35
+ if (e.affectsConfiguration('html.autoClosingTags')) {
36
+ autoClosingTags = getConfiguration(undefined, 'html.autoClosingTags');
37
+ }
38
+ });
39
+
40
+ function autoCloseHtmlTags(editor) {
41
+ const disposableStore = new monaco.DisposableStore();
42
+ let timeout;
43
+ disposableStore.add({
44
+ dispose: () => {
45
+ if (timeout != null) {
46
+ window.clearTimeout(timeout);
47
+ }
48
+ }
49
+ });
50
+ disposableStore.add(editor.onDidChangeModelContent(e => {
51
+ if (timeout != null) {
52
+ window.clearTimeout(timeout);
53
+ timeout = undefined;
54
+ }
55
+
56
+ if (!autoClosingTags || e.isRedoing || e.isUndoing) {
57
+ return;
58
+ }
59
+
60
+ const model = editor.getModel();
61
+
62
+ if (model == null || model.getLanguageId() !== 'html') {
63
+ return;
64
+ }
65
+
66
+ timeout = window.setTimeout(() => {
67
+ for (const {
68
+ range,
69
+ rangeLength,
70
+ text
71
+ } of e.changes) {
72
+ var _untilLine$match;
73
+
74
+ if (!text.endsWith('>')) {
75
+ continue;
76
+ }
77
+
78
+ const untilLine = model.getValueInRange({
79
+ startLineNumber: 1,
80
+ startColumn: 1,
81
+ endLineNumber: range.endLineNumber,
82
+ endColumn: range.endColumn + rangeLength + 1
83
+ });
84
+ const enclosingTag = (_untilLine$match = untilLine.match(/.*<(\w+)>$/)) === null || _untilLine$match === void 0 ? void 0 : _untilLine$match[1];
85
+
86
+ if (enclosingTag == null || enclosingTag.includes('/')) {
87
+ return;
88
+ }
89
+
90
+ const newRange = new monaco.Range(range.endLineNumber, range.endColumn + rangeLength + 1, range.endLineNumber, range.endColumn + rangeLength + enclosingTag.length + 1);
91
+ const rest = model.getValueInRange(newRange);
92
+ model.applyEdits([{
93
+ range: newRange,
94
+ text: "</".concat(enclosingTag, ">").concat(rest),
95
+ forceMoveMarkers: true
96
+ }]);
97
+ }
98
+ }, 100);
99
+ }));
100
+ return disposableStore;
101
+ }
102
+
103
+ const codeEditors = monaco.extra.StandaloneServices.get(monaco.extra.ICodeEditorService).listCodeEditors();
104
+
105
+ for (const editor of codeEditors) {
106
+ autoCloseHtmlTags(editor);
107
+ }
108
+
109
+ monaco.editor.onDidCreateEditor(editor => {
110
+ autoCloseHtmlTags(editor);
111
+ });
112
+ /**
113
+ * End autoclosing html tags
114
+ */