Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/monaco/core.js
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as monaco from 'monaco-editor-core';
7
8
self.MonacoEnvironment = {
9
getWorkerUrl: function (moduleId, label) {
10
return './editorWebWorkerMain.bundle.js';
11
}
12
};
13
14
window.instance = monaco.editor.create(document.getElementById('container'), {
15
value: [
16
'from banana import *',
17
'',
18
'class Monkey:',
19
' # Bananas the monkey can eat.',
20
' capacity = 10',
21
' def eat(self, N):',
22
' \'\'\'Make the monkey eat N bananas!\'\'\'',
23
' capacity = capacity - N*banana.size',
24
'',
25
' def feeding_frenzy(self):',
26
' eat(9.25)',
27
' return "Yum yum"',
28
].join('\n'),
29
language: 'python'
30
});
31
32