This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathverify_alt.html
62 lines (55 loc) · 2.34 KB
/
verify_alt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Verify: Monaco Editor Wrapper: Diff</title>
<!--
<link rel="stylesheet" href="./libs/monaco-editor-wrapper/assets/style.css">
-->
</head>
<body>
<div id="monaco-editor-root" style="height: 80vh;"></div>
<script type="module">
import getKeybindingsServiceOverride from '@codingame/monaco-vscode-keybindings-service-override';
import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js';
import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution.js';
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution.js';
import { MonacoEditorLanguageClientWrapper } from 'monaco-editor-wrapper';
import { addMonacoStyles } from 'monaco-editor-wrapper/styles';
import { buildWorkerDefinition } from 'monaco-editor-workers';
buildWorkerDefinition('../../../node_modules/monaco-editor-workers/dist/workers', import.meta.url, false);
// alternatively use the stylesheet link from the head
addMonacoStyles('monaco-styles-helper');
const wrapper = new MonacoEditorLanguageClientWrapper();
const startWrapper = async () => {
const wrapperConfig = {
wrapperConfig: {
useVscodeConfig: false,
serviceConfig: {
userServices: {
...getKeybindingsServiceOverride(),
},
debugLogging: true
},
editorAppConfig: {
$type: 'classic',
languageId: 'javascript',
useDiffEditor: true,
theme: 'vs-dark',
codeOriginal: `function logOriginal() {
console.log('Hello original editor!');
};`,
code: `function logModified() {
console.log('Hello modified editor!');
};`
}
}
};
await wrapper.initAndStart(wrapperConfig, document.getElementById('monaco-editor-root'));
console.log('wrapper was started.');
};
startWrapper();
</script>
</body>
</html>