@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.
- package/dist/Groovy2.js +28 -0
- package/dist/features/htmlContribution.d.ts +3 -0
- package/dist/features/htmlContribution.js +104 -0
- package/dist/features/mutualizedExtensionConfigurations.d.ts +1 -0
- package/dist/features/mutualizedExtensionConfigurations.js +4857 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1210 -0
- package/dist/languages/extensions/configurationLoader.d.ts +20 -2
- package/dist/languages/index.d.ts +2 -1
- package/dist/languages/textMate/index.d.ts +1 -1
- package/dist/main.js +33 -1218
- package/dist/markdown-basics-markdown.js +18 -0
- package/dist/services/CustomFoldingRulesLanguageConfigurationService.d.ts +4 -0
- package/dist/verilog-systemverilog.js +140 -327
- package/dist/verilog2.js +65 -56
- package/dist/vscode-R-rmd.js +2 -2
- package/package.json +1 -1
- package/stats.html +1 -1
- package/dist/COBOL Copybook2.js +0 -2017
- package/dist/COBOL2.js +0 -2017
- package/dist/SQL.plist.js +0 -482
- package/dist/bsv2.js +0 -49
- package/dist/c2.js +0 -18
- package/dist/coffeescript2.js +0 -18
- package/dist/configuration/hack.d.ts +0 -2
- package/dist/cpp2.js +0 -18
- package/dist/csharp2.js +0 -508
- package/dist/cssContribution.js +0 -10
- package/dist/diet3.js +0 -92
- package/dist/extensionConfigurations.js +0 -9475
- package/dist/fsharp2.js +0 -18
- package/dist/groovy2.js +0 -229
- package/dist/html (eex).js +0 -31
- package/dist/htmlContribution.js +0 -10
- package/dist/javascript2.js +0 -196
- package/dist/javascriptreact2.js +0 -196
- package/dist/jsonContribution.js +0 -78
- package/dist/kotlin2.js +0 -117
- package/dist/kotlinscript2.js +0 -117
- package/dist/languages/monarch/list.d.ts +0 -7
- package/dist/languages/textMate/TextMateTokensProvider.d.ts +0 -11
- package/dist/markdown-basics.js +0 -103
- package/dist/markdown2.js +0 -103
- package/dist/pgsql-sql.js +0 -21
- package/dist/pgsql.js +0 -21
- package/dist/php2.js +0 -265
- package/dist/powershell2.js +0 -18
- package/dist/r.tmLanguage.js +0 -572
- package/dist/reason2.js +0 -100
- package/dist/services/functional.d.ts +0 -1
- package/dist/services/lyfecycle.d.ts +0 -13
- package/dist/sql2.js +0 -21
- package/dist/swift2.js +0 -183
- package/dist/systemverilog2.js +0 -208
- package/dist/tcl2.js +0 -151
- package/dist/typescript-basics.js +0 -312
- package/dist/typescript2.js +0 -312
- package/dist/typescriptContribution.js +0 -36
- package/dist/typescriptreact2.js +0 -312
- package/dist/vb2.js +0 -88
package/dist/Groovy2.js
ADDED
|
@@ -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,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
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|