|
23 | 23 | */ |
24 | 24 | class HtmlErrorRenderer implements ErrorRendererInterface |
25 | 25 | { |
| 26 | + private const FORMATS = [ |
| 27 | + 'textmate' => 'txmt://open?url=file://%f&line=%l', |
| 28 | + 'macvim' => 'mvim://open?url=file://%f&line=%l', |
| 29 | + 'emacs' => 'emacs://open?url=file://%f&line=%l', |
| 30 | + 'sublime' => 'subl://open?url=file://%f&line=%l', |
| 31 | + 'phpstorm' => 'phpstorm://open?file=%f&line=%l', |
| 32 | + 'atom' => 'atom://core/open/file?filename=%f&line=%l', |
| 33 | + 'vscode' => 'vscode://file/%f:%l', |
| 34 | + ]; |
| 35 | + |
26 | 36 | private const GHOST_ADDONS = [ |
27 | 37 | '02-14' => self::GHOST_HEART, |
28 | 38 | '02-29' => self::GHOST_PLUS, |
@@ -50,7 +60,10 @@ public function __construct(bool|callable $debug = false, string $charset = null |
50 | 60 | { |
51 | 61 | $this->debug = \is_bool($debug) ? $debug : $debug(...); |
52 | 62 | $this->charset = $charset ?: (ini_get('default_charset') ?: 'UTF-8'); |
53 | | - $this->fileLinkFormat = $fileLinkFormat ?: (ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format')); |
| 63 | + if (null === $fileLinkFormat) { |
| 64 | + $fileLinkFormat = $_SERVER['SYMFONY_IDE'] ?? null; |
| 65 | + } |
| 66 | + $this->fileLinkFormat = (self::FORMATS[$fileLinkFormat] ?? $fileLinkFormat) ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: false; |
54 | 67 | $this->projectDir = $projectDir; |
55 | 68 | $this->outputBuffer = \is_string($outputBuffer) ? $outputBuffer : $outputBuffer(...); |
56 | 69 | $this->logger = $logger; |
|
0 commit comments