VSCode Extension¶
Full IDE support for sigc development.
Installation¶
From Marketplace¶
- Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Search for "sigc"
- Click Install
From Command Line¶
Features¶
Syntax Highlighting¶
Full syntax highlighting for .sig files:
- Keywords (
data,signal,portfolio,emit) - Operators (
zscore,rank,rolling_mean) - Numbers, strings, comments
- Type annotations
Code Completion¶
IntelliSense for:
- Operators: All 120+ operators with signatures
- Keywords: Language keywords
- Parameters: Function parameters
- Variables: Defined variables in scope
Press Ctrl+Space to trigger completion.
Hover Documentation¶
Hover over any operator to see:
- Function signature
- Description
- Parameters
- Return type
- Example usage
Error Diagnostics¶
Real-time error checking:
- Syntax errors
- Type mismatches
- Undefined variables
- Invalid operator usage
Errors appear with red underlines and in the Problems panel.
Go to Definition¶
Ctrl+Click or F12 to jump to:
- Signal definitions
- Variable declarations
- Function definitions
Find References¶
Shift+F12 to find all usages of:
- Signals
- Variables
- Functions
Format Document¶
Shift+Alt+F to format your strategy:
- Consistent indentation
- Proper spacing
- Aligned operators
Code Folding¶
Collapse sections:
data:blockssignalblocksportfolioblocks
Configuration¶
Extension Settings¶
Open Settings (Ctrl+,) and search for "sigc":
{
// Path to sigc binary
"sigc.binaryPath": "/usr/local/bin/sigc",
// Enable real-time diagnostics
"sigc.enableDiagnostics": true,
// Diagnostic delay (ms)
"sigc.diagnosticDelay": 500,
// Format on save
"sigc.formatOnSave": true,
// Show inline hints
"sigc.inlayHints.enabled": true,
// LSP log level
"sigc.logLevel": "info"
}
Workspace Settings¶
Create .vscode/settings.json:
{
"sigc.binaryPath": "./target/release/sigc",
"sigc.formatOnSave": true,
"[sig]": {
"editor.tabSize": 2,
"editor.insertSpaces": true
}
}
Snippets¶
Built-in snippets for common patterns:
data - Data Section¶
data:
source = "$1"
format = ${2|csv,parquet|}
columns:
date: Date
ticker: Symbol
$3: Numeric as $4
signal - Signal Block¶
portfolio - Portfolio Block¶
portfolio ${1:name}:
weights = rank(${2:signal}).long_short(top=${3:0.2}, bottom=${4:0.2})
backtest from ${5:2020-01-01} to ${6:2024-12-31}
momentum - Momentum Signal¶
longshort - Long-Short Portfolio¶
portfolio long_short:
weights = rank(${1:signal}).long_short(top=${2:0.2}, bottom=${3:0.2}, cap=${4:0.05})
backtest rebal=${5:21} from ${6:2020-01-01} to ${7:2024-12-31}
Type the snippet prefix and press Tab to expand.
Commands¶
Access via Command Palette (Ctrl+Shift+P):
| Command | Description |
|---|---|
sigc: Run Strategy |
Run current file |
sigc: Run with Parameters |
Run with param overrides |
sigc: Validate |
Check for errors |
sigc: Format Document |
Format current file |
sigc: Show Metrics |
Display performance metrics |
sigc: Export Results |
Export to CSV/JSON |
sigc: Open Documentation |
Open docs in browser |
Keyboard Shortcuts¶
| Shortcut | Action |
|---|---|
Ctrl+Shift+R |
Run strategy |
Ctrl+Shift+V |
Validate |
Ctrl+Shift+D |
Open diagnostics |
F5 |
Run with debugger |
Customize Shortcuts¶
Add to keybindings.json:
Output Panel¶
Results appear in the Output panel:
- Open Output panel (
Ctrl+Shift+U) - Select "sigc" from dropdown
Shows:
- Backtest results
- Performance metrics
- Errors and warnings
- Debug output
Problems Panel¶
Errors and warnings appear in Problems panel:
- Click error to jump to line
- Hover for details
- Quick fix suggestions
Debugging¶
Basic Debugging¶
- Set breakpoints (click line number)
- Press
F5to start debugging - Step through execution
Debug Configuration¶
Create .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "sigc",
"request": "launch",
"name": "Debug Strategy",
"program": "${file}",
"args": ["--verbose"]
}
]
}
Watch Variables¶
Add variables to watch panel:
- Signal values
- Weight calculations
- Intermediate results
Tasks¶
Define tasks in .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Backtest",
"type": "shell",
"command": "sigc run ${file}",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Validate All",
"type": "shell",
"command": "sigc validate strategies/*.sig"
}
]
}
Run tasks: Ctrl+Shift+B
Multi-Root Workspaces¶
Support for multiple strategy folders:
// workspace.code-workspace
{
"folders": [
{ "path": "production" },
{ "path": "research" },
{ "path": "backtest" }
],
"settings": {
"sigc.binaryPath": "/usr/local/bin/sigc"
}
}
File Associations¶
Ensure .sig files are recognized:
Recommended Extensions¶
Enhance your sigc development:
| Extension | Purpose |
|---|---|
| Error Lens | Inline error display |
| GitLens | Git history |
| Jupyter | Notebook support |
Troubleshooting¶
Extension Not Working¶
- Check sigc is installed:
sigc --version - Verify path in settings
- Restart VSCode
No Syntax Highlighting¶
- Check file extension is
.sig - Reload window:
Ctrl+Shift+P→ "Reload Window"
LSP Errors¶
- Check Output panel for errors
- Increase log level:
- Restart LSP: Command Palette → "sigc: Restart Language Server"
Slow Diagnostics¶
- Increase delay:
- Disable for large files:
Updating¶
Auto Update¶
Extensions update automatically by default.
Manual Update¶
- Open Extensions view
- Click update button on sigc extension
Check Version¶
Contributing¶
Report issues or contribute:
Next Steps¶
- Quickstart - Start using sigc
- Syntax Reference - Language details
- Python - Python integration