Is there a way to add custom code completition to the javascript function. Espacially I want to define some "global" objects, constants and/or functions which I want to use in almost every node, without knowning all names.
lets say i want to define some mqtt topic names like this
let global.context.lights.kitchen = "actor/light/kitchen";
...
and in some script node i need the code completition for
Of course I could remember the variables or copy them elsewhere and paste to my nodes, but it would be very helpful, if i could configure nodered, that the function node would suggest me this variable with the code-completition.
You can add custom completions to ACE. That isn't the issue.
The question was whether you can add custom completions to the Function node - and you cannot do that today regardless of what editor component is used.
Adding auto complete to the TypedInput for flow/global types is on the to-do list. Not immediately clear how that could be extended to the Function node given the completions have to be dynamically resolved.
One of the nice(r) thing about Monaco is it understands JSdoc out of the box, so future features like this are not beyond the realms of possibility. for example, permitting a user to write to a .ts or .js file containing their desired type defs (demoed here by simply entering the JSDoc directly in the Monaco editor)...
Hi,
thanks for that information. I've also looked into the discussion about the integration of the monaco editor. It looks very promising and it could definitely be very helpful to me.
I think the demo in node red is a self-compiled-version?
Hope it will be included ...