Class ScriptLibrary
java.lang.Object
com.inductiveautomation.ignition.designer.ai.tool.ScriptLibrary
A navigable view over a tree of script symbols in
CompletionDescriptor form: named roots
whose MODULE-kind attributes are branches (packages,
script modules) and whose remaining attributes and methods are leaves (functions, classes,
values). Both the platform system.* library and the project's user script library fit
this shape.
A library is a fixed view of the roots it is constructed with. Construction is cheap, so a caller tracking a live source builds a new library per operation rather than holding one.
-
Constructor Summary
ConstructorsConstructorDescriptionScriptLibrary(Map<String, com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> roots) -
Method Summary
Modifier and TypeMethodDescriptionOptional<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> findSymbol(String path) Resolves a dotted path (e.g.Lists every leaf symbol in the library, one fully-qualified dotted path per line.Collection<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> The members visible when browsing atbrowsePath: the library's roots for the empty path, otherwise the methods and attributes of the type the path navigates to.static ScriptLibraryof(PackageTreeNode node, String location) Builds a library whose roots arenode's child packages together withnode's own attribute and method members.
-
Constructor Details
-
ScriptLibrary
-
-
Method Details
-
of
Builds a library whose roots arenode's child packages together withnode's own attribute and method members. Each child package reportslocationas its own location — the dotted namenodeis reached by (e.g."system"), or""for a synthetic tree root with no addressable name of its own. Nested packages inherit their immediate parent's name, so every symbol reports the package it sits directly under. -
listPaths
Lists every leaf symbol in the library, one fully-qualified dotted path per line. Functions are suffixed(), classes are annotated(class), and deprecated symbols are annotated(deprecated); branches contribute path segments but no lines of their own. Roots and members are emitted in name order. -
findSymbol
public Optional<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> findSymbol(String path) Resolves a dotted path (e.g.system.tag.readBlockingormyUtils.helper.MyClass.method) to the symbol it addresses, navigating through packages, script modules, and class definitions alike.- Returns:
- the descriptor at
path, or empty when any segment does not resolve.
-
members
public Collection<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> members(String browsePath) The members visible when browsing atbrowsePath: the library's roots for the empty path, otherwise the methods and attributes of the type the path navigates to. Returns an empty collection when the path does not resolve.
-