Project

General

Profile

Actions

Task #106218

open

Make copy/paste from the backtrace page to the IDE more comfortable

Added by Ian Solo 24 days ago. Updated 24 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend API
Start date:
2025-02-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
14
PHP Version:
Tags:
Complexity:
Sprint Focus:

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


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Feature #106153: Make it easy to copy exception stacktraceUnder Review2025-02-11

Actions
Actions #1

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?

Actions #2

Updated by Garvin Hicking 24 days ago

  • Related to Feature #106153: Make it easy to copy exception stacktrace added
Actions #3

Updated by Ian Solo 24 days ago

Garvin Hicking wrote in #note-1:

Also, it would make copy&paste harder for doing a "git log" or so with the URL.

I didn't get this part but the "copy" button solution is perfect!

Actions

Also available in: Atom PDF