¿Agregué los marcadores de error usando setModelMarkers cuando tenía dtaa no válidos en la validación del contenido de un contenido yaml que se muestra en monocoeditor? Pero, ¿cómo eliminar esas marcas de error si tenemos datos válidos en el editor?
monaco.editor.onDidCreateModel(function(model) { function validate() { var textToValidate = model.getValue(); // return a list of markers indicating errors to display // replace the below with your actual validation code which will build // the proper list of markers var markers = [{ severity: monaco.MarkerSeverity.Error, startLineNumber: 1, startColumn: 2, endLineNumber: 1, endColumn: 5, message: 'hi there' }]; // change mySpecialLanguage to whatever your language id is monaco.editor.setModelMarkers(model, 'mySpecialLanguage', markers); } var handle = null; model.onDidChangeContent(() => { // debounce clearTimeout(handle); handle = setTimeout(() => validate(), 500); }); validate(); }); // -- below this is the original canned example code: // Register a new languageTomada la referencia de aquí. Validación de sintaxis de un idioma personalizado en el editor de Mónaco ¿Alguien puede ayudar?