4

When there is an exception stack-trace and the related code file posted in the question, it becomes difficult to trace the exception without the line numbers in the code.

Would it not be great if SO can automatically add line numbers to all the code posted so that the stack-trace becomes even more relevant?

5
  • 1
    Then the OP should have a way to specify the starting line number and SO will increment the line numbers from there. This is just an idea for a feature... The implementation could be much more effective than this..
    – Codebender
    Commented Jun 12, 2015 at 4:07
  • What if I want to copy the code so I can test it locally? How will I easily remove the line numbers I don't want. My editor will display line number without them needing to be in the code. Commented Jun 12, 2015 at 8:20
  • @DavidPostill I guess you can easily design the page such that when you copy, it doesn't copy the line numbers with it. That shouldn't be a problem I guess.
    – Codebender
    Commented Jun 12, 2015 at 8:22
  • Grease Monkey script userscripts-mirror.org/scripts/show/394529 Commented Jun 12, 2015 at 8:26

0

Browse other questions tagged .