A complete VS Code extension for the Phlow language - the low-code Rust runtime for modular backends.
.phlowfiles behave exactly like YAML- Complete syntax highlighting for YAML
- **Automa- β Numbers: Integer and float highlighting (cyan)
- β
Booleans:
true/falsehighlighted (orange) - π PHS expressions: Full PHS syntax in quoted values
β οΈ Argument validation: Warns about unused include arguments
New Argument Validation:
- Detects unused arguments in
!includestatements - Scans target files for
!argusage patterns - Real-time warnings for better code quality 2-space indentation** (YAML standard)
- Block and structure folding
- Real-time YAML syntax validation
- Support for all YAML data types (strings, numbers, booleans, arrays, objects)
- Multi-line strings (
|and>) - Comments and nested structures
- Format on save and type enabled by default
.phsfiles with complete syntax highlighting (based on Rhai)- Automatic 4-space indentation (Rust standard)
- Inline PHS in
.phlowand.yamlfiles after!phsdirectives - Autocomplete and snippets for Rhai/PHS syntax
- Hover documentation for PHS functions and variables
- Automatic indentation and folding for code blocks
- Phlow-specific functions:
main,payload,steps,envs - Format on save and type enabled by default
- Special highlighting for Phlow keywords (
main,modules,steps, etc.) - Recognition of special directives (
!phs,!include,!import) - Enhanced !include arguments: Type-aware syntax highlighting for include arguments
- Highlighting for known modules (cli, postgres, log, http_server)
- Phlow-specific schema validation for phlows
- phlow-basic: Basic phlow structure with CLI
- phlow-simple: Simple phlow without modules
- phlow-cli-module: CLI module configuration
- phlow-step-assert: Step with conditional logic
- phlow-step-use: Step using modules
- phs: Phlow Script expressions
- And much more...
- Dynamic module validation - Validates any module from the Phlow repository
- Local module support - Full support for local modules in workspace
- Phlow Modules (.phlow) - Support for both
.phlowand.yamlmodule formats - Relative path modules - Support for
./route,../utils, etc. - Go to Definition - Ctrl+Click or F12 to navigate to module files
- Automatic module discovery - Fetches available modules from GitHub API and local files
- Smart autocompletion for module properties based on their schemas
- Enhanced hover documentation with module-specific information and links
- Dynamic schema fetching from GitHub repository for up-to-date module information
- Local module priority - Local modules take precedence over remote ones
- Multiple search locations - Searches in root, modules/ subdirectory
- Property validation for module
withconfigurations - Required property detection and warnings
- File watching - Automatically updates when local modules change
- Real-time cache invalidation - Smart cache management for local modules
- No module restrictions - Use any module that exists locally or in the Phlow repository
- Run Phlow Phlow: Execute the current phlow in terminal
- Run Phlow Tests: Execute the phlow tests using
phlow file.phlow --test - Validate Phlow Phlow: Comprehensive validation with detailed error reporting
- Create New Phlow Phlow: Wizard to create new phlows
- Format Document (Phlow Style): Apply proper indentation (2 spaces for .phlow, 4 for .phs)
- Clear Module Cache: Clear cached module schemas (useful for development)
- Native VS Code Test Explorer: All Phlow tests appear in the built-in Test Explorer
- Individual Test Execution: Run specific tests or entire test suites
- Real-time Discovery: Automatically detects and updates tests as you edit files
- Visual Feedback: Clear pass/fail status with detailed error reporting
- Quick Navigation: Jump to test code with a single click
π‘ Tip: Open Test Explorer with
View > Test ExplorerorCtrl+Shift+T
- Module navigation - Ctrl+Click or F12 on module names to navigate to their files
- Include navigation - Ctrl+Click or F12 on
!includefile paths to open included files - Extension-less support - Automatically finds
.phlow,.yaml, or.ymlfiles - Relative path support - Works with
./route,../utils,./modules/auth, etc. - Arguments aware - Navigation works even when include has arguments
- Multi-format support - Automatically finds
.phlowor.yamlmodule files - Smart search - Searches workspace root, modules/ folder, and relative paths
- Real-time feedback - Console logs for debugging file resolution
- Hover for Phlow element documentation
- JSON schema validation
- Module autocomplete:
- Binary modules: Schema-based property completion with type hints
- Local .phlow modules: Autocomplete based on existing
withproperties from target module - Validation: Real-time validation against module schemas
- Path intellisense: Smart completion for relative module paths
- Open VS Code
- Go to Extensions tab (Ctrl+Shift+X)
- Search for "Phlow Language Support"
- Click "Install"
- Use the command
Ctrl+Shift+Pand type "Create New Phlow Phlow" - Choose the desired phlow type
- Enter the phlow name
- The file will be created automatically with a template
- Open a
.phlowfile - Right-click and select "Run Phlow Phlow"
- Or use
Ctrl+Shift+Pand type "Run Phlow Phlow"
- Open a
.phlowfile that contains atests:section - Right-click and select "Run Phlow Tests"
- Or use
Ctrl+Shift+Pand type "Run Phlow Tests" - The extension will execute
phlow file.phlow --testin the terminal
π‘ Tip: Files with tests will show a "π§ͺ Run Tests" CodeLens at the top for quick access
main: cli
name: Hello Phlow
version: 1.0.0
description: My first phlow
modules:
- module: cli
version: latest
with:
additional_args: false
args:
- name: name
description: User name
index: 1
type: string
required: true
steps:
- payload:
greeting: !phs main.name
- return: !phs `Hello, ${payload.greeting}!`main: cli
name: PHS Demo
modules:
- module: cli
version: latest
with:
args:
- name: name
type: string
required: true
steps:
# Inline PHS with complete syntax highlighting
- payload: !phs `{
user_name: main.name,
processed_at: timestamp(),
greeting: if main.name.len() > 0 {
"Hello, " + main.name + "!"
} else {
"Hello, World!"
}
}`
- return: !phs payload.greeting// script.phs - Complete support for Rhai syntax
fn process_data(input) {
let result = #{
original: input,
processed: input.to_upper(),
length: input.len()
};
log("info", `Processed: ${input}`);
return result;
}
// Access to Phlow context
let user_data = main.user_name;
process_data(user_data)main: http_server
name: API with Local Modules
version: 1.0.0
description: Using local modules with navigation support
modules:
# Ctrl+Click on these module names to navigate to their files
- module: ./route # Goes to route.phlow or route.yaml in same folder
- module: ../auth # Goes to auth.phlow or auth.yaml in parent folder
- module: cors # Searches in workspace and modules/ folder
with:
origins: ["*"]
methods: ["GET", "POST"]
steps:
- use: route
with:
method: GET
path: /api/users
- use: cors
- return:
status: 200
body: !phs payloadmain: cli
name: Math Calculator
version: 1.0.0
description: Calculator with test cases
modules:
- module: cli
version: latest
with:
args:
- name: total
type: number
required: true
# Test cases - run with "phlow file.phlow --test"
tests:
- main:
total: 2
payload: 10
assert_eq: "Total is 20"
- main:
total: 3
payload: 5
assert: !phs payload == "Total is 15"
steps:
- payload: !phs main.total * payload
- payload: !phs `Total is ${payload}`- CLI Phlows: Command-line applications
- HTTP Phlows: Web servers and APIs
- Database Phlows: PostgreSQL integration
- Simple Phlows: Data processing without external modules
Execute dynamic inline code:
message: !phs `Hello, ${main.name}!`
condition: !phs main.age > 18Include content from other files with typed arguments:
# Basic include
modules: !include modules.yaml
# Include with arguments (NEW!)
result: !include ./return.phlow target=route_get_authors output='!phs payload'
# Multiple arguments with different types
config: !include ./config.phlow
name=my_service
port=3000
enabled=true
data='!phs main.input'Syntax Highlighting Features:
- π¨ File paths: Clearly highlighted (green)
- π§ Parameter names: Highlighted as variables (blue)
- β‘ Assignment operators:
=highlighted (gray) - π String values: Quoted and unquoted strings (green)
- π’ Numbers: Integer and float highlighting (cyan)
- β
Booleans:
true/falsehighlighted (orange) - π PHS expressions: Full PHS syntax in quoted values
π See INCLUDE_ARGUMENTS_GUIDE.md for detailed syntax examples
Import and execute PHS scripts:
result: !import scripts/calculation.phsThe extension works automatically with .phlow files, which are treated as complete YAML with Phlow-specific features. This means you get:
- β All YAML functionality: indentation, folding, syntax highlighting
- β Phlow-specific features: keywords, directives, validation
- β
Complete compatibility:
.phlowfiles are valid YAML - β
Automatic formatting: 2-space indentation for
.phlow, 4-space for.phs
.phlowfiles: 2 spaces (YAML standard).phsfiles: 4 spaces (Rust standard)- Auto-formatting: Enabled by default (format on save, format on type)
- Manual formatting: Use
Ctrl+Shift+Pβ "Format Document (Phlow Style)"
π See FORMATTING_GUIDE.md for detailed formatting rules and examples
For the best experience:
- Install the Phlow runtime: Official Documentation
- Configure your environment variables in VS Code
- Use the integrated terminal to run phlows
Contributions are welcome! This project is in active development.
- Fork the repository
- Create a branch for your feature
- Make your changes
- Open a Pull Request
MIT
Made with β€οΈ for the Phlow community