Note: To be clear, the question being asked is not about "How can I display line numbers in Eclipse?" That is answered here @ StackOverflow.
Goal: I want to know if Eclipse has a macro that acts as getLineNumber()
the same way Visual Studio has the ability to use the preprocessor macro __LINE__
to easily/universally get the line# for where this particular call to getLineNumber()
lives on. It's useful for knowing if a line of code was hit, without using a debugger/breakpoints.
I'd like to debug using: println("I just hit file@line: "+__FILE__ +'@'+ __LINE__ );
I am seeking a universal macro that can be copied and pasted to any file/any line, so that those values are known at/before compile time. Does Java/Eclipse offer such a feature? Possibly in an Eclipse plugin?
I can't find any info on this anywhere, I'm at a loss. Thanks.