-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CHE-2214 NodeJs Debugger #2625
Conversation
@benoitf |
@@ -0,0 +1,58 @@ | |||
# Eclipse # |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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 =
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/545/ |
<artifactId>license-maven-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>**/*.png</exclude> |
There was a problem hiding this comment.
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) { | ||
} |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
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) { | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should you close stream?
There was a problem hiding this comment.
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")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly NPE here
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
Build # 558 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/558/ to view the results. |
Build # 562 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/562/ to view the results. |
What does this PR do?
Provides ability to debug nodejs applications.
What issues does this PR fix or reference?
#2214
Known limitations:
Please review Che's Contributing Guide for best practices.