Skip to content

Commit b22907a

Browse files
committed
feature #41002 [FrameworkBundle][HttpKernel] Move IDE file link formats from FrameworkExtension to FileLinkFormatter (MatTheCat)
This PR was merged into the 5.3-dev branch. Discussion ---------- [FrameworkBundle][HttpKernel] Move IDE file link formats from FrameworkExtension to FileLinkFormatter | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #40901 | License | MIT | Doc PR | N/A I made `FileLinkFormatter` aware of IDEs file link formats so that you can set `framework.ide` as an env var containing a name (like `atom`). Not sure how to test it from the `FrameworkExtension` POV though 🤔 Commits ------- 42a27b2770 Move IDE file link formats from FrameworkExtension to FileLinkFormatter
2 parents a10bb09 + ef57a2f commit b22907a

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -294,20 +294,7 @@ public function load(array $configs, ContainerBuilder $container)
294294
}
295295

296296
if (!$container->hasParameter('debug.file_link_format')) {
297-
$links = [
298-
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
299-
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
300-
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
301-
'sublime' => 'subl://open?url=file://%%f&line=%%l',
302-
'phpstorm' => 'phpstorm://open?file=%%f&line=%%l',
303-
'atom' => 'atom://core/open/file?filename=%%f&line=%%l',
304-
'vscode' => 'vscode://file/%%f:%%l',
305-
];
306-
$ide = $config['ide'];
307-
// mark any env vars found in the ide setting as used
308-
$container->resolveEnvPlaceholders($ide);
309-
310-
$container->setParameter('debug.file_link_format', str_replace('%', '%%', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')) ?: ($links[$ide] ?? $ide));
297+
$container->setParameter('debug.file_link_format', $config['ide']);
311298
}
312299

313300
if (!empty($config['test'])) {

0 commit comments

Comments
 (0)