Coming in 8.1.18: Script editor improvements

Really, really, REALLY don't import from project library scripts. There be dragons (race conditions, especially). Really.

2 Likes

Okay, I did not know that, thanks!

Why is that and why is that not something easy to fix?

I've helped narrow it down for IA, but any fix has a chance to break existing code. :frowning_face:

And the problem point I found might not be the only contributor. :grimacing: :man_shrugging:

2 Likes

Sounds sketchy! I'll avoid importing project libraries then.

Ctrl + F brings up this toolbar:

Ctrl + R brings up this toolbar, with the same options:

It's definitely not as user friendly as other editors, but if you highlight a selection, then press Ctrl + F, then search, all matching strings will be highlighted with the default settings in the search dialog:

All that said,

No, not 8.3.0 at least.
Your other two bullet points (awareness of imports, awareness of class instances) require actually parsing the local AST, which so far the script editors have never had to do. Definitely doable, but non-trivial, especially with the franken-environment we run Ignition in.

At the dev panel at this year's ICC, Carl (our CTO) mentioned that one of our probable plans for Ignition 8.5 or whatever the next version is will be first party support for external code editors via LSP (mentioned further up in this thread). Basically - you work on your views/windows/alarm pipelines/etc in the designer directly, but then have the option to edit your scripts in an external code editor like VS Code directly, making changes and saving them as regular files which then immediately apply back inside Ignition.

That would be our ultimate goal, as an "end run" around the fact that it's just not possible for Inductive Automation, even if the entire company was focused on it, to make a code editor as good as existing alternatives with significant more resources focused on the task.

9 Likes

Love this idea. :+1: :+1:

A feature I would love to see in the Script Console is an 'auto-scroll' function - either by a checkbox, or automagically, whereby:
If the last line of the Interactive Interpreter is currently displayed (scroll bar at bottom?), then enable auto-scroll. If last line not displayed, then disable auto-scroll.

If printing thousands of lines (debugging), it would be handy to always see the most-recent print statement UNLESS I grab the scroll bar and move it up to see previous prints. At that point, it's handy to freeze the output window. A checkbox would get the job done in either case.

1 Like

Thanks for you reply Paul!

I did not know about this one! The other ones I use, but I don't find them as quick and easy as real IDE's.

I'm so excited to see this play out!

2 Likes