Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET C# stacktrace support #5489 #5534

Merged
merged 5 commits into from
Jul 10, 2017
Merged

Conversation

vrubezhny
Copy link
Contributor

@vrubezhny vrubezhny commented Jul 4, 2017

Adds the possibility to click on a stacktrace and compilation error/warning message lines in order to open a specified .NET C# class in editor.

Example:
Example

Fixes #5489
Fixes #5546

Signed-off-by: Victor Rubezhny vrubezhny@redhat.com

What does this PR do?

Adds the possibility to click on a stacktrace and compilation error/warning message lines in order to open a specified .NET C# class in editor.

What issues does this PR fix or reference?

Issue #5489
Issue #5546

Changelog

Release Notes

This version introduces new capabilities to the .NET and C# developers. Eclipse Che, now analyzes stacktraces and compilation error/warning messages from the console to intercept files and lines references. Those references are highlighted as links, when clicked, it opens .NET C# class in editor and reveal it to the line according to the info provided in the console output line.

[Animated Gif]

The smart selection capability is available for .NET C# stacktraces and compilation error/warning messages as well as for Java and NodeJS stacktraces at this moment.

Docs PR

Fixes: Issue eclipse-che#5489

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@benoitf
Copy link
Contributor

benoitf commented Jul 5, 2017

ci-build

@benoitf benoitf added kind/enhancement A feature request - must adhere to the feature request template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. team/californication labels Jul 5, 2017
@codenvy-ci
Copy link

Build # 2994 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/2994/ to view the results.

@benoitf
Copy link
Contributor

benoitf commented Jul 5, 2017

ci-build

@codenvy-ci
Copy link

* installs the handler functions for the links. The handler parses the stack
* trace line, searches for a candidate C# file to navigate to, opens the found
* file in editor and reveals it to the required line and column (if available)
* according to the line information
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add the @author tag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time is OK?
Or I should add it to all the output customizer like classes (as well as to those which was added only in fix for CHE-15)?

Copy link
Contributor

@benoitf benoitf Jul 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approved the PR so it's up to you

if (lineOffsetStart == -1) {
lineOffsetStart = 0;
}
static void openFileInEditorAndReveal(AppContext appContext, EditorAgent editorAgent, Path file,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we set an accessor ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've meant to make it to be package package available this time. Can't imagine a class that may be in need of calling this method other than these two *OutputCustomizer-classes at the moment.
If output customizers will be distributed among the different packages in future, we'll have to make it to be like public API. However at the moment, we have all these classes placed closely in one package and we don't have a mean that let adopters to add their own customizers - so no need to make it like public API.
IMHO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking private but it was more a thought. No change requested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it can't be private - it's used from two different classes in the same package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my feeling was that DefaultOutputCustomizer is not a default one, it's including Java or JavaScript.
So static code should be moved in a Empty/base or default class
But we should have Java(Script)OutputCustomizer and CSharpOutputCustomizer (they could both extend the same class)

Copy link
Contributor Author

@vrubezhny vrubezhny Jul 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoitf I have the same feeling. Default* was like a first impression (and because java is most used language, imho) - so, with having two more customizers [at the moment] it doesn't look like a proper name for this kind of customizer.

So, shell I turn DefaultOutputCustomizer into an abstract class (with few utility methods, like openFileInEditorAndReveal(...), selectRange(...) and set of abstract methods of OutputCustomizer interface) and a class like JavaOutputCustomizer (with realization for Java/JavaScript stacktraces)? (before the applying of this PR I mean)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vrubezhny I would say that it may be clearer this way, yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoitf @slemeur I've pushed a fixup commit that separates DefaultOutputCustomizer into AbstractOutputCustomizer (with some commonly used utility methods) and JavaOutputCustomizer. All the existing customizers are adopted to this change.
The similar thing is made for JUnit tests: DefaultOutputCustomizerTest is separated into BaseOutputCustomizerTest (contains commonly used utility methods) and JavaOutputCustomizerTest. All the existing output customizer tests are adopted to this change as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vrubezhny yes it's definitely better. Thanks.

Copy link
Contributor

@slemeur slemeur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@benoitf
Copy link
Contributor

benoitf commented Jul 6, 2017

@vparfonov ?

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@vrubezhny
Copy link
Contributor Author

@benoitf @slemeur Please review with the latest changes.

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@benoitf
Copy link
Contributor

benoitf commented Jul 8, 2017

ci-build

@codenvy-ci
Copy link

@ghost
Copy link

ghost commented Jul 10, 2017

@vparfonov @benoitf if we're ok with merging it, let's do it. Maybe a full QA cycle is required?

@benoitf benoitf added this to the 5.15.0 milestone Jul 10, 2017
@benoitf benoitf merged commit 1693b2b into eclipse-che:master Jul 10, 2017
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Jul 10, 2017
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
* .NET C# stacktrace support eclipse-che#5489

Fixes: Issue eclipse-che#5489

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultOutputCustomizer#customize() throws NumberFormatException on some inputs .NET C# stacktrace support
5 participants