The internal script editor in Template Builder is built on top of the Monaco Editor, the same open-source editor that powers Visual Studio Code. It offers a powerful and efficient development experience with many built-in features that help you write and manage scripts effectively.

This page outlines the general editor features available in the script editor.

image-20250416-073500.png

Core Editor Features

  • Syntax Highlighting for TypeScript/JavaScript.

  • IntelliSense for code suggestions, autocompletion, and tooltips.

  • Real-Time Error Checking based on syntax and type inference.

  • Bracket Matching highlights matching brackets and braces, helping you keep track of blocks of code and function definitions.

  • Code Folding collapses or expands code blocks using the small arrows in the margin, making it easier to navigate large scripts.

  • Multi-Cursor Editing by holding Alt and clicking to place multiple cursors.

Context Menu

image-20250415-143127.png

Right-click anywhere in the editor to open the context menu. This provides access to many common actions and code navigation tools:

  • Go to Definition: Jumps to where a function or variable is defined.

  • Go to References: Finds all usages of the selected symbol.

  • Go to Symbol... Opens a list of all functions and variables in the file, allowing quick navigation.

  • Peek: A submenu that lets you preview definitions and references inline without leaving your current position.

  • Rename Symbol: Renames a symbol across the script, updating all references automatically.

  • Change All Occurrences: Selects and edits all occurrences of the current word or variable at once.

  • Format Document: Re-formats the entire script based on consistent style rules.

  • Format Selection: Formats only the selected lines.

  • Cut / Copy / Paste: Standard editing options to manipulate code.

  • Command Palette: Opens a searchable list of all available commands in the editor.

Keyboard Shortcuts

Here are some of the most useful Monaco Editor shortcuts that work inside Template Builder:

Shortcut

Action

Ctrl + Shift + O

Open a searchable list of functions, variables, and other symbols in the document. By typing : the symbols are grouped by category.

Ctrl + Space

Trigger suggestion/autocomplete

F12

Go to Definition

Alt + F12

Peek Definition

Shift + F12

Find All References

F2

Rename Symbol

Ctrl + F

Search (and replace)

F1

Open Command Palette

Alt + Up / Alt + Down

Move line up/down

Ctrl + Shift + K

Delete line

Ctrl + Z / Ctrl + Y

Undo / Redo

Shift + Alt + F

Format the document

Ctrl + K, F

Format the selected text