Yaklang VS Code Extension

Complete Yaklang Language Support for VS Code

English | 简体中文
IMPORTANT: Version Requirements
For LSP (Language Server Protocol) features to work properly, you MUST use Yak engine version 1.4.4-alpha1030b or later.
- Extension Version: 1.4.1+
- Minimum Yak Engine Version: 1.4.4-alpha1030b
If you're using an older version of the Yak engine, LSP features (IntelliSense, code completion, diagnostics) will not function correctly.
Features
Language Support
- Yaklang (.yak) - Full language support including syntax highlighting, IntelliSense, and code completion
- SyntaxFlow (.sf) - Domain-specific language designed for security analysis
Core Capabilities
- IntelliSense - Auto-completion, function signatures, parameter hints (requires Yak engine >= 1.4.4-alpha1030b)
- Debugging - Complete debugging support with breakpoints, step execution, variable inspection
- Quick Run - Execute Yak scripts instantly via CodeLens or keyboard shortcuts
- Code Formatting - Automatic code formatting for consistent style
- Code Snippets - Rich code templates to boost productivity
- LSP Server - Real-time code analysis powered by Language Server Protocol (requires Yak engine >= 1.4.4-alpha1030b)
Engine Management
- Auto Detection - Automatically detect Yak engine from system PATH
- Version Management - Download, install, and switch between different Yak engine versions
- Multi-language UI - Switch between Chinese/English interface
- Status Bar Integration - Real-time display of current Yak engine version and status
Installation
Option 1: Install from VS Code Marketplace (Recommended)
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Yaklang"
- Click "Install"
Option 2: Command Line Installation
code --install-extension v1ll4n.yak
Option 3: Install from VSIX
- Download the latest
.vsix file from Releases
- In VS Code:
Extensions → ... → Install from VSIX...
Quick Start
1. Install Yak Engine (Version >= 1.4.4-alpha1030b)
CRITICAL: For LSP features to work, you must install Yak engine version 1.4.4-alpha1030b or later.
Option A: Auto-download via Extension
- Click the Yak version icon in the status bar
- Select "Download Yak Engine"
- Choose version 1.4.4-alpha1030b or later
- Wait for the download to complete
Option B: Manual Installation
# Linux/macOS
curl -sfL https://yaklang.com/install.sh | bash
# Windows (PowerShell)
iwr -useb https://yaklang.com/install.ps1 | iex
# Verify version (must be >= 1.4.4-alpha1030b)
yak version
The extension supports two modes:
- Auto Mode (Recommended): Automatically use
yak command from system PATH
- Custom Mode: Manually specify Yak engine path
Switch modes via status bar: Click Yak icon → Select the desired option
3. Start Coding
Create a .yak file and start coding:
// hello.yak
println("Hello, Yaklang!")
// Use built-in functions
http.Get("https://example.com", http.proxy("http://127.0.0.1:7890"))~
4. Run Your Script
- CodeLens (Recommended): Click
Run Yak Script button at the top of the file
- Keyboard Shortcut:
Cmd+Shift+B (macOS) / Ctrl+Shift+B (Windows/Linux)
- Context Menu: Right-click →
Yak: Exec file
- Command Palette:
Cmd+Shift+P → Yak: Exec file
Features in Detail
CodeLens
Automatically displayed at the top of each .yak file:
- Run Yak Script - Execute the current script
- Debug Yak Script - Debug the current script
Keyboard Shortcuts
| Function |
Windows/Linux |
macOS |
| Run Script |
Ctrl+Shift+B |
Cmd+Shift+B |
| Format Code |
Shift+Alt+F |
Shift+Option+F |
| Command Palette |
Ctrl+Shift+P |
Cmd+Shift+P |
Command List
Access all commands via Command Palette (Cmd+Shift+P / Ctrl+Shift+P):
| Command |
Description |
Yak: Exec file |
Run current Yak script |
Yak: Debug file |
Debug current Yak script |
Yak: Format file |
Format current file |
Yak: Configure Engine |
Open engine configuration panel |
Yaklang: LSP Status |
View LSP server status |
Yaklang: Restart LSP Server |
Restart language server |
Yaklang: Download Yak Engine |
Download specific version of engine |
Yaklang: List Installed Versions |
View all installed engine versions |
Yaklang: Switch Language |
Switch interface language (Chinese/English) |
Right-click in a .yak file to access:
- Yak: Exec file - Run script
- Yak: Debug file - Debug script
- Yak: Format file - Format code
Configuration
Basic Settings
{
// Engine source mode
"yaklang.yakBinarySource": "auto", // "auto" or "custom"
// Custom engine path (only used in custom mode)
"yaklang.yakBinaryPath": ""
}
Configuration Details
yaklang.yakBinarySource
auto (Recommended): Automatically find yak command from system PATH
custom: Use custom path (requires yakBinaryPath configuration)
yaklang.yakBinaryPath
Full path to the custom Yak engine, for example:
- macOS/Linux:
/usr/local/bin/yak
- Windows:
C:\Program Files\yaklang\yak.exe
Debugging
Start Debugging
- Set breakpoints in code (click left of line numbers)
- Press
F5 or click CodeLens's Debug Yak Script
- Use debug console to inspect variables, call stack, etc.
Debug Configuration
Customize debug configuration in .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "yak",
"request": "launch",
"name": "Debug Yak Script",
"program": "${file}",
"args": [],
"env": []
}
]
}
Troubleshooting
Issue: LSP Features Not Working
MOST COMMON CAUSE: You are using an older version of the Yak engine.
Solution:
- Check your Yak engine version: Run
yak version in terminal
- If version is less than 1.4.4-alpha1030b, upgrade:
- Click status bar Yak icon → "Download Yak Engine"
- Select version 1.4.4-alpha1030b or later
- Restart VS Code after upgrading
Issue: CodeLens Not Showing
Solutions:
- Check VS Code settings:
Settings → Editor → Ensure Editor: Code Lens is enabled
- Reload window:
Cmd+Shift+P → Developer: Reload Window
- Check file language mode is
Yak (bottom-right status bar)
Issue: Yak Engine Not Found
Solutions:
- Click Yak icon in status bar
- Select "Download Yak Engine" for automatic download (version >= 1.4.4-alpha1030b)
- Or manually set engine path: Status bar → "Choose yak binary from file browser"
Issue: LSP Server Not Starting
Solutions:
- First, verify Yak engine version >= 1.4.4-alpha1030b
- Open Command Palette:
Cmd+Shift+P
- Run:
Yaklang: Restart LSP Server
- Check output:
View → Output → Select "Yaklang LSP"
Issue: Code Completion Not Working
Solutions:
- Ensure Yak engine version >= 1.4.4-alpha1030b (most common issue)
- Check LSP server status:
Yaklang: LSP Status
- Restart LSP:
Yaklang: Restart LSP Server
- Restart VS Code
Resources
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Ways to Contribute
- Report Bugs
- Suggest New Features
- Improve Documentation
- Submit Pull Requests
License
This project is licensed under the MIT License.
Acknowledgments
Thanks to all developers who have contributed to the Yaklang ecosystem!