You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get makers to have some aside validation but somehow it does not exist on the editor object.
However, it exists in the editor API, any solution or explanation would be useful
Using @monaco-editor/loader v 1.4.0
Thanks
The text was updated successfully, but these errors were encountered:
@suren-atoyan sure, as you see here, only onDidChangeModelContent() event is working as expected
I have tried different ways, but if I check what is inside the object, those methods do not exist
loader.init().then((monaco: Monaco) => {
this.monacoEditor = monaco.editor.create(this.editorElement.nativeElement, {
value: this.cssString,
language: 'css',
theme: 'vs',
});
this.monacoEditor.onDidChangeModelContent(() => {
// HERE IT WORKS
});
this.monacoEditor.getModelMarkers(() => {
// DOES NOT WORK
});
this.monacoEditor.onDidChangeMarkers(() => {
// DOES NOT WORK
});
});
UPDATE: Found a way, how it supposed to work
this.monacoEditor.editor.onDidChangeMarkers(() => {
// We have to provide an owner to getModelMarkers(), that is doing a job
const updatedMarkers = monaco.editor.getModelMarkers({ owner: 'css' });
console.log('Updated markers:', updatedMarkers);
});
I am trying to get makers to have some aside validation but somehow it does not exist on the
editor
object.However, it exists in the editor API, any solution or explanation would be useful
Using @monaco-editor/loader v 1.4.0
Thanks
The text was updated successfully, but these errors were encountered: