Open teebarjunk opened 6 months ago
How would it work with duplicate messages collapsing enabled? |
---|
Didn't even know about that feature.
Just tested it in my implementation here and it automatically grouped them into separate "clumps" when called at the same line.
If you make all output text clickable, it'll become hard to select for copying. The clickable area should likely be located within a gutter on the left of the actual text to prevent usability from regressing on this aspect.
Describe the project you are working on
Being able to click an Output message and go directly to where it was called from can save a lot of development time.
Describe the problem or limitation you are having in your project
Sometimes it is hard to track down where a
print()
statement is being called from, especially while debugging on a large project.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Clicking an Output line takes you to the script and line where
print
was called from.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I've implemented this as a plugin here: https://github.com/teebarjunk/output_link
It uses the new
print_rich()
function, passing a reference fromget_stack()
script like[url=stack.script|stack.line]Printed message here.[/url]
Either when using the
print()
commands, or a newprint_from()
command, pass a reference to the stack script path and line number, then in the Output RichTextLabel, wrap[url][/url]
tags around it, and connect a function to themeta_clicked
signal that will move the editor to the line.If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around.
Is there a reason why this should be core and not an add-on in the asset library?
Every type of project could benefit, especially large ones that need more intense debugging.
And all the necessary features are already in place to implement.