When the config screen of the Blockly node is closed, we get the number of syntax errors in the generated Javascript code. The number of errors is stored in node.noerr, which will trigger (via a validator function) a red triangle in the flow editor.
However currently this does not work correctly, when we don't navigate to the "Generated javascript" tabsheet. Indeed the errors are based on the javascript code that was already available when the config screen was opened, not by the current javascript code. So when we close the config screen and open it again, then the error only becomes visible:
Reason is that the setValue of the hidden Ace/Monaco editor seems not to work, so getAnnotations returns the errors in the original javascript code.
I changed the mechanism based on this StackOverflow discussion, so we don't use getAnnotations anymore. Because using a hidden code editor for this purpose, is in fact cheating.
Then it works fine:
Thanks to @Steve-Mcl for pointing me towards this direction ...
When the config screen of the Blockly node is closed, we get the number of syntax errors in the generated Javascript code. The number of errors is stored in node.noerr, which will trigger (via a validator function) a red triangle in the flow editor.
However currently this does not work correctly, when we don't navigate to the "Generated javascript" tabsheet. Indeed the errors are based on the javascript code that was already available when the config screen was opened, not by the current javascript code. So when we close the config screen and open it again, then the error only becomes visible:
Reason is that the
setValue
of the hidden Ace/Monaco editor seems not to work, sogetAnnotations
returns the errors in the original javascript code.I changed the mechanism based on this StackOverflow discussion, so we don't use
getAnnotations
anymore. Because using a hidden code editor for this purpose, is in fact cheating.Then it works fine:
Thanks to @Steve-Mcl for pointing me towards this direction ...