Skip to content

3 features for 0.6 in October #73

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

Merged
merged 12 commits into from
Oct 1, 2013
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ chromedevtools/utils/org.chromium.sdk.tests.system.runner/bin
/.project
.*.md.html
target/
*.settings/
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.compare;bundle-version="3.4.0",
org.chromium.sdk;bundle-version="0.3.9",
org.eclipse.core.expressions;bundle-version="3.4.0",
org.chromium.sdk.wip.eclipse;bundle-version="0.3.9"
org.chromium.sdk.wip.eclipse;bundle-version="0.3.9",
org.eclipse.wst.jsdt.core;bundle-version="1.1.102",
org.eclipse.wst.jsdt.ui;bundle-version="1.1.102"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.chromium.debug.ui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
package org.chromium.debug.ui.editors;

import org.chromium.debug.ui.PluginUtil;
import org.eclipse.ui.editors.text.TextEditor;
//import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor;

/**
* A simplistic JavaScript editor which supports its own key binding scope.
*/
public class JsEditor extends TextEditor {
// Change JsEditor to be based on JSDT JS Editor
// like `public class NodeEditor extends CompilationUnitEditor`
@SuppressWarnings("restriction")
public class JsEditor extends CompilationUnitEditor { //was extends TextEditor {

/** The ID of this editor as defined in plugin.xml */
public static final String EDITOR_ID =
Expand Down
54 changes: 49 additions & 5 deletions org.nodeclipse.debug/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,63 @@

##
## org.nodeclipse.debug

## TODO notes
Running and debugging node applications

debug port 5858 is hard-coded
### Developing

in 2 classes: [LaunchConfigurationDelegate](https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.debug/src/org/nodeclipse/debug/launch/LaunchConfigurationDelegate.java)
Open `plugin.xml`, in "Testing" section click "Launch an Eclipse application"

#### New Run/debug definition

1. in `plugin.xml` add `LaunchShortcut`

<extension
point= "org.eclipse.debug.ui.launchShortcuts" >

2. create new `public class LaunchShortcutName implements ILaunchShortcut`


## notes

debug port 5858 was hard-coded

in 2 classes: [LaunchConfigurationDelegate.java](https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.debug/src/org/nodeclipse/debug/launch/LaunchConfigurationDelegate.java)
& NodeDebugUtil

org.nodeclipse.debug\src\org\nodeclipse\debug\launch\LaunchConfigurationDelegate.java

NodeclispeDev console is in .ui package,
no need for

Import-Package: org.eclipse.ui.console


## TODO

http://wiki.eclipse.org/FAQ_How_do_I_write_to_the_console_from_a_plug-in%3F

#### How to write a hyperlink to an eclipse console from a plugin

This may be used to show coffee compilation errors as links.

http://stackoverflow.com/questions/591018/how-to-write-a-hyperlink-to-an-eclipse-console-from-a-plugin

console = new MessageConsole("myconsole", null);
console.activate();
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ console });

IPath path = Path.fromOSString(filePath);
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
FileLink fileLink = new FileLink(file, null, -1, -1, -1);
console.addHyperlink(fileLink, 10, 5);

### Many node instances running

currecntly `private static RuntimeProcess nodeProcess`, that is only one Node process may be running.

--debug-brk=5858

http://stackoverflow.com/questions/11947409/nodejs-eclipse-v8-deb

Port should be set per file basis, e.g. in Run Configuration
Port should be set per file basis, e.g. in Run Configuration

