Package com.intellij.javascript.karma.server

Examples of com.intellij.javascript.karma.server.KarmaServer$MyDisposable


  }

  @Override
  @Nullable
  public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    KarmaServer server = getServerOrStart(executor);
    if (server != null) {
      return executeWithServer(executor, server);
    }
    return null;
  }
View Full Code Here


      .setRunSettings(myRunSettings)
      .setWithCoverage(myExecutionType == KarmaExecutionType.COVERAGE)
      .build();

    KarmaServerRegistry registry = KarmaServerRegistry.getInstance(myProject);
    KarmaServer server = registry.getServer(serverSettings);
    if (server != null && server.getRestarter().isRestartRequired()) {
      server.shutdownAsync();
      server = null;
    }
    if (server == null) {
      registry.startServer(
        serverSettings,
View Full Code Here

    final KarmaConsoleView consoleView = KarmaConsoleView.get(executionResult);
    if (consoleView == null) {
      throw new RuntimeException("KarmaConsoleView was expected!");
    }

    final KarmaServer karmaServer = consoleView.getKarmaExecutionSession().getKarmaServer();
    if (karmaServer.areBrowsersReady()) {
      final DebuggableWebBrowser debuggableWebBrowser =
        new KarmaDebugBrowserSelector(karmaServer.getCapturedBrowsers(), environment).selectDebugEngine();
      return prepareDebugger(environment.getProject(), debuggableWebBrowser, new RunProfileStarter() {
        @Nullable
        @Override
        public RunContentDescriptor execute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {
          if (debuggableWebBrowser == null) {
            return null;
          }

          final Url url = Urls.newFromEncoded(karmaServer.formatUrl("/debug.html"));
          final DebuggableFileFinder fileFinder = getDebuggableFileFinder(karmaServer);
          XDebugSession session = XDebuggerManager.getInstance(env.getProject()).startSession(
            env,
            new XDebugProcessStarter() {
              @Override
              @NotNull
              public XDebugProcess start(@NotNull final XDebugSession session) {
                JavaScriptDebugEngine debugEngine = debuggableWebBrowser.getDebugEngine();
                WebBrowser browser = debuggableWebBrowser.getWebBrowser();
                JSDebugProcess<?> debugProcess = debugEngine.createDebugProcess(session, browser, fileFinder, url, executionResult, true);
                debugProcess.setElementsInspectorEnabled(false);
                debugProcess.setLayouter(consoleView.createDebugLayouter(debugProcess));
                return debugProcess;
              }
            }
          );
          return session.getRunContentDescriptor();

        }
      });
    }
    else {
      return AsyncResult.<RunProfileStarter>done(new RunProfileStarter() {
        @Nullable
        @Override
        public RunContentDescriptor execute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) {
          RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, env);
          final RunContentDescriptor descriptor = contentBuilder.showRunContent(env.getContentToReuse());
          karmaServer.onBrowsersReady(new Runnable() {
            @Override
            public void run() {
              ExecutionUtil.restartIfActive(descriptor);
            }
          });
View Full Code Here

    FileDocumentManager.getInstance().saveAllDocuments();
    KarmaRunProfileState runProfileState = ObjectUtils.tryCast(state, KarmaRunProfileState.class);
    if (runProfileState == null) {
      return null;
    }
    final KarmaServer server = runProfileState.getServerOrStart(env.getExecutor());
    if (server == null) {
      return null;
    }
    KarmaCoveragePeer coveragePeer = getCoveragePeer(server);
    KarmaCoverageStartupStatus status = coveragePeer.getStartupStatus();
View Full Code Here

      LOG.error("Can't get KarmaConsoleView from executionResult!");
      return null;
    }
    final RunContentDescriptor descriptor = new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse());

    KarmaServer server = consoleView.getKarmaExecutionSession().getKarmaServer();
    if (!server.areBrowsersReady()) {
      server.onBrowsersReady(new Runnable() {
        @Override
        public void run() {
          ExecutionUtil.restartIfActive(descriptor);
        }
      });
View Full Code Here

TOP

Related Classes of com.intellij.javascript.karma.server.KarmaServer$MyDisposable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.