A Visual Studio Code extension that provides autocompletion support for the Chevere Workflow PHP package.
- Intelligent autocompletion for Chevere Workflow functions and methods
- Code snippets for common patterns
- Quick help command with examples
The extension provides context-aware autocompletions for:
- Core Workflow functions:
workflow()
,sync()
,async()
,variable()
,response()
,run()
- Job methods:
withRunIf()
,withDepends()
Autocompletions include detailed descriptions and appropriate parameter placeholders.
The following snippets are available:
chevere-workflow-import
: Import all Chevere Workflow functionschevere-workflow-class
: Create a class with WorkflowTraitchevere-workflow-try
: Add a try-catch block for workflow error handlingchevere-action
: Create a basic Chevere Action class
Chevere Workflow: Show Help
: Opens a help panel with examples and documentation
- Visual Studio Code 1.70.0 or newer
- PHP files must use the Chevere Workflow package imports for autocompletion to work
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Chevere Workflow"
- Click Install
- Download the .vsix file from Releases
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click the "..." menu in the top-right of the Extensions panel
- Select "Install from VSIX..." and choose the downloaded file
<?php
use function Chevere\Workflow\{workflow, sync, async, variable, response, run};
// Define a workflow
$workflow = workflow(
validate: sync(
new ValidateImage(),
file: variable('file')
),
thumb: async(
new ResizeImage(),
file: variable('file'),
width: 150
),
store: sync(
new StoreFile(),
file: response('thumb', 'path')
)
);
// Run the workflow
try {
$run = run(
workflow: $workflow,
arguments: [
'file' => '/path/to/image.jpg'
]
);
$storedPath = $run->response('store')->string();
} catch (\Chevere\Workflow\Exceptions\WorkflowException $e) {
// Handle error
}
- Clone the repository
git clone https://gitlab.com/trinavoprivate/chevere-workflow-vscode.git
cd chevere-workflow-vscode
- Install dependencies
npm install
- Run ESLint
npm run lint
- Package the extension
npm run package
This extension is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Chevere Workflow - The PHP library this extension supports
If you like this extension, please consider supporting me with a coffee.