When I call toggleHighlightOfEditableAreas right after initializing the component, it throws an exception. However, if I wrap the call in a setTimeout, the exception does not occur.
this._editorInstance = monaco.editor.create(element, options);
this._constrainedInstance = constrainedEditor(monaco);
this._constrainedInstance.initializeIn(this._editorInstance);
this._editorInstance.getModel().toggleHighlightOfEditableAreas();
// this._editorInstance.getModel(...).toggleHighlightOfEditableAreas is not a function
Is there an asynchronous process during initialization that I should be awaiting before calling this method?