@@ -461,10 +461,52 @@ doubling them to prevent Symfony from interpreting them as container parameters)
461461 };
462462
463463 Since every developer uses a different IDE, the recommended way to enable this
464- feature is to configure it on a system level. This can be done by setting the
465- ``xdebug.file_link_format `` option in your ``php.ini `` configuration file. The
466- format to use is the same as for the ``framework.ide `` option, but without the
467- need to escape the percent signs (``% ``) by doubling them:
464+ feature is to configure it on a system level. First, you can set its value to
465+ some environment variable that stores the name of the IDE/editor:
466+
467+ .. configuration-block ::
468+
469+ .. code-block :: yaml
470+
471+ # config/packages/framework.yaml
472+ framework :
473+ # the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.)
474+ ide : ' %env(resolve:CODE_EDITOR)%'
475+
476+ .. code-block :: xml
477+
478+ <!-- config/packages/framework.xml -->
479+ <?xml version =" 1.0" encoding =" UTF-8" ?>
480+ <container xmlns =" http://symfony.com/schema/dic/services"
481+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
482+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
483+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
484+ https://symfony.com/schema/dic/services/services-1.0.xsd
485+ http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
486+
487+ <!-- the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) -->
488+ <framework : config ide =" %env(resolve:CODE_EDITOR)%" />
489+ </container >
490+
491+ .. code-block :: php
492+
493+ // config/packages/framework.php
494+ use Symfony\Config\FrameworkConfig;
495+
496+ return static function (FrameworkConfig $framework) {
497+ // the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.)
498+ $framework->ide('%env(resolve:CODE_EDITOR)%');
499+ };
500+
501+ .. versionadded :: 5.3
502+
503+ The option to use env vars in the ``framework.ide `` option was introduced
504+ in Symfony 5.3.
505+
506+ Another alternative is to set the ``xdebug.file_link_format `` option in your
507+ ``php.ini `` configuration file. The format to use is the same as for the
508+ ``framework.ide `` option, but without the need to escape the percent signs
509+ (``% ``) by doubling them:
468510
469511.. code-block :: ini
470512
0 commit comments