ReqCraft VSCode Extension
Syntax highlighting and code completion for .rqc files.
Features
- Syntax Highlighting: Full syntax highlighting for ReqCraft DSL
- Code Completion: Context-aware completions for keywords, types, and annotations
- Snippets: Quick templates for common patterns
- Hover Information: Descriptions for keywords and annotations
Supported Syntax
Keywords
import - Import other files
config - Configuration block
variable - Global variable definition (type optional, defaults to String)
header - Global header definition
api - API endpoint definition
category - Group APIs together
get, post, put, delete, patch - HTTP methods
request, response - Request/response schemas
Types
String - String type
Number - Number type
Boolean - Boolean type
Any - Any type
Annotations
@mock("value") - Mock value for testing
@example("value") - Example value
@params - Mark as URL query parameter
@default("value") - Default value for headers
Installation
From VSIX
Build the extension:
cd extensions/reqcraft-vscode
npm install
npm run compile
npx vsce package
Install in VSCode:
- Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Click "..." menu → "Install from VSIX..."
- Select the generated
.vsix file
Development
- Open the
extensions/reqcraft folder in VSCode
- Press F5 to launch the Extension Development Host
- Open a
.rqc file to test
Example
import "./openapi.json"
config {
baseUrl http://localhost:3000
variable apiVersion default("v1")
variable workspaceId
header Authorization @default("Bearer token")
header X-API-Key
}
category user {
name "User"
desc "User management APIs"
prefix "/user"
api /info {
/**
* Get user information
*/
get {
name "Get User Info"
request {}
response {
username String @mock("john_doe")
age Number @mock(25)
email String
}
}
}
}
License
MIT
| |