Skip to content

Commit 416faf1

Browse files
Update doc about IDE file link format
1 parent f78d06b commit 416faf1

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

reference/configuration/framework.rst

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,20 @@ ide
204204

205205
**type**: ``string`` **default**: ``null``
206206

207-
If you're using an IDE like TextMate or Mac Vim, then Symfony can turn all
208-
of the file paths in an exception message into a link, which will open that
209-
file in your IDE.
207+
Symfony can turn file paths seen in dumps and in exception messages into links
208+
that will open in your preferred text editor or IDE.
210209

211-
Symfony contains preconfigured URLs for some popular IDEs, you can set them
212-
using the following keys:
210+
Since every developer uses a different IDE, the recommended way to enable this
211+
feature is to configure it on a system level. This can be done by setting the
212+
``xdebug.file_link_format`` option in your ``php.ini`` configuration file.
213213

214-
* ``textmate``
215-
* ``macvim``
216-
* ``emacs``
217-
* ``sublime``
214+
Alternatively, you can use this ``ide`` configuration key.
218215

219-
You can also specify a custom URL string. If you do this, all percentage
220-
signs (``%``) must be doubled to escape that character. For example, if
221-
you use PHPstorm on the Mac OS platform, you will do something like:
216+
In both cases, the expected configuration value is a URL template that contain an
217+
``%f`` where the file path is expected and ``%l`` for the line. When using the
218+
``ide`` configuration key, percentages signs (``%``) must be escaped by doubling
219+
them. For example, if you use PHPstorm on the Mac OS platform, you will do
220+
something like:
222221

223222
.. configuration-block::
224223

@@ -248,18 +247,25 @@ you use PHPstorm on the Mac OS platform, you will do something like:
248247
'ide' => 'phpstorm://open?file=%%f&line=%%l',
249248
));
250249
250+
.. versionadded:: 3.2
251+
252+
When running your app in a container or in a virtual machine, you can tell
253+
Symfony to map files from the guest to the host by changing their prefix.
254+
This map should be specified at the end of the URL template::
255+
256+
// /guest/.../file will be opened as /host/.../file on the host
257+
// and /foo/.../file as /bar/.../file also
258+
'myide://%f:%l#/guest/=/host/&/foo/=/bar/&...'
259+
251260
.. tip::
252261

253-
If you're on a Windows PC, you can install the `PhpStormProtocol`_ to
254-
be able to use this.
262+
Symfony contains preconfigured URLs for some popular IDEs, you can set them
263+
using the following values: ``textmate``, ``macvim``, ``emacs`` or ``sublime``.
255264

256-
Of course, since every developer uses a different IDE, it's better to set
257-
this on a system level. This can be done by setting the ``xdebug.file_link_format``
258-
in the ``php.ini`` configuration to the URL string.
265+
.. tip::
259266

260-
If you don't use Xdebug, another way is to set this URL string in the
261-
``SYMFONY__TEMPLATING__HELPER__CODE__FILE_LINK_FORMAT`` environment variable.
262-
If any of these configurations values are set, the ``ide`` option will be ignored.
267+
If you're on a Windows PC, you can install the `PhpStormProtocol`_ to
268+
be able to use this.
263269

264270
.. _reference-framework-test:
265271

0 commit comments

Comments
 (0)