Lyra Language Support for VS Code

Complete language support for the Lyra Programming Language in Visual Studio Code.
Features
- 🦈 Syntax Highlighting - Beautiful syntax colors for .lyra files
- 🚀 Easy Execution - Run code directly from the editor (Ctrl+Shift+Enter)
- 📚 Code Snippets - Quick code templates and patterns
- 💡 Language Support - Full Lyra language syntax recognition
- ⚡ Fast & Lightweight - No external dependencies required
What is Lyra?
Lyra is a modern, interpreted programming language designed for:
- Educational purposes
- Learning programming fundamentals
- Quick scripting and prototyping
- Easy-to-read and clean syntax
Installation
From VS Code Marketplace
- Open VS Code
- Press
Ctrl+Shift+X (or Cmd+Shift+X on macOS)
- Search for "Lyra Language Support"
- Click "Install"
Quick Start
Create your first Lyra file
Create a file named hello.lyra:
// hello.lyra
println("Hello, Lyra!")
var name = "World"
println("Hello, " + name)
Run the file
- Open the file in VS Code
- Press
Ctrl+Shift+Enter (or Cmd+Shift+Enter on macOS)
The code will execute in a terminal window.
Code Snippets
Type these prefixes and press Tab to insert code templates:
| Prefix |
Expansion |
lyra-if |
if-else statement |
lyra-while |
while loop |
lyra-proc |
procedure definition |
lyra-var |
variable declaration |
lyra-file-write |
write to file |
lyra-file-read |
read from file |
lyra-try |
try-catch block |
lyra-print |
println statement |
Requirements
- VS Code 1.84 or higher
- Lyra interpreter installed on your system
To install Lyra interpreter:
- Download from Lyra Repository
- Add to system PATH or use full path in settings
Configuration
Add these to your VS Code settings.json:
{
"lyra.executablePath": "lyra",
"[lyra]": {
"editor.defaultFormatter": "lyra-dev.lyra-language-support"
}
}
Keyboard Shortcuts
| Shortcut |
Action |
Ctrl+Shift+Enter |
Run File |
Ctrl+Space |
Show IntelliSense |
Syntax Support
The extension highlights and recognizes:
- Keywords:
var, set, procedure, if, else, while, for, return, try, catch, in
- Built-in Functions:
println, print, file.*, string.*, json.*, type.*
- Comments: Single-line (
//) and multi-line (/* */)
- Strings: Double-quoted strings with escape sequences
- Numbers: Integers and floating-point numbers
Language Features
Variables
var age = 25
var name = "Alice"
var pi = 3.14
Control Flow
if (age >= 18) {
println("Adult")
} else {
println("Minor")
}
while (count < 5) {
println(count)
set count = count + 1
}
Procedures
procedure greet(name) {
println("Hello, " + name)
return true
}
greet("World")
File Operations
file.write_file("data.txt", "Hello")
var content = file.read_file("data.txt")
if (file.file_exists("data.txt")) {
println("File exists!")
}
String Operations
var len = string.strlen("hello")
var upper = string.uppercase("hello")
var trimmed = string.trim(" text ")
var items = string.split("a,b,c", ",")
Troubleshooting
Extension doesn't load
- Ensure you have VS Code 1.84 or higher
- Check that .lyra files are recognized
- Reload VS Code window (Ctrl+R)
Run command not working
- Verify Lyra interpreter is installed
- Check that
lyra is in system PATH
- Or set
lyra.executablePath in settings
Syntax highlighting not working
- Ensure file has
.lyra extension
- Reload VS Code window
Known Issues
- No known issues at this time
Contributing
Contributions are welcome! Please visit the GitHub repository.
Changelog
See CHANGELOG.md for release notes and version history.
License
MIT License - Copyright (c) 2024 Lyra Contributors
Support
For issues, feature requests, or feedback:
Made with ❤️ for the Lyra programming language
🦈 Lyra: Write Code Like Never Before