hbs-lsp brings Handlebars language server support to VS Code for non-Ember projects such as Express, Fastify, Eleventy, and custom Node applications.
Features
- syntax diagnostics
- completions for common Handlebars patterns
- hover information for helpers and partials
- formatting
- semantic tokens
- document symbols and folding ranges
- workspace indexing for helpers and partials
Getting started
- Install the extension.
- Open a workspace containing
.hbsor.handlebarsfiles. - Open a Handlebars file to start the language server.
The extension bundles the language server, so no separate global npm install is required.
Commands
The extension contributes these commands:
hbs-lsp: Show Indexhbs-lsp: Reindex Workspacehbs-lsp: Show Outputhbs-lsp: Restart Server
Configuration
Settings are available under the handlebars.* namespace in VS Code settings.
Common settings include:
handlebars.indentSizehandlebars.enableDiagnosticshandlebars.enableFormattinghandlebars.indexWorkspaceSymbolshandlebars.helpershandlebars.partialshandlebars.partialRoots
Notes
- Workspace indexing runs on startup and when you manually reindex.
- The server is bundled inside the extension package.
Troubleshooting
If the extension is not behaving as expected:
- run
hbs-lsp: Show Outputto inspect server logs and request errors - run
hbs-lsp: Restart Serverafter changing settings or if the server seems stuck - run
hbs-lsp: Reindex Workspaceif helpers or partials are missing - make sure your files use the
.hbsor.handlebarsextension
See CHANGELOG.md for release history.