forked from eclipse-che/che
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHE-2214 NodeJs Debugger (eclipse-che#2625)
- Loading branch information
Anatoliy Bazko
authored
Sep 30, 2016
1 parent
f8923af
commit 4363d3f
Showing
53 changed files
with
3,257 additions
and
7 deletions.
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> |
102 changes: 102 additions & 0 deletions
102
...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,102 @@ | ||
/******************************************************************************* | ||
* 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) { | ||
// unrecognized connection property | ||
} | ||
} | ||
|
||
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.