Skip to content

VS Code Extension

IDE support with snippets, autocomplete, and validation for Orbit.

Installation

Search for "Orbit" in VS Code extensions marketplace, or install from VSIX:

bash
code --install-extension orbit-vscode-0.1.0.vsix

Features

Code Snippets

Type the prefix and press Tab to insert snippets:

PrefixDescription
bg-moduleCreate a module
bg-controllerCreate a controller
bg-serviceCreate a service
bg-guardCreate a guard
bg-pipeCreate a pipe
bg-interceptorCreate an interceptor
bg-middlewareCreate middleware
bg-filterCreate exception filter

Module Snippet

typescript
// Type: bg-module + Tab
@Module({
  imports: [],
  controllers: [],
  providers: [],
  exports: [],
})
export class ${1:Name}Module {}

Controller Snippet

typescript
// Type: bg-controller + Tab
@Controller('${1:path}')
export class ${2:Name}Controller {
  constructor(private readonly ${3:service}: ${4:Service}) {}

  @Get()
  findAll() {
    return this.${3:service}.findAll();
  }
}

Decorator Autocomplete

Press @ to see available decorators:

  • @Module - Module decorator
  • @Controller - Controller decorator
  • @Injectable - Injectable decorator
  • @Get, @Post, @Put, @Delete, @Patch - Route decorators
  • @UseGuards, @UsePipes, @UseInterceptors - Pipeline decorators

Diagnostics

Real-time validation of decorators:

  • Warns when controllers have no providers
  • Validates module structure
  • Checks for common mistakes

Commands

Access via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

CommandDescription
Orbit: Generate ModuleGenerate a new module
Orbit: Generate ControllerGenerate a new controller
Orbit: Generate ServiceGenerate a new service
Orbit: Show DI GraphVisualize dependency injection
Orbit: Show RoutesView all application routes

Configuration

Settings (File > Preferences > Settings):

json
{
  "orbit.enableDiagnostics": true,
  "orbit.showInlineHints": true,
  "orbit.formatOnSave": false
}

More Snippets

GraphQL

PrefixDescription
bg-resolverCreate a resolver
bg-objecttypeCreate an ObjectType
bg-inputtypeCreate an InputType

Microservices

PrefixDescription
bg-handlerCreate message handler
bg-gatewayCreate WebSocket gateway

Testing

PrefixDescription
bg-testCreate unit test
bg-e2e-testCreate e2e test

Keyboard Shortcuts

  • Ctrl+Shift+G (Windows/Linux) or Cmd+Shift+G (Mac): Generate component
  • Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac): Show routes

Tips

  1. Quick Module Creation: Use bg-module snippet and fill in the name
  2. Add Route: Position cursor in controller, use bg-get or bg-post
  3. View Dependencies: Use "Show DI Graph" to visualize module structure
  4. Debug Routes: Use "Show Routes" to see all registered endpoints

Released under the MIT License.