Skip to content

Activator-cannot-be-resolved #77

@paulvi

Description

@paulvi

While developing 0.6 a problem occurred that was not before.

When launching Node.js for .js file

activator-cannot-be-resolved-dialog

More details from Error Log

activator-cannot-be-resolved

Related code

import org.nodeclipse.ui.Activator;
import org.nodeclipse.ui.preferences.PreferenceConstants;

public class NodeDebugUtil {
    private static final String CONFIG_NAME = "STANDALONE_V8";
    //public static final String LAUNCH_CONFIGURATION_TYPE_ID = "org.chromium.debug.ui.LaunchType$StandaloneV8";
    private static final String LAUNCH_CONFIGURATION_TYPE_ID = "org.nodeclipse.debug.launch.LaunchType$StandaloneV8";

    public static void launch(final String mode, ILaunch launch,
            IProgressMonitor monitor) throws CoreException {
        ILaunchConfigurationType type = DebugPlugin
                .getDefault()
                .getLaunchManager()
                .getLaunchConfigurationType(LAUNCH_CONFIGURATION_TYPE_ID);

        if (type != null) {
            ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(
                    null, CONFIG_NAME);
            workingCopy.setAttribute("debug_host", "localhost");
            //workingCopy.setAttribute("debug_port", 5858);
            IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
            int nodeDebugPort = preferenceStore.getInt(PreferenceConstants.NODE_DEBUG_PORT);
            if (nodeDebugPort==0) { nodeDebugPort=5858;};
            workingCopy.setAttribute("debug_port", nodeDebugPort);
            final ILaunchConfiguration config = workingCopy.doSave();
            // super.launch(config, mode, launch, monitor);
            Display.getDefault().asyncExec(new Runnable() {
                @Override
                public void run() {
                    DebugUITools.launch(config, mode);
                }
            });
        }       
    }

Code of 0.5 version

import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.swt.widgets.Display;

public class NodeDebugUtil {
    private static final String CONFIG_NAME = "STANDALONE_V8";
    // public static final String LAUNCH_CONFIGURATION_TYPE_ID =
    // "org.chromium.debug.ui.LaunchType$StandaloneV8";
    private static final String LAUNCH_CONFIGURATION_TYPE_ID = "org.nodeclipse.debug.launch.LaunchType$StandaloneV8";

    public static void launch(final String mode, ILaunch launch,
            IProgressMonitor monitor) throws CoreException {
        ILaunchConfigurationType type = DebugPlugin.getDefault()
                .getLaunchManager()
                .getLaunchConfigurationType(LAUNCH_CONFIGURATION_TYPE_ID);

        if (type != null) {
            ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(
                    null, CONFIG_NAME);
            workingCopy.setAttribute("debug_host", "localhost");
            workingCopy.setAttribute("debug_port", 5858);
            final ILaunchConfiguration config = workingCopy.doSave();
            // super.launch(config, mode, launch, monitor);
            Display.getDefault().asyncExec(new Runnable() {
                @Override
                public void run() {
                    DebugUITools.launch(config, mode);
                }
            });
        }
    }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions