Class LibraryPromptAssist
java.lang.Object
com.inductiveautomation.ignition.designer.ai.embed.LibraryPromptAssist
- All Implemented Interfaces:
PromptAssist
- Direct Known Subclasses:
SystemLibraryPromptAssist, UserLibraryPromptAssist
Base class for
PromptAssists that browse a ScriptLibrary — a dotted-path tree of
script symbols — through the @-popup. Leaves render as PromptAssist.Option.Insert rows whose
body carries the symbol's rendered documentation. MODULE-kind branches render as PromptAssist.Option.InsertOrDrillIn rows: confirming references the package as a whole (a body listing its
direct members), expanding browses into it. Rows are ranked like the Ctrl+Space autocomplete
popup.
Package references are one level deep. A nested package appears in its parent's body as a
name, not as its own members, so referencing a.b never drags in a.b.c's contents
— the user references a.b.c directly to see inside it.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PromptAssist
PromptAssist.Option -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcallablePath(String path) Maps a browse path to the fully-qualified name a script invokes the symbol by, carried in the insert body'sPath:field.protected StringdrillInDetail(String path) Detail label for a MODULE-kind row addressingpath, also carried as its reference body'sKind:field.final Stringid()final Stringlabel()protected abstract ScriptLibrarylibrary()The library this assist browses.final CompletableFuture<List<PromptAssist.Option>> Fetch the rows to show forquery.protected @Nullable StringpackageDocumentation(com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor descriptor) The package's own documentation, carried in a package reference body'sDocumentation:field.Separator the embedded controller places between this assist'sPromptAssist.label()and its query when building the routing prefix, and that the assist itself should use inside itsPromptAssist.Option.DrillIn.nextQueryvalues.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PromptAssist
agentContext
-
Constructor Details
-
LibraryPromptAssist
- Parameters:
id- the token namespace this assist owns, perPromptAssist.id().label- the friendly chooser label, perPromptAssist.label().
-
-
Method Details
-
id
- Specified by:
idin interfacePromptAssist- Returns:
- the machine identifier owning this assist's
@<id>:token namespace. Lowercase[a-z0-9-]+, short (e.g."tag","opc"). - See Also:
-
label
- Specified by:
labelin interfacePromptAssist- Returns:
- a short friendly label for this assist to show in the UI.
-
separator
Description copied from interface:PromptAssistSeparator the embedded controller places between this assist'sPromptAssist.label()and its query when building the routing prefix, and that the assist itself should use inside itsPromptAssist.Option.DrillIn.nextQueryvalues.Default is
"/".- Specified by:
separatorin interfacePromptAssist- Returns:
- a non-empty separator string the controller uses both to recognize the routing prefix
this assist owns and to re-prefix child
PromptAssist.Option.DrillIns on the way back out.
-
options
Description copied from interface:PromptAssistFetch the rows to show forquery.- Specified by:
optionsin interfacePromptAssist- Parameters:
query- the text the user has typed past the trigger character, or thePromptAssist.Option.DrillIn.nextQueryof a row the user just selected. Empty when the user has just typed the trigger and has not yet typed anything else.- Returns:
- the rows to render. The framework discards stale results silently, so an implementation that completes after a newer query has been issued does not need to special-case the race.
-
library
The library this assist browses. Called on everyoptions(String)invocation, off the EDT; aScriptLibraryis a cheap fixed view, so implementations build one against their source's current state per call. -
drillInDetail
Detail label for a MODULE-kind row addressingpath, also carried as its reference body'sKind:field."package"unless overridden; the full dotted path is supplied so an override can consult project state (e.g. distinguishing script modules from grouping folders). -
callablePath
-
packageDocumentation
protected @Nullable String packageDocumentation(com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor descriptor) The package's own documentation, carried in a package reference body'sDocumentation:field. The descriptor's computed description by default; return null to omit the field, as a library whose package descriptors carry synthetic text should.
-