Coming in 8.1.18: Script editor improvements

PSA to anyone stumbling on to this thread.

I've confirmed a bug with support introduced somewhere in 8.1 that will break find and replace if you use the word "Arguments" in your doc string (triple speech marks).
Apparently this clashes with the inbuild Ignition function documentation and confuses the parser.

So avoid using that like i did, and stick to the shorter version of "Args"... :smile: :upside_down_face:

Now to find all the places i've done it amongst hundreds of windows..


The good news is that it only affects Vision extension functions in particular. A bad choice when we first introduced their serialization that was basically unavoidable when extracting them back out again to upgrade, unfortunately.


Will it still be a problem if there is another def block inside the main extension function?
Like this for example?

No. Only a triple-double-quoted bare string, on the very first line, containing the literal string Arguments: will cause the issue. Break any of those conditions and you're fine.

1 Like

Docstrings per Google style
It will be amazing if you clould add a context menu on right click on function to generate this docstrings template !


Note: Any really big stuff will have to wait until after 8.3.0, so don't expect a lot on this topic for a while. But, a dependency bump in the bundled library did get a few little niceties I think you'll all appreciate; these will be in the nightly tomorrow and in 8.1.38 full:

  1. "Smart" quotes - single and double quotes will automatically surround the selection, and nicely 'overtype' at the end.
    Kapture 2024-01-24 at 10.27.53
  2. "Smart" square brackets and curly braces - much the same as quotes, for automatic surround of a given selection.
    Kapture 2024-01-24 at 10.29.06
  3. Proper automatic indentation. This one is something I had so baked into my brain I didn't even realize it was missing - I literally always do a colon -> newline -> tab automatically, so now I end up with two tabs when editing a script in the designer :laughing:
    Kapture 2024-01-24 at 10.33.55
  4. No flashy GIF, but I tweaked the paste handling a little bit to hopefully help address complaints like Copy-Pasting Script in Ignition 8.1.32 Results in Indent/Dedent Errors :crossed_fingers:


This is awesome!

--runs to recommend upgrade solely for this function--


I actually did just that after reading the patch note !


I do this all the time in PyCharm because of this haha

Looking forward to upgrading! In a few years' time, knowing our end users :roll_eyes:


yes please! that looks mint

Are there any plans to autocomplete imported java libraries that are not 'system.' or self written scripts?

Eventually, maybe.

Two big complications:
The first, understanding import statements requires a constant AST parse of your local code (which will often be syntactically wrong for some amount of time), so you have to do smart caching and best effort stuff. Not at all impossible; every IDE does it, but it's a big effort.
The second: Java reflection gives you a lot at runtime, but it's really not as useful as you might hope. You can get arguments, return types, exceptions, etc - but no argument names, no method or class documentation, etc. You'd also have to constantly round trip with the gateway to ask it for reflection information on any gateway scoped imports, since they won't be available to the designer.