Search in sources :

Example 1 with JavaScriptDebugConfiguration

use of com.intellij.javascript.debugger.execution.JavaScriptDebugConfiguration in project intellij-plugins by JetBrains.

the class DartProjectTemplate method createWebRunConfiguration.

static void createWebRunConfiguration(@NotNull final Module module, @NotNull final VirtualFile htmlFile) {
    DartModuleBuilder.runWhenNonModalIfModuleNotDisposed(() -> {
        final WebBrowser dartium = DartiumUtil.getDartiumBrowser();
        if (dartium == null)
            return;
        final Url url = WebBrowserServiceImpl.getDebuggableUrl(PsiManager.getInstance(module.getProject()).findFile(htmlFile));
        if (url == null)
            return;
        final RunManager runManager = RunManager.getInstance(module.getProject());
        try {
            final RunnerAndConfigurationSettings settings = runManager.createRunConfiguration("", JavascriptDebugConfigurationType.getTypeInstance().getFactory());
            ((JavaScriptDebugConfiguration) settings.getConfiguration()).setUri(url.toDecodedForm());
            ((JavaScriptDebugConfiguration) settings.getConfiguration()).setEngineId(dartium.getId().toString());
            settings.setName(((JavaScriptDebugConfiguration) settings.getConfiguration()).suggestedName());
            runManager.addConfiguration(settings, false);
            runManager.setSelectedConfiguration(settings);
        } catch (Throwable t) {
        /* ClassNotFound in IDEA Community or if JS Debugger plugin disabled */
        }
    }, module);
}
Also used : WebBrowser(com.intellij.ide.browsers.WebBrowser) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) JavaScriptDebugConfiguration(com.intellij.javascript.debugger.execution.JavaScriptDebugConfiguration) RunManager(com.intellij.execution.RunManager) Url(com.intellij.util.Url)

Aggregations

RunManager (com.intellij.execution.RunManager)1 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1 WebBrowser (com.intellij.ide.browsers.WebBrowser)1 JavaScriptDebugConfiguration (com.intellij.javascript.debugger.execution.JavaScriptDebugConfiguration)1 Url (com.intellij.util.Url)1