Oxide Language Extension for VS Code
A comprehensive Visual Studio Code extension for the Oxide programming language (.ox files) with full support for OGRE GUI framework.
Created by Spyxpo Technologies Private Limited
Features
Syntax Highlighting
- Complete syntax highlighting for all Oxide language constructs
- Keywords, types, operators, strings, numbers, and comments
- OGRE GUI widgets and methods
- Module functions and built-in functions
IntelliSense & Autocomplete
- Context-aware code completion
- Keyword and type suggestions
- OGRE widget completions with snippets
- Built-in function signatures
- Document symbol completions (functions, classes, variables)
Error Detection
- Real-time syntax error detection
- Unclosed block detection (
func/endfunc, if/endif, etc.)
- Mismatched parentheses and brackets
- Unclosed string detection
- Common mistake warnings (e.g.,
= vs == in conditions)
- Invalid variable name detection
- Automatic indentation
- Operator spacing
- Consistent code style
- Format on save support
Code Navigation
- Go to Definition (F12)
- Hover documentation for keywords, types, and OGRE widgets
- Document outline/symbol navigation
- Breadcrumb support
Code Runner
- Run Oxide files directly from VS Code
- Run in integrated terminal
- Run with custom arguments
- Stop running processes
- Hot reload support for OGRE GUI development
Snippets
- 50+ code snippets for common patterns
- Function and class templates
- Control flow snippets
- OGRE GUI component snippets
- Full app templates
Supported Syntax
Control Flow
if condition
# code
elseif other
# code
else
# code
endif
while condition
# code
endwhile
for i = 1 to 10
print i
endfor
for item in items
print item
endfor
Functions & Classes
func add(a, b)
return a + b
endfunc
class Person
func init(name)
self.name = name
endfunc
func greet()
print "Hello, " + self.name
endfunc
endclass
p = new Person("Alice")
p.greet()
Pattern Matching
match status
case 200 => print "OK"
case 404 => print "Not Found"
default => print "Unknown"
endmatch
Error Handling
try
result = riskyOperation()
catch error
print "Error: " + error
finally
cleanup()
endtry
OGRE GUI
use ogre
scaffold = Scaffold()
appBar = AppBar()
appBar.title("My App")
appBar.backgroundColor("#6200EE")
scaffold.appBar(appBar)
body = Column()
body.spacing(16)
text = Text("Hello World!")
text.fontSize(24)
text.bold()
body.add(text)
btn = Button("Click Me")
btn.backgroundColor("#6200EE")
btn.onTap(handleClick)
body.add(btn)
scaffold.body(body)
RunApp(scaffold)
Commands
| Command |
Description |
Shortcut |
Oxide: Format Document |
Format the current file |
Cmd+Shift+F / Ctrl+Shift+F |
Oxide: Run File |
Run the current Oxide file |
F5 |
Oxide: Run File in Terminal |
Run in integrated terminal |
Cmd+F6 / Ctrl+F6 |
Oxide: Run File with Arguments |
Run with custom arguments |
Cmd+Shift+F6 / Ctrl+Shift+F6 |
Oxide: Stop Running |
Stop the running process |
Shift+F5 |
Oxide: Start Hot Reload |
Start hot reload server |
Cmd+F5 / Ctrl+F5 |
Oxide: Stop Hot Reload |
Stop hot reload server |
- |
Oxide: Restart Hot Reload |
Restart hot reload server |
Cmd+Shift+F5 / Ctrl+Shift+F5 |
Oxide: Check Syntax |
Check for syntax errors |
- |
Extension Settings
| Setting |
Default |
Description |
oxide.formatOnSave |
true |
Format Oxide files on save |
oxide.indentSize |
4 |
Number of spaces for indentation |
oxide.enableDiagnostics |
true |
Enable real-time error detection |
oxide.compilerPath |
"" |
Path to the Oxide compiler |
oxide.maxDiagnosticProblems |
100 |
Maximum number of problems to report |
oxide.enableHotReload |
true |
Enable hot reload for OGRE GUI files |
oxide.hotReloadPort |
8765 |
Port for hot reload server |
Snippets
Type these prefixes and press Tab to insert snippets:
Basic
func - Function definition
class - Class definition
if, ife, ifeif - Conditional statements
while - While loop
for, foreach - For loops
try, tryf - Try-catch blocks
match - Pattern matching
lambda - Lambda function
struct - Struct definition
enum - Enum definition
OGRE GUI
scaffold - Full app scaffold
appbar - AppBar widget
text - Text widget
button - Button widget
container - Container widget
column, row - Layout widgets
textfield - TextField widget
card - Card widget
fab - FloatingActionButton
listview - ListView widget
gridview - GridView widget
ogreapp - Complete OGRE app template
Utility
pr - Print statement
prv - Print variable
inp - Input statement
use - Module import
const, var - Variable declarations
readfile, writefile - File operations
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Cmd+Shift+X / Ctrl+Shift+X)
- Search for "Oxide Language"
- Click Install
From VSIX
- Download the
.vsix file from the releases page
- In VS Code, open Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
- Run "Extensions: Install from VSIX..."
- Select the downloaded file
From Source
cd vscode-oxide-extension
npm install
npm run compile
Then press F5 in VS Code to launch the extension development host.
Building the Extension
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Package extension
npx vsce package
Requirements
- VS Code 1.74.0 or higher
- Oxide compiler (optional, for running files)
Known Issues
Please report any issues on the GitHub issue tracker.
Release Notes
See CHANGELOG.md for release notes.
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests on the GitHub repository.
Oxide Language is developed and maintained by Spyxpo Technologies Private Limited.