✨ Overview
S&box API Tools is a comprehensive VS Code extension that brings enterprise-grade development tools to the S&box game engine framework. Leveraging the official S&box API schema, this extension provides real-time code completions, intelligent diagnostics, hover documentation, and a rich library of code snippets—all optimized for C# game development.
Perfect for both beginners building their first game and experienced developers scaling complex multiplayer projects.
🚀 Key Features
🎯 Intelligent Code Completions
- Complete API autocomplete for all S&box types, attributes, and static members
- Context-aware suggestions that adapt to your current code
- Optimized result filtering (configurable limit up to 5000 items)
📚 Inline API Documentation
- Hover over any S&box API symbol to see full documentation
- Direct links to official API reference pages
- Instant context without switching windows
🔍 Smart Linting & Validation
- Unknown Symbol Detection: Warns about
Sandbox.* references not in the bundled API
- Obsolete API Warnings: Highlights deprecated types and members automatically
- Missing Using Statements: Suggests adding
using Sandbox; when needed
- Real-time or on-save validation (configurable)
⚡ Code Snippets (18+ Templates)
Create common S&box patterns in seconds:
- Components: Basic components, spawnable components, pawn classes
- Gameplay: Health systems, projectiles, trigger volumes
- Networking: Synchronized properties, network events
- Input & Physics: Input handlers, raycasts
- UI: Panel code-behind
- Patterns: Game manager singleton, async tasks, error handling
- ...and more
🎨 C# Syntax Enhancement
- S&box-aware TextMate injection grammar
- Semantic token highlighting for framework-specific constructs
📦 Installation
From VS Code Marketplace (Recommended)
- Open VS Code
- Press
Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (macOS)
- Search for "S&box API Tools"
- Click Install
Manual Installation (VSIX)
npm install -g @vscode/vsce
vsce package
Then use Extensions → ... → Install from VSIX...
🎯 Quick Start
1. Using Snippets
Type "sbox-component" and press Tab
↓
Instant Component class template
2. Getting API Completions
Type: var thing = new Sandbox.
↓
See all available S&box types
3. Viewing API Documentation
Hover over any Sandbox.* symbol
↓
See full docs + link to official reference
4. Validating Your Project
Press Ctrl+Shift+P (Cmd+Shift+P on macOS)
Run: "S&box: Validate Workspace"
↓
Get diagnostics for the entire project
📋 Available Snippets
| Prefix |
Description |
Example |
sbox-component |
Basic component class |
Component with lifecycle methods |
sbox-pawn |
Player-controlled entity |
Pawn with movement and input |
sbox-spawnable |
Editor-spawnable component |
Title, category, and icon attributes |
sbox-trigger |
Trigger volume |
Collider-based enter/exit events |
sbox-sync-prop |
Networked property |
Synchronized with [Sync] attribute |
sbox-concmd |
Console command |
ConCmd with parameter binding |
sbox-input |
Input handler |
Input.Pressed/Released patterns |
sbox-raycast |
Physics raycast |
Scene.Trace with hit detection |
sbox-sound |
Audio playback |
Sound.Play with spatial audio |
sbox-model |
Load and assign model |
Model loading with fallback |
sbox-anim |
Play animation |
Animation property binding |
sbox-netevent |
Network event broadcast |
Broadcast-decorated method |
sbox-health |
Health system |
Full health component with events |
sbox-projectile |
Projectile physics |
Velocity and gravity-based motion |
sbox-gamemanager |
Game manager singleton |
Singleton pattern implementation |
sbox-uipanel |
UI panel code-behind |
Panel class with stylesheets |
sbox-async |
Async task with delay |
Task.Delay pattern |
sbox-try |
Try-catch error handling |
Exception handling template |
⚙️ Configuration
All settings are accessible via VS Code's Settings menu. Search for "S&box" or configure directly in settings.json:
Core Settings
{
"sboxValidator.enable": true,
"sboxValidator.validateOnChange": true,
"sboxValidator.lintUnknownFullyQualifiedSymbols": true,
"sboxValidator.lintObsoleteApi": true,
"sboxValidator.lintMissingUsingSandbox": true
}
Severity Customization
{
"sboxValidator.unknownSymbolSeverity": "warning", // error | warning | information | hint | off
"sboxValidator.obsoleteApiSeverity": "warning", // error | warning | information | hint | off
"sboxValidator.missingUsingSeverity": "information" // error | warning | information | hint | off
}
{
"sboxValidator.maxCompletionItems": 800, // 50 - 5000
"sboxValidator.apiReferenceBaseUrl": "https://sbox.game/api/"
}
🧪 Development & Testing
Set Up Development Environment
- Clone this repository
- Open the folder in VS Code
- Press
F5 to launch the Extension Development Host
Test Against Sample Project
- Open
test-fixture/TestComponent.cs in the development host
- Run S&box: Validate Workspace from the command palette
- Verify diagnostics and completions work correctly
Note: No npm install required—the extension uses only the VS Code API.
📚 Recommended Extensions
For the optimal S&box development experience, also install:
| Extension |
Purpose |
| C# Dev Kit |
Official C# language support by Microsoft |
| Prettier |
Code formatter (C# style) |
Pro Tip: Install the C# Dev Kit first for best results with this extension.
🔧 Commands
| Command |
Shortcut |
Function |
| S&box: Validate Workspace |
— |
Run validation on all C# files in workspace |
| S&box: Show Loaded API Stats |
— |
Display API schema statistics and loaded types |
| S&box: Open API Page |
— |
Open current symbol's reference on sbox.game |
🎓 Learning Resources
⚠️ Limitations & Future Work
This extension is schema-driven and designed for pragmatic S&box-specific checks. It does not replace:
- C# Dev Kit or Roslyn for full language analysis
- Real-time compilation or runtime error detection
🤝 Contributing
Found a bug or want to suggest a feature? Contributions are welcome!
- Report Issues: Use GitHub Issues to report bugs
- Feature Requests: Describe your idea and use case
- Pull Requests: Submit improvements with clear descriptions
📝 License
Licensed under the MIT License. See LICENSE for details.