Editor - colored keywords

In Editor, most reserved keywords are automatically colored.

But, there are some that are (not yet) colored, such as: hasOwnProperty, trim (msg.payload.trim ()) etc.

What is the possibility of them being colored automatically ?

The coloring ability is dependent on the ACE editor which is embedded within Node-RED. I doubt it makes sense for the devs to start modifying it. Naturally only Nick/Dave can answer this.

Compared to a full-featured IDE or rich editors like VSCode with a language server and all that, ACE can only make basic assumptions about the semantics and types in the script.

One should also keep in mind that hasOwnProperty and trim aren't JS language keywords, those are just regular functions on certain objects. And since msg.payload could be anything, trim() won't get any special highlighting.

So I doubt there will ever be any 'advanced' highlighting (or advanced code completion) in ACE.

A forum member tried to integrate the Monaco editor: Using Monaco editor - monaco branch now in fork
From what I saw it would offer some more features regarding all that, but that is all just a proof-of-concept at the moment.

1 Like