VS Code support for SPL — syntax highlighting, snippets, IntelliSense, diagnostics, and more.
[!IMPORTANT]
Semantic highlighting and diagnostics require the SPL lexer binary and currently only work on Linux.
Syntax highlighting, snippets, and autocomplete work on all platforms.
To test/debug: Press F5 to open an Extension Development Host window.
Features
Syntax Highlighting
Accurate coloring for SPL keywords, registers, constants, operators, numbers, strings, and comments.
Code Folding
Fold SPL control blocks like do … endwhile and then … endif for cleaner navigation in large programs.
Snippet Completion
Quickly insert common SPL constructs using smart templates.
Alias IntelliSense
Full editor support for alias declarations:
Autocomplete: Suggestions for all declared aliases in the current file.
Go to Definition (F12): Jump directly to where an alias was defined.
Find All References (Shift+F12): See every place an alias is used.
Rename Symbol (F2): Rename an alias and instantly update all its usages.
Semantic Highlighting
Integrates with the SPL lexer to provide specialized semantic coloring. User-defined aliases are colored appropriately without overwriting the precise TextMate colors for keywords, registers, and strings.
Code Diagnostics
Real-time error checking for common SPL mistakes:
Invalid Registers: Flags alias declarations that use registers outside the allowed R0–R19 range (e.g., alias currentProcessEntry R21;).
Undefined Identifiers: Scans your code and flags any unrecognized variables that haven't been explicitly aliased.
Keyword & Constant Autocomplete
IntelliSense suggestions for all SPL keywords (if, while, print, …), constants (PROCESS_TABLE, PAGE_SIZE, …), and registers (R0–R19, SP, BP, …) as you type.
Table Offset Hover
Hover over bracket expressions like [PROCESS_TABLE + 4] to see the meaning of the offset (e.g., Offset 4 → STATE). Supports:
No offset ([PROCESS_TABLE]): Shows the full table layout with all fields.
Valid offset ([PROCESS_TABLE + 4]): Shows the specific field name.
Invalid offset ([PROCESS_TABLE + 99]): Shows the supported offset range.
Nested expressions ([PROCESS_TABLE + [SYSTEM_STATUS_TABLE + 1] * 16 + 4]): Hover on inner or outer constants independently.