VJ Language for Visual Studio Code
VJ Language extension provides comprehensive language support for the VJ programming language in Visual Studio Code.
Features
Syntax Highlighting
- Full syntax highlighting for VJ source files (
.vj)
- Support for comments, strings, numbers, keywords, and operators
IntelliSense
- Code Completion: Intelligent suggestions for keywords, types, functions, and symbols
- Hover Information: Detailed type information and documentation on hover
- Signature Help: Parameter hints when calling functions
Navigation
- Go to Definition: Jump to symbol definitions (F12)
- Find All References: Find all usages of a symbol (Shift+F12)
- Document Symbols: Outline view of all symbols in the current file (Ctrl+Shift+O)
- Workspace Symbols: Search symbols across the workspace (Ctrl+T)
Diagnostics
- Real-time error detection
- Undefined variable warnings
- Type checking
- Unused variable detection
Code Actions
- Quick fixes for common problems
- Import suggestions
- Refactoring support
- Document formatting (Shift+Alt+F)
- Configurable indentation (tabs/spaces)
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "VJ Language"
- Click Install
From VSIX
- Download the
.vsix file
- In VS Code, go to Extensions
- Click the "..." menu and select "Install from VSIX..."
- Select the downloaded file
Development Installation
cd vscode-vj
npm install
cd server
npm install
cd ..
npm run compile
Then press F5 to launch the Extension Development Host.
Configuration
Settings
| Setting |
Description |
Default |
vj.maxNumberOfProblems |
Maximum number of problems to report |
100 |
vj.trace.server |
Trace communication with the language server |
"off" |
vj.compiler.path |
Path to the VJ compiler executable |
"" |
vj.format.tabSize |
Number of spaces per indentation level |
4 |
vj.format.insertSpaces |
Use spaces instead of tabs |
true |
Commands
| Command |
Description |
VJ: Restart VJ Language Server |
Restart the language server |
VJ: Show Syntax Tree |
Display the AST of the current file |
Supported VJ Features
Declarations
// Variables
let x = 10;
const PI = 3.14159;
var mutable = "string";
// Functions
fn add(a: int, b: int) -> int {
return a + b;
}
// Classes
class Point {
let x: float;
let y: float;
fn distance(other: Point) -> float {
// ...
}
}
// Structs
struct Vector3 {
x: float,
y: float,
z: float
}
// Enums
enum Color {
Red,
Green,
Blue
}
// Interfaces
interface Drawable {
fn draw() -> void;
}
Control Flow
if (condition) {
// ...
} else {
// ...
}
for (let i = 0; i < 10; i++) {
// ...
}
while (condition) {
// ...
}
match value {
case 1 => "one",
case 2 => "two",
default => "other"
}
Types
- Primitives:
int, i8, i16, i32, i64, uint, u8, u16, u32, u64
- Floating point:
float, f32, f64
- Boolean:
bool
- Text:
char, string
- Special:
void, any, never
- Generics:
Array<T>, Map<K, V>, Option<T>, Result<T, E>
Troubleshooting
Server Not Starting
- Ensure Node.js is installed (v18+)
- Check the Output panel (View > Output) and select "VJ Language Server"
- Try restarting the server with "VJ: Restart VJ Language Server"
Missing Features
Make sure you're editing a .vj file. The extension only activates for VJ files.
Reduce vj.maxNumberOfProblems if you experience slowdowns on large files.
Contributing
Contributions are welcome! Please see our Contributing Guide.
License
MIT License - see LICENSE for details.