Class ScriptLibrary

java.lang.Object
com.inductiveautomation.ignition.designer.ai.tool.ScriptLibrary

public final class ScriptLibrary extends Object
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

    Constructors
    Constructor
    Description
    ScriptLibrary(Map<String, com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> roots)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor>
    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>
    members(String browsePath)
    The members visible when browsing at browsePath: the library's roots for the empty path, otherwise the methods and attributes of the type the path navigates to.
    of(PackageTreeNode node, String location)
    Builds a library whose roots are node's child packages together with node's own attribute and method members.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScriptLibrary

      public ScriptLibrary(Map<String, com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor> roots)
  • Method Details

    • of

      public static ScriptLibrary of(PackageTreeNode node, String location)
      Builds a library whose roots are node's child packages together with node's own attribute and method members. Each child package reports location as its own location — the dotted name node is 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

      public String 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.readBlocking or myUtils.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 at browsePath: 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.