Task #106218
openMake copy/paste from the backtrace page to the IDE more comfortable
0%
Description
In the backtrace page shown by the debug exception handler, the format that displays the filename and the line could be improved from:in /var/www/TEST/TYPO3.CONF/ext/bootstrap_package/ext_localconf.php line 3
to:/var/www/TEST/TYPO3.CONF/ext/bootstrap_package/ext_localconf.php:3
So, with a triple-click, one can select that line and then copy and paste it in the "Find in files" feature of an IDE (VSCode; PhpStorm; etc...) then press ENTER and be positioned, in the IDE, in that specific line.
The code is here:
https://github.com/TYPO3/typo3/blob/21d14b34dc9161cef5058560291d5a7ed5a7d6b4/typo3/sysext/core/Classes/Error/DebugExceptionHandler.php#L480
Change from:
protected function formatPath(string $path, int $line): string
{
return sprintf(
'<span class="block trace-file-path">in <strong>%s</strong>%s</span>',
$this->escapeHtml($path),
$line > 0 ? ' line ' . $line : ''
);
}
to:
protected function formatPath(string $path, int $line): string
{
return sprintf(
'<span class="block trace-file-path"><strong>%s</strong>%s</span>',
$this->escapeHtml($path),
$line > 0 ? ':' . $line : ''
);
}
Maybe here too: https://github.com/TYPO3/typo3/blob/21d14b34dc9161cef5058560291d5a7ed5a7d6b4/typo3/sysext/core/Classes/Error/ErrorHandler.php#L139
Updated by Garvin Hicking 24 days ago
- Category set to Backend API
While I understand the notion the problem is that lesser skilled developers might need that extra info that ":xx" refers to a line number.
Also, it would make copy&paste harder for doing a "git log" or so with the URL.
I think the best solution would be to introduce a "copy" button that uses the "x:y" format and puts it into your clipboard, and leaving the display unchanged.
What do you think?
Updated by Garvin Hicking 24 days ago
- Related to Feature #106153: Make it easy to copy exception stacktrace added