forked from TypeFox/monaco-languageclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.ts
More file actions
20 lines (17 loc) · 1.08 KB
/
main.ts
File metadata and controls
20 lines (17 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* --------------------------------------------------------------------------------------------
* Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { createDefaultJsonContent, createJsonEditor, createUrl, createWebSocketAndStartClient, performInit } from '../../common/client-commons.js';
import { buildWorkerDefinition } from 'monaco-editor-workers';
buildWorkerDefinition('../../node_modules/monaco-editor-workers/dist/workers/', new URL('', window.location.href).href, false);
export const startJsonClient = async () => {
// use the same common method to create a monaco editor for json
await performInit(true);
await createJsonEditor({
htmlElement: document.getElementById('container')!,
content: createDefaultJsonContent()
});
const url = createUrl('localhost', 30000, '/sampleServer');
createWebSocketAndStartClient(url);
};