VJ Language for Visual Studio Code
Rich language support for VJ - a modern systems programming language with Ruby-like syntax.

✨ Features
🎨 Syntax Highlighting
- Full syntax support for VJ source files (
.vj)
- Markdown code blocks: Syntax highlighting in Markdown files for
```vj code blocks
- Semantic highlighting for keywords, types, functions, and more
💡 IntelliSense
- Code Completion: Smart suggestions as you type
- Hover Information: See type info and documentation
- Signature Help: Parameter hints for functions
🔍 Code Navigation
- Jump to definition (F12)
- Find all references (Shift+F12)
- Symbol search across workspace (Ctrl+T / Cmd+T)
🐛 Real-time Diagnostics
- Undefined variable detection
- Type checking
- Unused variable warnings
- Division safety analysis
Integrated vjfmt formatter - use Cmd+Shift+F (Mac) or Ctrl+Shift+F (Windows/Linux)
🔧 Built-in Functions
VJ provides global built-in functions for I/O operations (no import required):
- I/O Functions:
print(), println(), eprint(), eprintln(), flush(), clear(), readln()
- Utility Functions:
len(), typeof(), assert()
All I/O functions have IntelliSense support with signature help and documentation.
📝 Quick Examples
Basic Program
func main() {
let name = "World"
println("Hello, " + name + "!")
}
Structs and Methods
struct Point {
x: float;
y: float;
}
impl Point {
func distance(other: Point) -> float {
let dx = this.x - other.x
let dy = this.y - other.y
return sqrt(dx * dx + dy * dy)
}
}
Pattern Matching
enum Status {
Active,
Paused,
Stopped
}
match status {
Status::Active => println("Running"),
Status::Paused => println("Paused"),
Status::Stopped => println("Done"),
}
Interfaces
interface Drawable {
func draw() -> void;
}
struct Circle {
radius: float;
}
impl Drawable for Circle {
func draw() {
println("Drawing circle")
}
}
Generics with Constraints
interface Comparable {
func compare(other: Self) -> int;
}
func max<T: Comparable>(a: T, b: T) -> T {
return a.compare(b) > 0 ? a : b
}
🚀 Getting Started
Installation
Install from VS Code Marketplace: Search for "VJ Language" in Extensions (Ctrl+Shift+X / Cmd+Shift+X)
Quick Setup
- Install the extension
- Open or create a
.vj file
- Start coding with IntelliSense support!
# If you have the VJ toolchain installed
which vjfmt # Should show path to formatter
Configure formatter path if needed:
{
"vj.format.vjfmtPath": "vjfmt"
}
📚 Language Features
Variables & Constants
let x = 10
const PI = 3.14159
let mut counter = 0
counter = counter + 1
Functions
// Both 'func' and 'fn' keywords work
func add(a: int, b: int) -> int {
return a + b
}
fn multiply(x: int, y: int) -> int {
return x * y
}
// Public function
pub fn greet(name: string) {
println("Hello, " + name)
}
Enums with Variants
enum Option {
Some(int),
None
}
enum Result {
Ok { value: int },
Err { message: string }
}
match result {
Result::Ok { value } => println("Success: " + str(value)),
Result::Err { message } => println("Error: " + message),
}
Control Flow
// If-elif-else
if x > 0 {
println("positive")
} elif x < 0 {
println("negative")
} else {
println("zero")
}
// Loops
for i in 0..10 {
println(str(i))
}
while running {
process()
}
// Defer for cleanup
defer cleanup()
Module System
// Import entire module
import std.math
// Selective imports
import std.math.{ PI, sqrt }
// Module declaration
mod utils {
pub func helper() { }
}
⚙️ Configuration
Useful Settings
{
// Number of problems to show
"vj.maxNumberOfProblems": 100,
// Path to vjfmt formatter
"vj.format.vjfmtPath": "vjfmt",
// Debug language server communication
"vj.trace.server": "off"
}
Commands
| Command |
Description |
Shortcut |
| VJ: Format Document |
Format current file |
Cmd/Ctrl+Shift+F |
| VJ: Restart Language Server |
Restart the server |
- |
🔧 Advanced Installation & Development
From VSIX File
- Download the
.vsix file
- In VS Code: Extensions → "..." menu → Install from VSIX
- Select the downloaded file
Development Setup
cd vscode-vj
npm install
cd server && npm install && cd ..
npm run compile
Press F5 to launch Extension Development Host
Building
npm run package # Creates .vsix file
🐛 Troubleshooting
Extension not working?
- Make sure you're editing a
.vj file
- Check Output panel: View → Output → "VJ Language Server"
- Try: Command Palette → "VJ: Restart VJ Language Server"
Performance issues?
- Reduce max problems:
"vj.maxNumberOfProblems": 50
📄 License
MIT License - see LICENSE