Interface ScriptFunctionDocProvider
- All Known Implementing Classes:
PropertiesFileDocProvider
public interface ScriptFunctionDocProvider
Entrypoint to the autocomplete system for scripting functions.
As scripting functions are added (e.g. via addScriptModule or addStaticFields), the doc provider will be asked to provide a
CompletionDescriptor describing the element.
Example implementation that provides documentation from a custom source:
public class MyDocProvider implements ScriptFunctionDocProvider {
public CompletionDescriptor.Method getMethodDescriptor(String path, Method m) {
String desc = myBundle.getString(m.getName() + ".desc");
return new CompletionDescriptor.Method(m.getName(), path, desc, ...);
}
// ... other methods
}
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScriptFunctionDocProviderAScriptFunctionDocProviderthat provides no documentation. -
Method Summary
Modifier and TypeMethodDescription@Nullable com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.AttributegetFieldDescriptor(String path, Field f) @Nullable com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.MethodgetMethodDescriptor(String path, Method m)
-
Field Details
-
NO_DOC_PROVIDER
AScriptFunctionDocProviderthat provides no documentation.Should only be used when providing function implementations for backwards compatibility purposes, where the method should be callable but not clutter autocomplete.
-
-
Method Details
-
getMethodDescriptor
@Nullable com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Method getMethodDescriptor(String path, Method m) - Parameters:
path- The path this function is being added at, as given to theScriptManager.m- TheMethodbeing added as a scripting function.- Returns:
- A descriptor for the method.
- See Also:
-
CompletionDescriptor.MethodTypeDescriptor
-
getFieldDescriptor
@Nullable com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor.Attribute getFieldDescriptor(String path, Field f) - Parameters:
path- The path this field is being added at, as given to theScriptManager.f- TheFieldbeing added as a scripting field.- Returns:
- A descriptor for the field.
- See Also:
-
CompletionDescriptor.AttributeTypeDescriptor
-