A VSCode extension for Twig and DQL in any PHP project. Special support for Symfony projects.
New in version 1.0.7
- basic support for entities defined in xml files (only in Symfony projects; only definition, hover and completion in DQL literals)
New in version 1.0.6
- support for Symfony projects starting from version 2.8 of Symfony
- basic support for arbitrary PHP projects (see here)
Search for references to entity field in dql and twig.
Completion in dql
Completion for route in `href`.
Completion for autowired typehints (start typing with '.')
Support means some combination of completion, definition, hover, reference search and signature help.
- Support for user-defined and vendor-defined functions, filters, tests and globals
- Support for variables defined in
AbstractController#render(),{%set%}andtwig.yaml - Support for macros
- Support for properties and methods of objects
- Support for first argument of functions
path(),url(),constant() - Support for template names in
extendsandincludetags - Support for block names
- Special completion of route name in
href - Snippets for tags
- They are active only outside of
{%%},{{}}and{##} {%end*%}and{%else*%}are autoindented after completion
- They are active only outside of
- Folding
Extend Templatecommand
Position and layout of used blocks are stored in.symfony-helper.jsonfile and can be configured by hand.Toggle Twig Commentcommand
It uncomments comment when cursor is inside of the comment.
It comments selected block of text when that block is not inside comment.Open Compiled Templatecommand
It opens compiled form of template fromvar/cache/dev/twig/
- Support for entities and entity fields in dql string literals
- Definition and hover for
repositoryClassandtargetEntityin annotations of entity classes
- Completion for autowired typehints (start typing with '.' because I don't want intersection with php intellisense)
- Support for first argument of methods
generateUrl(),render(),get(),getParameter()ofAbstractController - Support for first argument of
UrlGeneratorInterface#generate()
- Definition and hover for
controllerfield in routing files
In service definition files
- Definition and hover for
classandaliasattributes of<service> - Definition and hover for
idattribute of<argument type="service">in service definitions
- Install
vscode-symfony-helper.phpinto thepublic/orweb/folder of your project withInstall Http Helpercommand. - Configure web server of container to access installed file with browser.
- Properly set
symfonyHelper.consoleHelper.*settings.
- Extension needs a globally installed php interpreter (see
symfonyHelper.phpParser.phpPathsetting) - For best speed, set
symfonyHelper.phpParser.phpPathto php withoutxdebug
- If type of a variable aren't recognized in twig, try
@varannotation. - Add
phptoemmet.excludeLanguages, because emmet gives useless suggestions in dql queries. - This extension doesn't really make sense without a vscode extension for php. The best one is probably PHP Intelephense.
- Finish support for twig and dql in arbitrary php projects
- Add support for dql query builder (definition and completion for entity fields, refactoring to dql and from dql)
- Make sure that language server is really reusable



