VS Code Extension¶
The Raven VS Code extension provides a complete development environment for Raven programming language.
Installation¶
From VS Code Marketplace¶
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search: "Raven Language"
- Click Install
From Command Line¶
Manual Installation¶
- Download:
raven-language-1.1.5.vsixfrom GitHub Releases - Install:
code --install-extension raven-language-1.1.5.vsix
Features¶
Syntax Highlighting¶
- Keywords:
fun,let,if,elseif,else,while,for,struct,enum,import,export,from,print, … (Raven uses the single keywordelseiffor else-if branches, not two wordselse if.) - Types:
int,float,bool,string,void - Operators:
+,-,*,/,%,==,!=,&&,|| - Comments:
//and/* */ - Strings: Proper string highlighting
- Numbers: Integer and float highlighting
Code Snippets¶
Type these shortcuts and press Tab:
| Shortcut | Result |
|---|---|
let |
let name: Type = value; |
fun |
fun name() -> Type { } |
if |
if (condition) { } |
ifelse |
if (condition) { } else { } |
elseif |
} elseif (condition) { } (continues a chain) |
ifelseif |
if / elseif / else chain |
while |
while (condition) { } |
for |
for (let i: int = 0; i < len; i = i + 1) { } |
struct |
struct Name { field: Type } |
enum |
enum Name { Variant1, Variant2 } |
print |
print("message"); |
printf |
print(format("{}", value)); |
format |
format("template", args) |
main |
fun main() -> void { } |
Language Configuration¶
- Comments:
//and/* */ - Brackets:
(),[],{} - Auto-indentation: Smart indentation for blocks
- Word wrapping: Proper line wrapping
File Association¶
- Extension:
.rvfiles are recognized as Raven - Icon: Raven logo in file explorer
- Language Mode: Shows "Raven" in status bar
Usage¶
Creating Raven Files¶
- Create new file:
Ctrl+N - Save as:
filename.rv - Language mode: Automatically set to Raven
Running Raven Programs¶
The extension doesn't include a built-in runner, but you can:
- Open terminal:
Ctrl+`` - Run program:
raven filename.rv - Start REPL:
raven
Debugging¶
Currently, Raven doesn't have a debugger, but you can:
- Add print statements:
print("Debug: ", variable); - Use REPL: Test code interactively
- Check syntax:
raven filename.rv -c
Configuration¶
Settings¶
You can customize the extension in VS Code settings:
{
"raven.language.enabled": true,
"raven.snippets.enabled": true,
"raven.highlighting.enabled": true
}
Keybindings¶
Add custom keybindings in keybindings.json:
[
{
"key": "ctrl+f5",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "raven ${file}\n"
},
"when": "resourceExtname == '.rv'"
}
]
Troubleshooting¶
Common Issues¶
Extension not working
- Reload VS Code: Ctrl+Shift+P → "Developer: Reload Window"
- Check if .rv files show "Raven" in status bar
- Verify extension is enabled in Extensions panel
Syntax highlighting not working
- Make sure file has .rv extension
- Check if language mode is set to "Raven"
- Try reopening the file
Snippets not working - Type the shortcut and press Tab - Make sure snippets are enabled in settings - Check if there are conflicts with other extensions
Getting Help¶
- GitHub Issues: Report bugs
- VS Code Marketplace: Extension page
- Documentation: This site
Development¶
Building the Extension¶
If you want to modify the extension:
# Clone the repository
git clone https://github.com/martian56/raven.git
cd raven/raven-vscode-extension
# Install dependencies
npm install
# Build
npm run build
# Package
vsce package
Contributing¶
- Fork the repository
- Make changes to the extension
- Test thoroughly
- Submit pull request
Future Features¶
Planned improvements: - Language Server Protocol (LSP) - Full IntelliSense - Debugger support - Step-through debugging - Error highlighting - Real-time error detection - Code formatting - Auto-formatting - Go to definition - Jump to function definitions - Hover documentation - Function documentation on hover
Next: GitHub Repository - Source code and issues