stack_trace icon indicating copy to clipboard operation
stack_trace copied to clipboard

Allow line/column numbers to be separated with colon. #68

Open Azad99-9 opened this issue 1 year ago • 3 comments

The issue mentioned was to change the Trace format from src\main.dart 27:15 main to src\main.dart:27:15 main so that by clicking (CTRL+click) and it would open the file at that exact point.

by editing the toString() method of Trace class i tried to resolve the issue mentioned.

The desired output format is achieved by splitting and extracting each frame into 4 components for example:

lib/_engine/engine/platform_dispatcher.dart 269:5 in invokeOnPointerDataPacket is extracted to a list of components [lib/_engine/engine/platform_dispatcher.dart, 269:5, in, invokeOnPointerDataPacket]

and then concatenating them back with : so that the output format looks like lib/_engine/engine/platform_dispatcher.dart:269:5 invokeOnPointerDataPacket having : in between URI and line number

Azad99-9 avatar May 27 '23 12:05 Azad99-9

@Azad99-9 - thanks for the contribution! Can you describe the issue you're seeing a bit more and or link to an issue? Thanks!

devoncarew avatar May 31 '23 15:05 devoncarew

Sure, the issue i was talking about is #68 . The issue basically suggests to change the print format of the trace from src\main.dart 27:15 main to src\main.dart:27:15 main by putting the colon between the uri and the line number we can automatically point to the error location in the code by clicking ctrl + click in code editors which may boost the coding process.

Azad99-9 avatar Jun 01 '23 06:06 Azad99-9

I'm not sure whether this could be breaking for consumers of the current format. I'm also not sure if the implementation which makes assumptions about the existing content format is safe, or if it will be too brittle for some places we use this package.

Which editors support recognizing files with that specific pattern? Can they be extended to work with the current pattern? Is the pattern with : a standard defined anywhere?

natebosch avatar Jun 14 '23 17:06 natebosch