@RogerioPradoJ Symfony debug and autocomplete - rogeriopradoj-symfony-debug-and-autocomplete
Debug and autocomplete for Symfony (original code from TheNouillet) - Fork from @n4zim
This extension aims to help developing Symfony2+ projects, by showing services and routes of your current project, and provide autocompletion support with these datas.
It was created by TheNouillet.
Features
This extension add a new view, the Symfony Debug View, to visualize the status of your project container and routes. With this, you can :
- know which controller action is binded to a route
- know which class is binded to a service
- see all services aliases
- ...
This extension also enable autocompletion in YAML files to reference services.
How does it works ?
To detect Symfony projects, this extension rely on composer.json
files with symfony/symfony
, symfony/lts
or symfony/flex
as one of its dependencies.
The composer.json
file is supposed to be at the root of your Symfony project.
When the project is detected, it simply uses the debug:container
and debug:router
console commands to hydrate the views and autocompletions.
Extension Settings
This extension contributes the following settings:
symfony-debug-and-autocomplete.showConsoleErrors
: Set this to false if you don't want to be annoyed by the extension everytime command calls fails.
symfony-debug-and-autocomplete.phpPath
: the path of the PHP executable.
symfony-debug-and-autocomplete.consolePath
: when the console is somewhere else than bin/console
(or app/console
for Symfony 2), override this setting.
symfony-debug-and-autocomplete.showAsseticRoutes
: By default, the route view doesn't show routes generated by AsseticBundle. Set this to true if you want to see them.
symfony-debug-and-autocomplete.detectCwd
: By default, the extension guess the root directory of your Symfony project to execute console commands from. Set this to false if you don't want that.
symfony-debug-and-autocomplete.servicesFilters
: A list of regexs to filter out services to improve autocompletion pertinence.
Troubleshooting
Q: I run my Symfony project on Docker. How do I configure the extension ?
A: You have to override the PHP executable path, and disable the root directory auto-detection, like this :
{
"symfony-debug-and-autocomplete.detectCwd": false,
"symfony-debug-and-autocomplete.phpPath": "docker exec my_container_id /bin/sh -c 'cd /path/to/symfony && /usr/bin/php \"$@\"' -- "
}
Release Notes
See the changelog for releases notes.