A comprehensive Visual Studio Code extension providing advanced support for VRL (Vector Remap Language) files.
- Complete VRL syntax highlighting with proper tokenization
- Support for functions, keywords, operators, strings, and comments
- Field path highlighting with proper scoping
- Error and fallible function highlighting
- Auto-completion for all VRL built-in functions
- Context-aware field path suggestions
- Function signatures with parameter hints
- Smart snippets for common VRL patterns
- Hover Information: Detailed documentation for functions and keywords
- Real-time Diagnostics: Syntax and semantic error detection
- Error Handling Validation: Ensures proper use of fallible functions
- Best Practice Suggestions: Performance and maintainability hints
- Validate Script (
Ctrl+Shift+V): Comprehensive VRL script validation - Format Document: Auto-format VRL code with proper indentation
- Show Documentation: Quick access to Vector documentation
- Real-time syntax error detection
- Semantic validation for function calls
- Warning system for potential issues
- Type validation suggestions
# Build and install the extension
make install
# Or build only
make build# Install dependencies
npm install
# Compile and package
npm run compile
npm run package
# Install the generated .vsix file
code --install-extension vscode-vrl-*.vsixCreate a .vrl file and start typing:
# Parse JSON message
. = parse_json!(.message)
# Add timestamp
.processed_at = now()
# Transform log level
.level = upcase(.level)
# Conditional processing
if contains(.message, "error") {
.severity = "high"
log("High severity event detected", level: "warn")
}
# Clean up
del(.temp_field)
The extension provides intelligent suggestions as you type:
- Type
parse_to see all parsing functions - Use
.to access field paths with auto-completion - Error handling is automatically suggested for fallible functions
- Hover over functions to see documentation and examples
Access settings through File > Preferences > Settings and search for "VRL":
{
"vrl.enableIntelliSense": true,
"vrl.enableErrorChecking": true,
"vrl.enableTypeHints": true,
"vrl.maxErrorCount": 100
}- Node.js (16+)
- Visual Studio Code
- TypeScript
# Clone and setup
git clone <repository-url>
cd vscode-vrl
make dev-setup
# Start development
make watch
# Run tests
make testmake- Build the extensionmake install- Build and install to VSCodemake clean- Clean build artifactsmake test- Run test suitemake lint- Run code lintingmake watch- Development watch modemake info- Show build information
This extension supports the complete VRL syntax including:
- Parsing:
parse_json,parse_syslog,parse_regex,parse_key_value,parse_csv,parse_timestamp - Type Conversion:
to_string,to_int,to_float,to_bool,to_timestamp - String Manipulation:
contains,starts_with,ends_with,replace,split,join,upcase,downcase - Array/Object Operations:
merge,keys,values,filter,map,reduce - Encoding:
encode_base64,decode_base64,encode_percent,decode_percent - Hashing:
sha1,sha2,sha3,md5,hmac - Utilities:
uuid_v4,now,type,length,assert
- Field path expressions (
.field.subfield) - Error handling with
!and??operators - Conditional statements (
if,else) - Comments (
# comment) - All VRL data types and literals
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
make test - Submit a pull request
- Check VSCode version compatibility (requires 1.85+)
- Reload VSCode:
Developer: Reload Window - Check console for errors:
Help > Toggle Developer Tools
- Ensure file has
.vrlextension - Check language mode in status bar
- Try
View > Command Palette > Change Language Mode > VRL
- Verify
vrl.enableIntelliSenseis true in settings - Check for TypeScript errors:
make lint - Restart extension host:
Developer: Reload Window
MIT License - see LICENSE file for details.