Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>SWAN L4 Language SupportNew to Visual Studio Code? Get it now.
SWAN L4 Language Support

SWAN L4 Language Support

Naiv Developer

|
1 install
| (0) | Free
Syntax highlighting, autocompletion snippets, and language configuration for the SWAN L4 DSL.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SWAN L4 Language Support for VS Code

This extension provides syntax highlighting, auto-completions, and editor configuration for the SWAN L4 DSL (.l4).

Features

  • Syntax Highlighting: Complete token support mapping to standard VS Code scopes matching Monaco's Monarch token styles.
    • Pragmas: TITLE, #DEFINE.
    • Primitives: SAY, SAY THINK, LISTEN, THINK, ASK, READ, WRITE, EXIT.
    • Control Flow: IF, ELSE, LOOP, EXIT LOOP, CONTINUE LOOP.
    • Debug Mode Syntax: Highlighting of bracket-wrapped primitives (e.g. [SAY], [IF], [CALL_CHECK_STOCK]).
    • Variables: Plain ($var), braced ({$var}), and predefined context ({Context}).
    • Strings: Multi-line triple backtick codeblocks and double-quoted strings.
    • URLs & Paths: Highlighting of URLs and file/directory paths.
  • Smart Formatting:
    • Auto-closing brackets, quotes, and backticks.
    • Automatic indentation after colons (e.g., when pressing Enter after LOOP: or IF CONTAINS "exit":).
  • Autocomplete Snippets: Direct completions for standard statements and loops like TITLE, #DEFINE, SAY, LOOP, and IF.

Installation

Manual Installation

Copy this extension folder to your VS Code extensions directory:

  • Linux / macOS: ~/.vscode/extensions/swan-l4-vscode-extension
  • Windows: %USERPROFILE%\.vscode\extensions\swan-l4-vscode-extension

Alternatively, you can package the extension as a .vsix using vsce and install it:

npm install -g @vscode/vsce
vsce package

Language Overview & Examples

Here is an example of a SWAN L4 program:

TITLE Feedback Evaluator
#DEFINE CALL_CHECK_STOCK https://api.warunglele.id/v1/inventory

SAY Please rate our service from 1 to 5:
LISTEN
IF >= 4:
  SAY We are glad you enjoyed it!
ELSE:
  SAY We apologize for the inconvenience and will work to improve.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft