VS Code Extension
Stable
VS Code extension is available and stable.
The official Levython VS Code extension provides syntax highlighting, code snippets, and language support for enhanced development experience.
Table of Contents
Installation#
The Levython extension is located in the vscode-levython directory of the Levython repository.
Method 1: Install from VSIX
terminal
# Navigate to extension directory
cd vscode-levython
# Package the extension
vsce package
# Install the generated .vsix file
code --install-extension levython-*.vsix
Method 2: VS Code Marketplace
Coming soon! The extension will be published to the VS Code Marketplace.
Features#
Syntax Highlighting
Full syntax highlighting for Levython code including:
- Keywords: act, if, else, elif, for, while, in, range, break, continue
- Operators: <-, ->, ==, !=, <=, >=, and, or, not
- Built-in Functions: say, ask, str, int, len, append, range, etc.
- Literals: Numbers, strings, booleans, null
- Comments: Single-line comments with #
File Extensions
The extension recognizes:
.levy- Full Levython file extension.ly- Short Levython file extension
Code Snippets#
The extension includes helpful code snippets. Type the prefix and press Tab to expand:
| Prefix | Description | Expands To |
|---|---|---|
act |
Function definition | act name() { } |
if |
If statement | if condition { } |
for |
For loop | for i in range() { } |
while |
While loop | while condition { } |
say |
Print statement | say("") |
Manual Installation#
To manually install the extension without packaging:
terminal
# On macOS/Linux
ln -s "$(pwd)/vscode-levython" ~/.vscode/extensions/levython
# On Windows (PowerShell)
cmd /c mklink /D "%USERPROFILE%\.vscode\extensions\levython" "$(pwd)\vscode-levython"
# Reload VS Code
# Press Cmd+Shift+P (or Ctrl+Shift+P) and run "Developer: Reload Window"
Extension Files
The extension includes:
- package.json: Extension metadata and configuration
- syntaxes/levython.tmLanguage.json: TextMate grammar for syntax highlighting
- language-configuration.json: Language-specific settings (brackets, comments)
- snippets/levython.json: Code snippet definitions
Tip: After installation, restart VS Code and open any
.levy or .ly file to see syntax highlighting in action!