1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #4195 from node-red/4191-function-error-badge-not-shown

fix function node error badge not shown
This commit is contained in:
Nick O'Leary 2023-05-26 10:29:23 +01:00 committed by GitHub
commit 47a945d92e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1168,19 +1168,19 @@ RED.editor.codeEditor.monaco = (function() {
// Warning: 4 // Warning: 4
// Error: 8 // Error: 8
ed.getAnnotations = function getAnnotations() { ed.getAnnotations = function getAnnotations() {
var aceCompatibleMarkers = []; let aceCompatibleMarkers;
try { try {
var _model = ed.getModel(); const _model = ed.getModel();
if (_model !== null) { if (_model !== null) {
var id = _model._languageId; // e.g. javascript const id = _model.getLanguageId(); // e.g. javascript
var ra = _model._associatedResource.authority; //e.g. model const ra = _model.uri.authority; // e.g. model
var rp = _model._associatedResource.path; //e.g. /18 const rp = _model.uri.path; // e.g. /18
var rs = _model._associatedResource.scheme; //e.g. inmemory const rs = _model.uri.scheme; // e.g. inmemory
var modelMarkers = monaco.editor.getModelMarkers(_model) || []; const modelMarkers = monaco.editor.getModelMarkers(_model) || [];
var thisEditorsMarkers = modelMarkers.filter(function (marker) { const thisEditorsMarkers = modelMarkers.filter(function (marker) {
var _ra = marker.resource.authority; //e.g. model const _ra = marker.resource.authority; // e.g. model
var _rp = marker.resource.path; //e.g. /18 const _rp = marker.resource.path; // e.g. /18
var _rs = marker.resource.scheme; //e.g. inmemory const _rs = marker.resource.scheme; // e.g. inmemory
return marker.owner == id && _ra === ra && _rp === rp && _rs === rs; return marker.owner == id && _ra === ra && _rp === rp && _rs === rs;
}) })
aceCompatibleMarkers = thisEditorsMarkers.map(function (marker) { aceCompatibleMarkers = thisEditorsMarkers.map(function (marker) {