monaco-languageclient-examples 6.6.0 → 6.6.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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeLoader.d.ts","sourceRoot":"","sources":["../../src/langium/localeLoader.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,qBAsBvB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export const loadLocales = async () => {
|
|
6
|
+
const locale = new URLSearchParams(window.location.search).get('locale');
|
|
7
|
+
const localeLoader = {
|
|
8
|
+
de: async () => {
|
|
9
|
+
await import('@codingame/monaco-vscode-language-pack-de');
|
|
10
|
+
},
|
|
11
|
+
es: async () => {
|
|
12
|
+
await import('@codingame/monaco-vscode-language-pack-es');
|
|
13
|
+
},
|
|
14
|
+
fr: async () => {
|
|
15
|
+
await import('@codingame/monaco-vscode-language-pack-fr');
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
if (locale != null) {
|
|
19
|
+
const loader = localeLoader[locale];
|
|
20
|
+
if (loader != null) {
|
|
21
|
+
await loader();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.error(`Unknown locale ${locale}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=localeLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeLoader.js","sourceRoot":"","sources":["../../src/langium/localeLoader.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;IAClC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACzE,MAAM,YAAY,GAAiD;QAC/D,EAAE,EAAE,KAAK,IAAI,EAAE;YACX,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;QACD,EAAE,EAAE,KAAK,IAAI,EAAE;YACX,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;QACD,EAAE,EAAE,KAAK,IAAI,EAAE;YACX,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;QAC9D,CAAC;KACJ,CAAC;IAEF,IAAI,MAAM,IAAI,IAAI,EAAE;QAChB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,MAAM,IAAI,IAAI,EAAE;YAChB,MAAM,MAAM,EAAE,CAAC;SAClB;aAAM;YACH,OAAO,CAAC,KAAK,CAAC,kBAAkB,MAAM,EAAE,CAAC,CAAC;SAC7C;KACJ;AACL,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monaco-languageclient-examples",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.1",
|
|
4
4
|
"description": "Monaco Language client examples",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TypeFox GmbH",
|
|
@@ -43,24 +43,28 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@codingame/monaco-vscode-configuration-service-override": "~1.83.
|
|
47
|
-
"@codingame/monaco-vscode-editor-service-override": "~1.83.
|
|
48
|
-
"@codingame/monaco-vscode-files-service-override": "~1.83.
|
|
49
|
-
"@codingame/monaco-vscode-json-default-extension": "~1.83.
|
|
50
|
-
"@codingame/monaco-vscode-keybindings-service-override": "~1.83.
|
|
51
|
-
"@codingame/monaco-vscode-python-default-extension": "~1.83.
|
|
52
|
-
"@codingame/monaco-vscode-textmate-service-override": "~1.83.
|
|
53
|
-
"@codingame/monaco-vscode-theme-defaults-default-extension": "~1.83.
|
|
54
|
-
"@codingame/monaco-vscode-theme-service-override": "~1.83.
|
|
46
|
+
"@codingame/monaco-vscode-configuration-service-override": "~1.83.3",
|
|
47
|
+
"@codingame/monaco-vscode-editor-service-override": "~1.83.3",
|
|
48
|
+
"@codingame/monaco-vscode-files-service-override": "~1.83.3",
|
|
49
|
+
"@codingame/monaco-vscode-json-default-extension": "~1.83.3",
|
|
50
|
+
"@codingame/monaco-vscode-keybindings-service-override": "~1.83.3",
|
|
51
|
+
"@codingame/monaco-vscode-python-default-extension": "~1.83.3",
|
|
52
|
+
"@codingame/monaco-vscode-textmate-service-override": "~1.83.3",
|
|
53
|
+
"@codingame/monaco-vscode-theme-defaults-default-extension": "~1.83.3",
|
|
54
|
+
"@codingame/monaco-vscode-theme-service-override": "~1.83.3",
|
|
55
|
+
"@codingame/monaco-vscode-language-pack-de": "~1.83.3",
|
|
56
|
+
"@codingame/monaco-vscode-language-pack-es": "~1.83.3",
|
|
57
|
+
"@codingame/monaco-vscode-language-pack-fr": "~1.83.3",
|
|
55
58
|
"express": "~4.18.2",
|
|
56
59
|
"langium": "~2.0.2",
|
|
57
60
|
"langium-statemachine-dsl": "~2.0.0",
|
|
58
61
|
"monaco-editor-workers": "~0.44.0",
|
|
59
|
-
"monaco-languageclient": "~6.6.
|
|
62
|
+
"monaco-languageclient": "~6.6.1",
|
|
60
63
|
"pyright": "~1.1.330",
|
|
61
64
|
"react": "~18.2.0",
|
|
62
65
|
"react-dom": "~18.2.0",
|
|
63
66
|
"request-light": "~0.7.0",
|
|
67
|
+
"vscode": "npm:@codingame/monaco-vscode-api@>=1.83.3 <1.84.0",
|
|
64
68
|
"vscode-json-languageservice": "~5.3.7",
|
|
65
69
|
"vscode-languageserver": "~8.1.0",
|
|
66
70
|
"vscode-uri": "~3.0.8",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
|
|
6
|
+
export const loadLocales = async () => {
|
|
7
|
+
const locale = new URLSearchParams(window.location.search).get('locale');
|
|
8
|
+
const localeLoader: Partial<Record<string, () => Promise<void>>> = {
|
|
9
|
+
de: async () => {
|
|
10
|
+
await import('@codingame/monaco-vscode-language-pack-de');
|
|
11
|
+
},
|
|
12
|
+
es: async () => {
|
|
13
|
+
await import('@codingame/monaco-vscode-language-pack-es');
|
|
14
|
+
},
|
|
15
|
+
fr: async () => {
|
|
16
|
+
await import('@codingame/monaco-vscode-language-pack-fr');
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (locale != null) {
|
|
21
|
+
const loader = localeLoader[locale];
|
|
22
|
+
if (loader != null) {
|
|
23
|
+
await loader();
|
|
24
|
+
} else {
|
|
25
|
+
console.error(`Unknown locale ${locale}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
package/statemachine_client.html
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
<h2>Client & Statemachine DSL Web Worker Language Server Example</h2>
|
|
12
12
|
<div id="container" style="width:800px;height:600px;border:1px solid grey"></div>
|
|
13
13
|
<script type="module">
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import { loadLocales } from "./src/langium/localeLoader.ts";
|
|
15
|
+
await loadLocales();
|
|
16
|
+
const { startStatemachineClient } = await import("./src/langium/statemachineClient.ts");
|
|
17
|
+
await startStatemachineClient();
|
|
16
18
|
</script>
|
|
17
19
|
</body>
|
|
18
20
|
|