-
Notifications
You must be signed in to change notification settings - Fork 69
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
Chrome Debugger Refactorings #256
Conversation
|
||
DSPLaunchDelegateLaunchBuilder builder = new DSPLaunchDelegateLaunchBuilder(configuration, mode, launch, | ||
monitor); | ||
builder.setLaunchDebugAdapter(InitializeLaunchConfigurations.getNodeJsLocation(), debugCmdArgs); |
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.
Just realized this line is calling InitializeLaunchConfigurations.getNodeJsLocation()
- it should probably call a function to get the delegates debug adapter location instead
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.
Nevermind.. you need node to run the debug adapter 🤦♂️
import org.eclipse.wildwebdeveloper.Activator; | ||
import org.eclipse.wildwebdeveloper.InitializeLaunchConfigurations; | ||
|
||
public class AbstractDebugDelegate extends DSPLaunchDelegate{ |
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 be public abstract class AbstractDebugDelegate
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.
+1, and also, as it's only for HTML, AbstractHTMLDebugDelegate
.
I let you do the self-review and publish new version of the commit. Ping me when you think it's good to merge. |
Sounds good :) |
...ildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/chrome/ChromeRunDAPDebugDelegate.java
Outdated
Show resolved
Hide resolved
...ildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/chrome/ChromeRunDAPDebugDelegate.java
Outdated
Show resolved
Hide resolved
...webdeveloper/src/org/eclipse/wildwebdeveloper/debug/chrome/ChromeRunDebugLaunchShortcut.java
Outdated
Show resolved
Hide resolved
...ipse.wildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/firefox/RunFirefoxDebugTab.java
Outdated
Show resolved
Hide resolved
...ildwebdeveloper/src/org/eclipse/wildwebdeveloper/debug/chrome/ChromeAttachDebugDelegate.java
Outdated
Show resolved
Hide resolved
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.
need to remove garbage files
9315008
to
c191d9c
Compare
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.
That seems good. See some comments and questions inline.
@@ -4,7 +4,8 @@ bin.includes = META-INF/,\ | |||
.,\ | |||
plugin.xml,\ | |||
language-servers/package-lock.json,\ | |||
language-servers/node_modules/,\ | |||
language-servers/chrome-debug-adapter/extension/node_modules/,\ |
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.
This seems erroneous, the build.properties
doesn't need to change.
@@ -132,6 +132,9 @@ | |||
</execution> | |||
</executions> | |||
</plugin> | |||
|
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 need for extra lines here. You can reset to previous state to simplify the change (and the review)
public static final String ENV = ILaunchManager.ATTR_ENVIRONMENT_VARIABLES; | ||
public static final String SOURCE_MAPS = "sourceMaps"; | ||
public static final String PORT = "port"; //$NON-NLS-1$ | ||
public static final String REQUEST = "request"; //$NON-NLS-1$ |
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 all those attributes the same for the 3 debug adapters?
import org.eclipse.wildwebdeveloper.Activator; | ||
import org.eclipse.wildwebdeveloper.debug.chrome.ChromeRunDebugLaunchShortcut; | ||
|
||
public class RunHTMLDebugTab extends AbstractLaunchConfigurationTab { |
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.
If this class isn't meant to be instantiated directly, make it abstract
and call it AbstractRunHTMLDebugTab
import org.eclipse.wildwebdeveloper.Activator; | ||
import org.eclipse.wildwebdeveloper.InitializeLaunchConfigurations; | ||
|
||
public class AbstractDebugDelegate extends DSPLaunchDelegate{ |
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.
+1, and also, as it's only for HTML, AbstractHTMLDebugDelegate
.
@@ -96,7 +96,12 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun | |||
} catch (IOException e) { | |||
IStatus errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); | |||
Activator.getDefault().getLog().log(errorStatus); | |||
ErrorDialog.openError(Display.getDefault().getActiveShell(), "Debug error", e.getMessage(), errorStatus); //$NON-NLS-1$ | |||
Display.getDefault().asyncExec(new Runnable() { |
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.
use a lambda here instead of explicit new Runnable()
Display.getDefault().asyncExec(() -> ErrorDialog.openError(Display.getDefault().getActiveShell(), "Debug error", e.getMessage(), errorStatus)); //$NON-NLS-1$
@@ -66,7 +66,12 @@ public void launch(ILaunchConfiguration configuration, String mode, ILaunch laun | |||
} catch (IOException e) { | |||
IStatus errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); | |||
Activator.getDefault().getLog().log(errorStatus); | |||
ErrorDialog.openError(Display.getDefault().getActiveShell(), "Debug error", e.getMessage(), errorStatus); //$NON-NLS-1$ | |||
Display.getDefault().asyncExec(new Runnable() { |
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.
use a lambda here instead of explicit new Runnable()
Display.getDefault().asyncExec(() -> ErrorDialog.openError(Display.getDefault().getActiveShell(), "Debug error", e.getMessage(), errorStatus)); //$NON-NLS-1$
Refactorings for DebugTabs, DebugLaunchShortcuts and DebugDelegates Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
c191d9c
to
5f4f004
Compare
Build is failing because .target reference older platform repo. I'll try to fix it tomorrow. |
Ok no problem |
Patch works perfectly (for what I tried), and makes code simpler and easier to navigate. |
Glad to hear! :) |
Refactorings for debugTab's and DebugDelegates
Signed-off-by: Andrew Obuchowicz aobuchow@redhat.com