diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 0ca87286119..d45f35dc742 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -461,10 +461,52 @@ doubling them to prevent Symfony from interpreting them as container parameters) }; Since every developer uses a different IDE, the recommended way to enable this -feature is to configure it on a system level. This can be done by setting the -``xdebug.file_link_format`` option in your ``php.ini`` configuration file. The -format to use is the same as for the ``framework.ide`` option, but without the -need to escape the percent signs (``%``) by doubling them: +feature is to configure it on a system level. First, you can set its value to +some environment variable that stores the name of the IDE/editor: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + framework: + # the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) + ide: '%env(resolve:CODE_EDITOR)%' + + .. code-block:: xml + + + + + + + + + + .. code-block:: php + + // config/packages/framework.php + use Symfony\Config\FrameworkConfig; + + return static function (FrameworkConfig $framework) { + // the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) + $framework->ide('%env(resolve:CODE_EDITOR)%'); + }; + +.. versionadded:: 5.3 + + The option to use env vars in the ``framework.ide`` option was introduced + in Symfony 5.3. + +Another alternative is to set the ``xdebug.file_link_format`` option in your +``php.ini`` configuration file. The format to use is the same as for the +``framework.ide`` option, but without the need to escape the percent signs +(``%``) by doubling them: .. code-block:: ini