VSCode extension for HLang - a Hindi-based programming language.
Features
Syntax Highlighting: Color-coded syntax for all HLang keywords and constructs
Error Detection: Real-time error checking using the HLang interpreter
Auto-completion: Bracket and quote auto-closing
Code Folding: Support for code folding
Supported Keywords
ye - Variable declaration
agar - If statement
ya fir - Else if
warna - Else
jabtak - While loop
dohraye - Repeat/loop
roko - Break
aage badho - Continue
firseKaro - Function declaration
wapas bhejo - Return
bol - Print/output
Installation
1. Install Dependencies
Navigate to the extension directory and install dependencies:
cd hlang-vscode-extension
npm install
2. Compile the Extension
npm run compile
3. Install the Extension
Option A: Install Locally for Development
Press F5 in VSCode while in the extension directory
This will open a new VSCode window with the extension loaded
Option B: Package and Install
Install vsce (if you haven't already):
npm install -g @vscode/vsce
Package the extension:
vsce package
Install the .vsix file:
Open VSCode
Go to Extensions (Ctrl+Shift+X)
Click on the "..." menu at the top right
Select "Install from VSIX..."
Choose the generated .vsix file
4. Ensure HLang Interpreter is Available
The extension requires hlang.exe to be in the root of your workspace for error detection. Make sure your HLang interpreter is compiled and accessible.
Usage
Open any .hlang file
You'll see syntax highlighting automatically applied
Errors will be underlined in real-time as you type
Example
// Variable declaration
ye naam = "Baburao"
ye umar = 20
// Print statements
bol("Naam:")
bol(naam)
// Function
firseKaro add(a, b): number {
wapas bhejo a + b
}
// Loops
dohraye {
bol("Namaste")
roko
}
Development
Project Structure
hlang-vscode-extension/
├── client/ # Language client
│ └── src/
│ └── extension.ts
├── language-server/ # Language server for diagnostics
│ └── server.ts
├── syntaxes/ # TextMate grammar
│ └── hlang.tmLanguage.json
├── language-configuration.json
└── package.json
Building
npm run compile
Watching for Changes
npm run watch
Requirements
VSCode 1.75.0 or higher
Node.js 18.0.0 or higher
HLang interpreter (hlang.exe)
Known Issues
Error messages from the interpreter might not always include precise line numbers
Multi-line string validation is basic
Release Notes
0.1.0
Initial release
Syntax highlighting for all HLang keywords
Basic error detection
Auto-closing brackets and quotes
Contributing
Feel free to submit issues and enhancement requests!