WFL EXTENSION
Description
WFL Extension is a Visual Studio Code extension. This extension has been created to make the reading and writing Workflow (wfl) scripts an overall more pleasant experience. It allows wfl to be selected as a language in Visual Studio Code and borrows javascript syntax to add the color to .wfl
documents that one expects when writing code. The extension also comes equipt with a language server which adds intellisense (auto-completion), diagnostics, and hovering capabilities to .wfl
documents. The language server is activated when a .wfl
file has been saved.
Structure
.
├── client // Language Client
│ └── src
│ └── extension.ts // Language Client entry point
├── package.json // The extension manifest.
├── server // Language Server
| └── src
| └── server.ts // Language Server entry point
├── syntaxes // Language Syntaxes
└── wfl.tmLanguage.json // Language Syntax Description
Set-Up
Step 1:
Move the wflextension
folder into your .vscode extensions folder. This can likely be found in the following location: C:\Users\YOUR_USER\.vscode\extensions. Be sure to fill in YOUR_USER with your User. The file structure should look as so:
├── C:
└── Users
└── YOUR_USER
└── .vscode
└── extensions
└── *wflextension
Step 2:
WFL Extension uses dib -pd (-property-docs), a dib executable capability, which prints the dib property documentation for all components in json syntax. This extension comes with a file containing this output called dibPD.json, which is found in the following location:
├── wflextension
└── server
└── out
└── *dibPD.json
If new properties are created, or property documentation is updated, then this json file will need to be replaced so that it is up-to-date. This can be done through the dib executable:
After building dib.exe, navigate the dib\out\win\bin directory and run the following:
dib -pd > C:\Users\YOUR_USER\.vscode\extensions\wflextension\server\out\dibPD.json
Be sure to fill in YOUR_USER with your User. If your .vscode\extensions folder is in a different location, use that location.
Step 3:
If you save a .wfl
file, it can change into a Docker file. However, there is a fix for this.
Make sure to configure your VSCODE user settings for the wfl language:
- Do Command+Shift+P to open your command palette. In the box, search for 'Open Settings (JSON)' and click it to open the settings.json file.
- Make sure that this file has the following code:
"files.associations": {
"*.wfl": "wfl"
},
- Regarding the above step, if "wfl" says "dockerfile", change it to wfl.
Step 4:
To get started, open a new Visual Studio Code file and select the language as WorkFlow (wfl).
Save the document as a .wfl
. Make sure that the language is Workflow
on the bottom right of Visual Studio Code.
Features
This Language Server works for wfl (Workflow) files. It has the following language features:
Intellisense:
Auto-completion for categories (ie. VideoCompressors, AudioAnalyzers, etc.), fourCC's, properties, and defined variables. Extra details for each of these are included in the Read More arrow.
Hovering:
Hover your cursor over categories, fourCC's, properties, variables to see details.
Diagnostics:
Diagnostics are regenerated on each file change. Checks for unknown or missing categories, fourCC's, properties, and variables.
Running in Debug
- Run
npm install
in this folder. This installs all necessary npm modules in both the client and server folder
- Open VS Code on this folder.
- Press Ctrl+Shift+B to compile the client and server.
- Switch to the Debug viewlet.
- Select
Launch Client
from the drop down.
- Run the launch config.
- If you want to debug the server as well use the launch configuration
Attach to Server
- In the [Extension Development Host] instance of VSCode, open a document in 'wfl' language mode (use wfl syntax extension for this).
- Type
new
to get a completion list of categories (and many more features!)