Better support for the Flex stack traces

Hi,

Could you improve the support for the Flex stack traces a little bit? Right now only the absolute paths are supported. Could you please make it also recognize paths relative to the project maybe?

I'd love also if the path could be clickable w/o the stack trace additions, so anything that looks like a path is clickable and let's you navigate to the file from the output window.

The reason I'm asking for it is that for a custom test frameworks that use any kind of text files it's hard to navigate user from the failure to the actual file.

Regards,
Kris

7 comments
Comment actions Permalink

Are you talking about navigation to compilation error from Messages tool window? Please open YouTrack request and attach some screenshots or other examples. We'll do our best to improve usability. http://youtrack.jetbrains.net/

0
Comment actions Permalink

Hi Alexander.

What I mean is a navigation from a stack trace to the source code let's say from the flex unit test failure in the output window.

Right now only an absolute path works.

For instance:

at org.uinput.impl::TestSmartError/testShouldA()[C:\dev\uinput\uinput\test\org\uinput\impl\TestSmartError.as:32]

allows navigation from the stack trace to the source code but once an absolute path is changed to the relative:

at  org.uinput.impl::TestSmartError/testShouldA()[test\org\uinput\impl\TestSmartError.as:32]

It does not recognize the path anymore and it's 'not clickable' anymore.

What I'm proposing is to allow resolving relative paths to the source and test folders configured in a project and make such paths from a stack trace clickable.

By it's nature, flex includes absolute paths in debug information, however by adding this feature you will allow handling of any custom stacktraces.

Hope this helps,
Kris

0
Comment actions Permalink

Sounds reasonable. YouTrack request will guarantee that I will not forget to implement it for the next IDEA release.
Just curious, how do you get relative paths if as you said Flex by its nature includes absolute paths in debug information? And how do you get paths w/o the stack trace additions? Please give all examples of path-like strings in the request, we'll try to support them all.

Just FYI: Analyse | Analyse Stacktrace action uses the same algorythm of paths detection so you can play with it to find out if IDEA recognizes some path or not.

0
Comment actions Permalink

Here is a deal.

I created a BDD style testing library that uses txt files with scenarios. User needs to use [Embed(resource="scenarios/scenario.txt"] metatag to get the file included in swf. I can then analyze the metadata and put them right information in the stack trace.

Given that you can handle a path formatted like that [scenarios/scenario.txt] and that the scenarios/scenario.txt is placed under one of the source or test folders user should be later on able to get a link from the stack trace window to the scenarios/scenario.txt.

Another thing to consider is to have kind of a remap functionality built in the stack trace. Here is a deal:

A flexunit library includes the absolute paths of the files reflecting the actual directory layout of the machine the swc was build against. Now, if I attach source code to the flexunit library it would be nice to get the link remapped to the path from the source code attached.

I'll file both as separate entries in youtrack.

Thanks for the reply.

Kris

0
Comment actions Permalink

Remapping absolute paths already works in IDEA 9.0.3. Make sure that flexunit sources are configured correctly. See attached screenshot.



Attachment(s):
stacktrace.png
0
Comment actions Permalink

Great! I need to check it out.

Thanks a lot!

0
Comment actions Permalink

Hi Alexander,

Indeed the remapping part works in 9.0.3. Great job guys.

On the relative paths -  I managed to work around this and I'm posting a solution that worked for me. I'm not going to create a feature request as it may not be a realistic case for anyone anymore.


My problem was that I wanted to add stack trace information that would take a user from the failing test straight to some text file that drove the test.

I had a file:

Story1.gwz

with some text content

I embedded the file into my application with:


[Embed(source="/stories/Story1.gwz", mimeType="application/octet-stream")]

public static story:Class;

The embedded resource class will carry additional information with itself. One of the Embed metadata arguments will have an argument '_resolvedSource' which stores the absolute path to the resource.

In order to get it working you need to add Embed metadata to the -keep-as3-metadata parameter.

Now having the absolute path and the line number i was able to produce a stacktrace entry:

"\tat [absolutepath:linenumber]"

The stack trace line has to be placed somewhere among the existing stacktrace lines (I chose the root of the stack trace).

Cheers,
Kris

0

Please sign in to leave a comment.