reg expression to make assertError jump to source code?

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
John Pedersen

reg expression to make assertError jump to source code?

Post 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
Linda

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

Post 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
John

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

Post 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
Jeff Epstein

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

Post 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.
Post Reply