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

CHE-2214 NodeJs Debugger #2625

Merged
merged 12 commits into from
Sep 30, 2016
Merged

CHE-2214 NodeJs Debugger #2625

merged 12 commits into from
Sep 30, 2016

Conversation

tolusha
Copy link
Contributor

@tolusha tolusha commented Sep 28, 2016

What does this PR do?

Provides ability to debug nodejs applications.

What issues does this PR fix or reference?

#2214

  • Tests provided / updated
  • Tests passed

Known limitations:

  • applications with different loaded scripts but same name
  • no expression evaluation is supported for old versions of nodejs

Please review Che's Contributing Guide for best practices.

@tolusha
Copy link
Contributor Author

tolusha commented Sep 28, 2016

@benoitf
@sleshchenko
pls review

@@ -0,0 +1,58 @@
# Eclipse #
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need your own .gitignore here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

<parent>
<artifactId>che-plugin-nodejs-debugger-parent</artifactId>
<groupId>org.eclipse.che.plugin</groupId>
<version>5.0.0-M2-SNAPSHOT</version>
Copy link
Member

Choose a reason for hiding this comment

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

Please update version of yours modules to 5.0.0-M5-SNAPSHOT

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

</dependency>
</dependencies>
<build>
<testSourceDirectory>src/test/java</testSourceDirectory>
Copy link
Member

Choose a reason for hiding this comment

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

I think you can remove testSourceDirectory, outputDirectory, resources sections because there all are default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


findFileInProject(project.get(), location, callback);

// final EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
Copy link
Member

Choose a reason for hiding this comment

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

Do you need these commented lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

*
* @author Anatolii Bazko
*/
public interface NodeJsDebuggerLocalizationConstant extends com.google.gwt.i18n.client.Messages {
Copy link
Member

Choose a reason for hiding this comment

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

Why you can't use import for Messages class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

</encoder>
</appender>

<root level="DEBUG">
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure that you need DEBUG logging level here? I prefer to use ERROR =

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

</encoder>
</appender>

<root level="INFO">
Copy link
Member

Choose a reason for hiding this comment

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

ERROR logging level would be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@codenvy-ci
Copy link

<artifactId>license-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*.png</exclude>
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need a custom exclude pattern ? (and not move this setting to the global configuration ?)

LOG.error("NodeJs failed to stop");
}
} catch (InterruptedException ignored) {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should at least log it no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

LOG.error(String.format("Command execution <%s> failed", command), e);
}

try {
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have sleep instruction there ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Can be removed.

}

try {
sleep(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

sleep looks like a hack ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Outdated code. Should be reworked.

@codenvy-ci
Copy link

Build # 551 - FAILED

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

sb.append(connectionInfo);
}
} catch (IllegalArgumentException ignored) {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe some log here or comment why you skip exception?

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 value, I will add comment in the code

@Override
public void run() {
try {
InputStream in = getInput();
Copy link
Contributor

Choose a reason for hiding this comment

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

should you close stream?

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, when debug process is stopped, then the stream will be stopped also.


String newTarget;
String[] target = location.getTarget().split(":");
if (target[0].equals("scriptId")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly NPE here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I will handle it.

final List<Breakpoint> breakpoints = new ArrayList<>();

@SuppressWarnings("unchecked")
Map<String, Object> m = GSON.fromJson(nodeJsOutput.getOutput(), Map.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use JsonObject and get value by key?

@codenvy-ci
Copy link

Build # 558 - FAILED

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

@codenvy-ci
Copy link

Build # 562 - FAILED

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

@tolusha tolusha merged commit 3993bed into master Sep 30, 2016
@tolusha tolusha deleted the CHE-2214 branch September 30, 2016 07:22
@bmicklea bmicklea added this to the 5.0.0 milestone Jan 11, 2017
JPinkney pushed a commit to JPinkney/che that referenced this pull request Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants