vscode-fastly-vclA Visual Studio Code extension which adds syntax highlighting for Fastly Varnish Configuration Language (VCL) files. FeaturesThis uses a JSON TextMate language grammar: syntaxes/vcl.tmLanguage.json, a structured collection of regular expressions, to tokenize the text into scopes such as:
For example, the extension scopes Fastly code macros as control keywords using a regular expression in JSON:
Visual Studio Code themes such as GitHub Dark Default or the default Light+ map scopes to colours and styles. The GitHub Dark default theme maps the keyword scope to red using a JavaScript object:
This was built entirely from the public VCL reference. The screenshots above are of VCL boilerplate using the GitHub Dark Default theme and the JetBrains Mono font and using Visual Studio Code's default Light+ theme and the Cascadia Code font. Installation from MarketplaceThe extension is in the Visual Studio Code Marketplace. To install in Visual Studio Code, switch to the Extensions View and search for “Fastly”. Select the “Fastly Varnish Configuration Language (VCL)” extension and use the Install button. The extension will syntax highlight code for any file with a .vcl extension. Installation from GitHubAlternatively, to install the extension from GitHub: Uninstall (or disable) any previously-enabled VCL extensions. Download the latest GitHub release and then run:
DevelopmentContributingPlease open a pull request with your changes. DependenciesInstall NPM - Node.js Package Manager
Install VSCE - Visual Studio Code Extensions is a command-line tool for packaging, publishing and managing VS Code extensions
Install Electron - Node module helps you test VS Code extensions
Building and Installing
TestingTo run the grammar tests:
The test cases are stored as markdown files under RequirementsNone. Extension SettingsNone. Known IssuesNone. Release Notes[1.0.4] - 2022-11-03Changed
[1.0.3] - 2022-10-10Added
[1.0.2] - 2022-10-04Changed
[1.0.1] - 2022-09-07Added
Changed
[1.0.0] - 2022-09-06
TODO
ContributorsSpecial thanks to all contributors: FutureIs this useful? Let me know! Leon Brocard <leon@fastly.com> |