Support for JavaScript - Dynamic Code

The JavaScript support in Spider also includes a hint mechanism called Dynamic Code. In fact, this mechanism consists of two tools:

NOTE!
Dynamic code is not available for VBScript.

Dynamic code takes data from the definition file for scripts and parses existing script code. In this way, it is possible to provide names and argument lists of built-in functions and predefined and declared JavaScript variables and constants in the script. This allows you to write scripts much more efficiently - you don't have to remember the exact names of all JavaScript functions, or a long list of variables.

Dynamic code

Dynamic code works by suggesting the names of usable elements (functions, variables and constants). The tool can be called in two ways:
  1. automatic display of hints - use the command on the editor mini bar (the command icon is shown on the right). Hints will appear after a while of inactivity.
  2. using keyboard shortcut - you can always call up a balloon with a hint to the currently typed function by pressing Ctrl+Spacekeyboard shortcut

If you have activated automatic display, type the beginning of the function name and wait a moment - a list with items you can use will appear. The list will highlight the first item that most closely matches the string you entered. If automatic hints is disabled, use Ctrl+Space shortcut to get a hint.

For example, if there is a function:

function myfunc (a, b)
{
      a = a + b;
}

Now just type (vertical line means the cursor in the document):

myf|
and use the shortcut Ctrl+Space (or wait a moment if you activated the dynamic code). A window will appear with the name my_function.

You can navigate through the list using scroll bars, arrows, etc. (as in any window). To insert the selected structure into the document, press Enter, or click on it.

The icons next to the names indicate whether it is a variable, constant, or function name

Dynamic hints

Dynamic hints work by prompting for function arguments as the script is being written. The tool gets the data similarly to the dynamic code - from the definition file and from the script analysis results. Thanks to that you don't have to remember or search in the code which arguments are required by the function.

The tool can be invoked in two ways:

  1. automatic hints - use the command on the editor's mini bar. After typing the function name and opening bracket (eg. my_function( ), wait for a moment and a balloon will pop up with arguments to use. The argument you want to use will be highlighted in bold. The command icon is shown above.
  2. using keyboard shortcut - you can always call up a balloon with a tooltip for the currently used function by pressing ctrl+keyboard shortcut

Settings and other dynamic hints options
To adjust the dynamic hints to your needs, use the Program Settings - Dynamic hints in scripts window.

Related topics

To top