Skip to content

Script IDE 1.22.0

Choose a tag to compare

@nigelgwork nigelgwork released this 07 Sep 06:38
· 20 commits to main since this release

Authoring features, and one fix that predates them.

Snippets

18 tab-stop templates, offered through ordinary completion. The tag-change one binds tagPath, initialChange, currentValue and previousValue — the names an Ignition tag-change script actually gets, not an event object that does not exist there.

Imports

Organise imports groups, sorts and drops the unused ones. Suggest an import offers one for an unresolved name. The organiser skips the module docstring — counting it as code made the feature a silent no-op on nearly every well-written file.

Completions from the running gateway

Tag paths inside a string literal, browsed live from the tag provider. DB schema — table, then column — read from the connection's own DatabaseMetaData. Both behind a short TTL cache, so typing does not hammer the gateway.

Style lints

Seven checks, over the AST rather than over the text: bare except:, a mutable default argument, == None, is with a literal, an asserted tuple, a duplicate dict key, and mixed indentation. Structural checking is why == None inside a docstring that explains why not to write == None is not a finding. All warnings; none of them stops anything running.

Console

cprint(text, colour) and jsonPrint(value), with an ANSI parser in the web console so colour from any library renders instead of printing as escape codes.

Fixed: a coding declaration disabled every static feature in the file

A file starting # -*- coding: utf-8 -*- was a syntax error to this module. Python 2 refuses a coding declaration in a unicode source, and everything here parses from a StringReader. The header had already done its job before the bytes arrived as text, so it meant nothing — but the parse failed, and with it the outline, go-to-definition, the lints, and test discovery, which skipped such a module entirely.

It had two halves in different places: the parser, and the test runner's own compile() of source seeded through Py.java2py. The console path takes a byte str and was never affected. The live suite asserts all three states, so the half that always worked does not get "fixed" later.


Signed module, Ignition 8.3.0+. 625 gateway tests, 731 web tests, 16 live suites (409 checks) against a running 8.3.8 gateway.