Page 1 of 1

reg expression to make assertError jump to source code?

Posted: Thu Jun 27, 2002 11:00 am
by John Pedersen
Hi,

When I compile in TextPad, and the compiler finds an error, I can click on the error message and get straight to the line of code in the source that is causing the problem.

Does anyone know if it is possible to set up TextPad so that clicking on an java.lang.AssertionError can send me to the line of code declaring the assertion? Perhaps we just need the right reg expression?

John Pedersen

Re: reg expression to make assertError jump to source code?

Posted: Thu Jun 27, 2002 9:00 pm
by Linda
John,

How do you get it to work when you click on an error line? I used the default regular expression from compiling in java, but for a more complex java compilation, and it doesn't work. For example, an error is:

.\metadigm\util\PromptDialog.java:810: cannot resolve symbol

and the default regular expression is

^\(\(\(\[^\]+\[^\]+\)\|\([A-Za-z]:\)\)[^:]+\):\([0-9]+\):

file - register 1
line - register 4

If anyone knows how to fix it, thanks in advance.

Linda

Re: reg expression to make assertError jump to source code?

Posted: Fri Jun 28, 2002 11:53 am
by John
Linda,

Jumping to the line that causes the error only seems to work when all the errors are in one file. Compile a few classes and it doesn't work. I don't know if there is a fix for this - I have just got used to it being this way. But maybe there is a fix?

John

Re: reg expression to make assertError jump to source code?

Posted: Mon Jul 15, 2002 12:41 am
by Jeff Epstein
It does work with multiple files, at least for me.

As stated in another thread, this regular expression would seem to work:

[\]\([a-zA-Z]+.java\):\([0-9]+\):

Where register 1 is the file, and Register 2 is the line number. You may want to replace [a-zA-Z] with [a-zA-Z0-9_] if those characters appear in your file names.