runn-code-ext
Note: This is a personal extension built for personal use. Features and functionality are tailored to individual workflow preferences and may not suit all use cases.
A comprehensive VS Code extension that provides rich support for runn scenario files. Enhance your runn testing workflow with intelligent features including scenario exploration, auto-completion, navigation, and real-time validation.
🚀 Features
📋 Scenario Explorer
- Tree View: Hierarchical display of open runn scenario files
- Smart Navigation: Click any item to jump directly to its definition
- Flexible Display: Toggle between step names and descriptions as labels
- Real-time Updates: Automatically refreshes when files change
🧠 IntelliSense Support
- Variable Auto-completion: Smart suggestions for
{{ vars.* }}
expressions
- Path Completion: Auto-complete file paths in
include.path
- OpenAPI Integration: Endpoint completion when
openapi3
is specified
- HTTP Method Support: Suggestions for HTTP methods and common headers
🔍 Navigation & References
- Go-to-Definition: Jump to variable and bind definitions
- Find References: Locate all usages of variables and binds
- Clickable Paths: Navigate to included files with Ctrl+Click
⚡ Real-time Validation
- Variable Diagnostics: Highlights undefined variable references
- Include Path Validation: Warns about missing or invalid include files
- Syntax Checking: Real-time YAML and expression validation
🎯 CodeLens Integration
- Run Scenarios: Execute scenarios directly from the editor
- Configurable Scopes: Customize execution scopes
🎨 Syntax Highlighting
- Runn Expressions: Highlighting for runn-specific syntax
- YAML Enhancement: Enhanced YAML support for runn scenarios
📦 Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
)
- Search for "runn-code-ext"
- Click "Install"
From VSIX Package
- Download the latest
.vsix
file from releases
- In VS Code, run
Extensions: Install from VSIX...
- Select the downloaded file
🖥️ Usage
Scenario Explorer
- Open runn scenario files (
.yaml
files with runn structure)
- Access the explorer via the Runn icon (🚀) in the Activity Bar
- Navigate your scenarios:
- Expand files to see sections (Description, Runners, Variables, Steps)
- Click items to jump to their definitions
- Use the toggle button (↔️) to switch between step names and descriptions
Language Features
Variable Auto-completion
vars:
user_id: 12345
api_key: "secret"
steps:
test_step:
api_client:
get:
url: "/users/{{ vars.us|" # Triggers completion
Include Path Completion
steps:
setup:
include:
path: "./common/|" # Triggers file path completion
Navigation
- Ctrl+Click on variable references to go to definition
- F12 for Go-to-Definition
- Shift+F12 for Find References
Running Scenarios
Use CodeLens buttons that appear above scenario descriptions:
desc: |
This scenario tests user authentication
# ▶️ Run button appears here
steps:
# Your test steps...
⚙️ Configuration
Extension Settings
runn-code-ext.enableCodeLens
- Type:
boolean
- Default:
true
- Description: Enable/disable CodeLens for running scenarios
runn-code-ext.runScopes
- Type:
array
- Default:
["run:exec", "read:parent"]
- Description: Default scopes passed to runn command execution
runn-code-ext.scenarioExplorer.showDescAsLabel
- Type:
boolean
- Default:
false
- Description: Show step descriptions as labels instead of step names
Configuration Example
{
"runn-code-ext.enableCodeLens": true,
"runn-code-ext.runScopes": ["run:exec", "read:parent"],
"runn-code-ext.scenarioExplorer.showDescAsLabel": false
}
🔧 Development
Prerequisites
- Node.js 16+
- VS Code 1.96.0+
Setup
# Clone the repository
git clone <repository-url>
cd runn-code-ext
# Install dependencies
npm install
# Compile TypeScript
npm run compile
Development Workflow
# Watch mode for development
npm run watch
# Create package for distribution
npm run vscode:package
# Run linting
npm run lint
Testing
- Press
F5
to launch Extension Development Host
- Open sample files from the
sample/
directory
- Test features in the development environment
📋 Requirements
- VS Code: Version 1.96.0 or higher
- runn: For executing scenarios (optional)
🙏 Acknowledgments
- runn - The awesome testing tool this extension supports
- VS Code Extension API documentation and community