Fix monaco errors
This commit is contained in:
parent
93f356ec26
commit
5d4dc81fdf
1 changed files with 7 additions and 22 deletions
|
|
@ -1,23 +1,6 @@
|
|||
import { action } from '@ember/object';
|
||||
import Component from '@glimmer/component';
|
||||
import * as monaco from 'monaco-editor';
|
||||
|
||||
window.MonacoEnvironment = {
|
||||
getWorker(_, label) {
|
||||
if (label === 'editorWorkerService') {
|
||||
return new Worker(
|
||||
new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url)
|
||||
);
|
||||
} else if (label === 'json') {
|
||||
return new Worker(
|
||||
new URL(
|
||||
'monaco-editor/esm/vs/language/json/json.worker',
|
||||
import.meta.url
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
||||
|
||||
export default class MonacoEditorComponent extends Component {
|
||||
@action
|
||||
|
|
@ -25,13 +8,15 @@ export default class MonacoEditorComponent extends Component {
|
|||
this.editor = monaco.editor.create(el, {
|
||||
value: this.args.value,
|
||||
language: this.args.language,
|
||||
// scrollBeyondLastLine: false,
|
||||
// wordWrap: 'on',
|
||||
// wrappingStrategy: 'advanced',
|
||||
minimap: {
|
||||
enabled: false,
|
||||
},
|
||||
// overviewRulerLanes: 0,
|
||||
});
|
||||
}
|
||||
|
||||
willDestroy() {
|
||||
this.editor?.dispose();
|
||||
|
||||
super.willDestroy(...arguments);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue