Fastly Varnish Configuration Language (VCL) Support for Visual Studio Code
Brings full IDE support for Fastly Varnish Configuration Language (VCL) to Visual Studio Code, from syntax highlighting to intelligent diagnostics. Builds upon on the open source Falco Fastly VCL developer tool. FeaturesSyntax highlighting
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. DiagnosticsReal-time linting surfaces syntax errors and best-practice violations directly in the editor.
Contextual completions and signature helpAs you type, intelligent completions suggest functions, variables, and headers available in your current subroutine. While writing a function call, a tooltip appears showing the function's signature, parameter types, and documentation.
Go to definition and peek definitionNavigate to the definition of ACLs, tables, backends, local variables, and parameters using Ctrl+Click / Cmd+Click or F12.
Peek at definitions using ⌥F12:
Documentation on hoverUpon hover, displays inline documentation for functions (including scope and parameters), variables, subroutines, and HTTP headers.
Find all referencesFind all references to ACLs, tables, backends, and subroutines, local variables, and parameters using Shift+F12 or right-click and select "Find All References".
Document formattingFormat your VCL code using Shift+Alt+F (Shift+Option+F on Mac) or right-click and select "Format Document". The formatter uses
Code foldingCollapse and expand code blocks for easier navigation. Supported regions include subroutines, ACLs, tables, backends, if/else blocks, and comment blocks.
Rename symbolsSafely rename ACLs, tables, backends, subroutines, local variables, parameters, and HTTP headers.
Symbol outline and breadcrumbsThe Outline view in the Explorer sidebar displays a tree of all symbols (subroutines, ACLs, tables, backends, directors, and penaltyboxes) in the current file for quick navigation. Breadcrumbs at the top of the editor show your current location within the document structure.
Document highlightsWhen the cursor is on a symbol, all occurrences of that symbol in the current document are highlighted. Works with ACLs, tables, backends, subroutines, HTTP headers (e.g.,
Semantic highlightingSemantic tokens provide richer code coloring based on meaning. Built-in functions and variables like Workspace symbolsQuickly find and navigate to subroutines, backends, ACLs, tables, and other symbols across all open VCL files using Cmd+T (Ctrl+T on Windows/Linux).
Inlay hintsInline type annotations appear next to variable assignments, showing the type of both local variables (
Selection rangesSmart expanding selection lets you progressively select larger syntactic units using Cmd+Shift+→ (Ctrl+Shift+→ on Windows/Linux). Selection expands from word to statement to block to subroutine.
InstallationFrom 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. From GitHubAlternatively, to install the extension from GitHub: Uninstall (or disable) any previously-enabled VCL extensions. Download the latest GitHub release and then run:
RequirementsNodeJS LTS. Extension Settings
Known IssuesUse our GitHub issues to report a problem or request a feature. ContributorsSpecial thanks to all contributors: FutureIs this useful? Let me know! Leon Brocard <leon@fastly.com> |














