Syntax highlighting, snippets, and language support for the Bad programming language.
Features
Syntax Highlighting
Full TextMate grammar for .bad files:
- Keywords —
fn,var,class,if,else,while,for,return,import,try,catch,throw,new,switch,break,continue, and more - Types —
num,string,bool,char,any,void,int,float,double - Literals — numbers (int, float, hex), strings, interpolated strings (
$"..."), booleans,null - Comments — line (
//) and block (/* */) - Operators — arithmetic, comparison, logical, assignment, compound assignment,
=>,??,.. - Definitions — function, class, interface, struct, and enum names
Language Configuration
- Bracket matching —
{},[],(),<> - Auto-closing — brackets, quotes
- Comment toggling —
Ctrl+/for line comments,Ctrl+Shift+Afor block comments - Code folding — fold on
{}-delimited blocks - Smart indentation — auto-indent after
{, auto-dedent on}
Snippets
Type a prefix and press Tab:
| Prefix | Description |
|---|---|
fn |
Function declaration |
fnr |
Function with return type |
if |
If statement |
ife |
If-else statement |
for |
For-in loop |
while |
While loop |
do |
Do-while loop |
class |
Class with constructor |
classi |
Class with inheritance |
interface |
Interface declaration |
struct |
Struct declaration |
enum |
Enum declaration |
try |
Try-catch block |
tryf |
Try-catch-finally |
switch |
Switch-case statement |
var |
Variable declaration |
tvar |
Typed variable |
print |
Print line |
lam |
Lambda expression |
lamb |
Lambda block |
import |
Import statement |
ret |
Return statement |
Installation
From VSIX (local)
cd editor/bad-lang-vscode
npx @vscode/vsce package
code --install-extension bad-lang-0.1.0.vsix
From Source (development)
# Symlink into your VS Code extensions directory
ln -s $(pwd)/editor/bad-lang-vscode ~/.vscode/extensions/bad-lang
Then reload VS Code (Ctrl+Shift+P → "Developer: Reload Window").
Roadmap
- Language Server Protocol (LSP) — autocomplete, diagnostics, go-to-definition
- Debug Adapter Protocol (DAP) — breakpoints, step-through debugging
- Formatter integration
- VS Code Marketplace publishing