131 changes: 121 additions & 10 deletions org.nodeclipse.debug/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
modes="run, debug"
name="Node Application">
</launchConfigurationType>
<!-- node run/debug with monitor (not yet used)
<launchConfigurationType
delegate="org.nodeclipse.debug.launch.LaunchConfigurationDelegate"
id="org.nodeclipse.debug.launch.LaunchTypeWithMonitor"
modes="run, debug"
name="Node with monitor">
</launchConfigurationType>
-->
<launchConfigurationType
id="org.nodeclipse.debug.launch.LaunchType$StandaloneV8"
delegate="org.nodeclipse.debug.launch.StandaloneV8LaunchTypeWrapper"
Expand All @@ -45,7 +53,8 @@
icon= "icons/node.png"
id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeImage" >
</launchConfigurationTypeImage>
</extension>
</extension>
<!-- node run/debug -->
<extension
point= "org.eclipse.debug.ui.launchShortcuts" >
<shortcut
Expand All @@ -71,21 +80,57 @@
value= "*.js" >
</test>
</or>
</iterate>

</iterate>
</with>
</enablement>
</contextualLaunch>
</shortcut>
</extension>
<!-- node run/debug with monitor-->
<extension
point= "org.eclipse.debug.ui.launchShortcuts" >
<shortcut
class= "org.nodeclipse.debug.launch.LaunchShortcutWithMonitor"
icon= "icons/node.png"
id= "org.nodeclipse.debug.launch.LaunchShortcutWithMonitor"
label= "Node with monitor"
modes= "run, debug" >
<configurationType
id= "org.nodeclipse.debug.launch.LaunchConfigurationType" >
</configurationType>
<contextualLaunch>
<enablement>
<with
variable= "selection" >
<count
value= "1" >
</count>
<iterate>
<or>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.js" >
</test>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.coffee" >
</test>
</or>
</iterate>
</with>
</enablement>
</contextualLaunch>
</shortcut>
</extension>
<!-- coffee run/debug -->
<extension
point= "org.eclipse.debug.ui.launchShortcuts" >
<shortcut
class= "org.nodeclipse.debug.launch.LaunchShortcut"
icon= "icons/coffee.png"
id= "org.nodeclipse.debug.launch.LaunchShortcut"
label= "coffee"
modes= "run" >
modes= "run, debug" >
<configurationType
id= "org.nodeclipse.debug.launch.LaunchConfigurationType" >
</configurationType>
Expand All @@ -96,27 +141,93 @@
<count
value= "1" >
</count>
<iterate>
<iterate>
<or>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.coffee" >
</test>
</or>
<!-- TODO how to?
<or>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.litcoffee" >
</test>
</or>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.coffee.md" >
</test>
</or>
</iterate>
</with>
</enablement>
</contextualLaunch>
</shortcut>
</extension>
<!-- coffee -c (compile) -->
<extension
point= "org.eclipse.debug.ui.launchShortcuts" >
<shortcut
class= "org.nodeclipse.debug.launch.LaunchShortcutCoffeeCompile"
icon= "icons/coffee.png"
id= "org.nodeclipse.debug.launch.LaunchShortcutCoffeeCompile"
label= "coffee -c"
modes= "run, debug" >
<configurationType
id= "org.nodeclipse.debug.launch.LaunchConfigurationType" >
</configurationType>
<contextualLaunch>
<enablement>
<with
variable= "selection" >
<count
value= "1" >
</count>
<iterate>
<or>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.coffee" >
</test>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.litcoffee" >
</test>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.coffee.md" >
</test>
</or>
-->
</iterate>
</with>
</enablement>
</contextualLaunch>
</shortcut>
</extension>
<!-- typescript compiler -->
<extension
point= "org.eclipse.debug.ui.launchShortcuts" >
<shortcut
class= "org.nodeclipse.debug.launch.LaunchShortcutTypescriptCompiler"
icon= "icons/coffee.png"
id= "org.nodeclipse.debug.launch.LaunchShortcutTypescriptCompiler"
label= "tsc"
modes= "run, debug" >
<configurationType
id= "org.nodeclipse.debug.launch.LaunchConfigurationType" >
</configurationType>
<contextualLaunch>
<enablement>
<with
variable= "selection" >
<count
value= "1" >
</count>
<iterate>
<or>
<test
property= "org.eclipse.debug.ui.matchesPattern"
value= "*.ts" >
</test>
</or>
</iterate>
</with>
</enablement>
Expand Down
Loading