VS Code Integration
VS Code integration provides syntax highlighting, IntelliSense, and other development features for Rui. This guide will help you set up and use the Rui extension in VS Code.
Installing the Extension
Method 1: Direct Installation (Recommended)
Click the link below to install the Rui extension directly from the VS Code Marketplace:
Method 2: Through VS Code Extensions View
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X)
- Search for "Rui Support" or "Rui Language"
- Click "Install" on the Rui extension
Method 3: Command Line Installation
code --install-extension PratikDeshpande.rui-supportFeatures
The Rui VS Code extension provides:
- Syntax Highlighting: Color-coded syntax for better readability
- Keyword Support: Full support for Rui keywords (
define,suppose,until,if,else,return,write) - Boolean Support: Syntax highlighting for
trueandfalse - Variable and Function Names: Proper highlighting for identifiers
- String Support: Both single (
') and double (") quote strings - Number Support: Syntax highlighting for numeric literals
- Operator Support: Highlighting for operators and brackets
- Function Arguments: Support for function parameters
- Block and Loop Highlighting: Proper syntax highlighting for code blocks and loops
- File Association: Works with
.ruifiles
Syntax Highlighting
Once installed, .rui files will have syntax highlighting:
// Comments are highlighted
define greet(name) {
write("Hello, " + name + "!")
}
// Keywords like 'define', 'if', 'until' are highlighted
if (age >= 18) {
write("Adult")
} else {
write("Minor")
}Code Snippets
The extension includes helpful code snippets:
Function Snippet
Type define and press Tab:
define functionName(parameters) {
// Function body
}If Statement Snippet
Type if and press Tab:
if (condition) {
// Code block
}Until Loop Snippet
Type until and press Tab:
until (condition) {
// Code block
}Error Detection
The extension highlights syntax errors in real-time:
define greet(name {
write("Hello, " + name + "!")
} // Error highlighted hereExample: Setting Up a Project
- Create a new folder for your Rui project
- Open the folder in VS Code
- Create a new file with
.ruiextension - Start coding with full VS Code support
my-rui-project/
├── hello.rui
├── calculator.rui
└── examples/
└── demo.ruiRunning Rui Programs
You can run Rui programs directly from VS Code:
- Open the Terminal (Ctrl+` or Cmd+`)
- Run your Rui program:
rui hello.ruiDebugging
While the Rui extension doesn't include a debugger yet, you can use VS Code's integrated terminal to run and test your programs:
- Open the Terminal
- Run your program
- Check the output for errors
- Fix any issues and re-run
Troubleshooting
Extension Not Working
If the extension isn't working:
- Restart VS Code
- Check if the extension is enabled
- Verify file associations
- Check the Output panel for error messages
Syntax Highlighting Issues
If syntax highlighting isn't working:
- Make sure the file has a
.ruiextension - Check the language mode in the status bar
- Manually set the language mode to "Rui"
IntelliSense Not Working
If auto-completion isn't working:
- Check the extension settings
- Make sure IntelliSense is enabled
- Try pressing Ctrl+Space to trigger manually
Contributing to the Extension
The Rui VS Code extension is open source. You can contribute by:
- Reporting bugs
- Suggesting new features
- Contributing code
- Improving documentation
Visit the Contributing guide for more information.
Next Steps
Now that you have VS Code set up for Rui development, you're ready to start building more complex programs. Check out the Contributing guide to learn how you can help improve Rui.