-
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
Merged
CHE-2214 NodeJs Debugger #2625
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
40e119c
CHE-2214: Add server side NodeJs debugger
16df506
CHE-2214: NodeJs debugger client side
07906d2
CHE-2214: Add extenstion. Fix bugs
2b75a9f
CHE-2214: NodeJs Debugger
5d17f2f
CHE-2214: Fix bugs
68c0905
CHE-2214: Fix tests
0359ece
CHE-2214: Fix bug
9124974
CHE-2214: Merge master
6cdcbdb
CHE-2214: Small fixes
264a198
CHE-2214: Small improvements
956afb6
Merge branch 'master' into CHE-2214
a26b4c6
CHE-2214: Fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 154 additions & 0 deletions
154
plugins/plugin-nodejs-debugger/che-plugin-nodejs-debugger-ide/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright (c) 2012-2016 Codenvy, S.A. | ||
All rights reserved. This program and the accompanying materials | ||
are made available under the terms of the Eclipse Public License v1.0 | ||
which accompanies this distribution, and is available at | ||
http://www.eclipse.org/legal/epl-v10.html | ||
|
||
Contributors: | ||
Codenvy, S.A. - initial API and implementation | ||
|
||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>che-plugin-nodejs-debugger-parent</artifactId> | ||
<groupId>org.eclipse.che.plugin</groupId> | ||
<version>5.0.0-M5-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>che-plugin-nodejs-debugger-ide</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Che Plugin :: NodeJs Debugger :: IDE</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.gwt</groupId> | ||
<artifactId>gwt-elemental</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.gwt.inject</groupId> | ||
<artifactId>gin</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.inject</groupId> | ||
<artifactId>guice</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.validation</groupId> | ||
<artifactId>validation-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-api-project</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-api-workspace</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-commons-annotations</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-commons-gwt</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-ide-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-ide-app</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.core</groupId> | ||
<artifactId>che-core-ide-ui</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.che.plugin</groupId> | ||
<artifactId>che-plugin-debugger-ide</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.vectomatic</groupId> | ||
<artifactId>lib-gwt-svg</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.gwt</groupId> | ||
<artifactId>gwt-user</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.gwt</groupId> | ||
<artifactId>gwt-dev</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.gwt.gwtmockito</groupId> | ||
<artifactId>gwtmockito</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.googlecode.gwt-test-utils</groupId> | ||
<artifactId>gwt-test-utils</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/java</directory> | ||
</resource> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>analyze</id> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.mycila</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>**/*.png</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
101 changes: 101 additions & 0 deletions
101
...odejs-debugger-ide/src/main/java/org/eclipse/che/plugin/nodejsdbg/ide/NodeJsDebugger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.plugin.nodejsdbg.ide; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.web.bindery.event.shared.EventBus; | ||
|
||
import org.eclipse.che.api.debug.shared.model.Location; | ||
import org.eclipse.che.ide.api.debug.BreakpointManager; | ||
import org.eclipse.che.ide.api.debug.DebuggerServiceClient; | ||
import org.eclipse.che.ide.api.resources.VirtualFile; | ||
import org.eclipse.che.ide.debug.DebuggerDescriptor; | ||
import org.eclipse.che.ide.debug.DebuggerManager; | ||
import org.eclipse.che.ide.dto.DtoFactory; | ||
import org.eclipse.che.ide.util.storage.LocalStorageProvider; | ||
import org.eclipse.che.ide.websocket.MessageBusProvider; | ||
import org.eclipse.che.plugin.debugger.ide.debug.AbstractDebugger; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.util.Map; | ||
|
||
/** | ||
* The NodeJs Debugger Client. | ||
* | ||
* @author Anatoliy Bazko | ||
*/ | ||
public class NodeJsDebugger extends AbstractDebugger { | ||
|
||
public static final String ID = "nodejsdbg"; | ||
|
||
@Inject | ||
public NodeJsDebugger(DebuggerServiceClient service, | ||
DtoFactory dtoFactory, | ||
LocalStorageProvider localStorageProvider, | ||
MessageBusProvider messageBusProvider, | ||
EventBus eventBus, | ||
NodeJsDebuggerFileHandler activeFileHandler, | ||
DebuggerManager debuggerManager, | ||
BreakpointManager breakpointManager) { | ||
|
||
super(service, | ||
dtoFactory, | ||
localStorageProvider, | ||
messageBusProvider, | ||
eventBus, | ||
activeFileHandler, | ||
debuggerManager, | ||
breakpointManager, | ||
ID); | ||
} | ||
|
||
@Override | ||
protected String fqnToPath(@NotNull Location location) { | ||
return location.getResourcePath() == null ? location.getTarget() : location.getResourcePath(); | ||
} | ||
|
||
@Override | ||
protected String pathToFqn(VirtualFile file) { | ||
return file.getLocation().toString(); | ||
} | ||
|
||
@Override | ||
protected DebuggerDescriptor toDescriptor(Map<String, String> connectionProperties) { | ||
StringBuilder sb = new StringBuilder(); | ||
|
||
for (String propName : connectionProperties.keySet()) { | ||
try { | ||
ConnectionProperties prop = ConnectionProperties.valueOf(propName.toUpperCase()); | ||
String connectionInfo = prop.getConnectionInfo(connectionProperties.get(propName)); | ||
if (!connectionInfo.isEmpty()) { | ||
if (sb.length() > 0) { | ||
sb.append(','); | ||
} | ||
sb.append(connectionInfo); | ||
} | ||
} catch (IllegalArgumentException ignored) { | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. No value, I will add comment in the code |
||
} | ||
|
||
return new DebuggerDescriptor("", "{ " + sb.toString() + " }"); | ||
} | ||
|
||
public enum ConnectionProperties { | ||
SCRIPT { | ||
@Override | ||
public String getConnectionInfo(String value) { | ||
return value; | ||
} | ||
}; | ||
|
||
public abstract String getConnectionInfo(String value); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ugger-ide/src/main/java/org/eclipse/che/plugin/nodejsdbg/ide/NodeJsDebuggerExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.plugin.nodejsdbg.ide; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
|
||
import org.eclipse.che.ide.api.extension.Extension; | ||
import org.eclipse.che.ide.debug.DebuggerManager; | ||
|
||
/** | ||
* Extension allows to debug NodeJs applications. | ||
* | ||
* @author Anatoliy Bazko | ||
*/ | ||
@Singleton | ||
@Extension(title = "NodeJs Debugger", version = "5.0.0") | ||
public class NodeJsDebuggerExtension { | ||
|
||
@Inject | ||
public NodeJsDebuggerExtension(DebuggerManager debuggerManager, NodeJsDebugger nodeJsDebugger) { | ||
debuggerManager.registeredDebugger(NodeJsDebugger.ID, nodeJsDebugger); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ?)