-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Description
I have case where I need to update the linting error messages from a button click outside the codeMirror component. Although values are updating it wont show up on the editor until i manually update the text inside the editor by typing.
I tried following
- refresh editor using instance
- updating value prop: value get's updated but linting wont show up
- calling forceRefresh() method on component
{
"mode": "text/x-hive",
"indentWithTabs": false,
"lineWrapping": true,
"lineNumbers": true,
"gutters": [
"CodeMirror-lint-markers"
],
"extraKeys": {
"Ctrl-Space": "autocomplete",
"Ctrl-/": "toggleComment"
},
"indentUnit": 2,
"theme": "default",
"matchBrackets": true,
"autoCloseBrackets": true,
"highlightSelectionMatches": true,
"cursorBlinkRate": 530,
"lint": {
"async": true,
"delay": 1000,
"getAnnotations" : (text, onComplete, _, editor) => {…}
},
"tabSize": 2
}
this is the option object i am passing in,
(text: string, onComplete, _, editor) => {
if ((text || '').length === 0) {
return;
}
function complete(options: []) {
console.log("OPTIONS inside", options, suggetions)
onComplete(options.concat(suggetions));
editor?.refresh();
}
console.log("GetAnnotationCalled", suggetions)
getSqlLintAnnotationsDebounced(text, language, complete);
}
Metadata
Metadata
Assignees
Labels
No labels
