See also: Code Editor

AutoBlocks features an embedded code editor for JavaScript/TypeScript that is based on the same technology that powers the popular VS Code product. If you have used VS Code before, you’ll find the AutoBlocks editor to be very similar. Most of the features and key bindings are the same, though some features that aren't useful to AutoBlocks users are removed, e.g., the local-file system options.

Code Suggestions

When you write code, our editor assists by giving you IntelliSense suggestions. For example, if you were to use our Jira Cloud or Jira Server Managed APIs, you’d receive the following suggestions when you access the connection import:

This list of suggestions lets you know which groups and functions are available without your having to review external documentation. Sometimes you may lose track of the suggestions list or maybe the list doesn't display automatically when you expect. To manually toggle on suggestions, press CTRL + SPACE.

Show Additional Information

Additional information about highlighted items isn't available by default. Press CTRL + SPACE and additional details for a highlighted item appear:

View Object Properties

Options for object properties don't appear by default. Press CTRL + SPACE to view the possible options, as shown here:

Hide Suggestions

Press Escape to hide a suggestions list.

Import Suggestions

The AutoBlocks code editor allows you to easily import functions and types from locations that you have not yet imported into your script, all without your having to know the exact import path. 

VS Code displays various “auto import“ suggestions under the same UI as regular suggestions. The AutoBlocks code editor works a bit differently. When you need to import something, type the named export that you are looking for, and a lightbulb appears if there is at least one match. Click the lightbulb to view the list of suggestions.

You can toggle import suggestions by pressing COMMAND + . on Mac or CTRL + . on Windows.

Partial Matches

You can find partial matches if you know how the named export begins. For example, by typing convert, the editor offers us suggestions for all available conversion functions:

Temporary Quirks and Shortcomings

Keep the following quirks in mind, though most of these issues will eventually be resolved by the AutoBlocks team. Watch the Release Notes for notifications.

  • Suggestions are not available for importing connections.

  • Suggestions are not available if you import from your local workspace modules.

  • Suggestions for TypeScript constructs, such as interfaces, types, modules, namespaces, etc., are not available. Named exports are currently extracted from JavaScript files only.

  • You won’t get any suggestions when you switch to JavaScript as a language (not recommended), as it limits us from detecting when suggestions are requested.

  • In some cases, import suggestions may be overshadowed by other options that the editor believes to be of higher priority.

    • For example, when you already have imported Convert but are still trying to find additional suggestions for convert, the editor suggests correcting the mistake instead of providing import options:

Other Shortcuts

Press F1 to display a list of all actions you can use in the AutoBlocks code editor:

And you can right-click to display commonly used actions: