Search in sources :

Example 6 with KarmaConfig

use of com.intellij.javascript.karma.KarmaConfig in project intellij-plugins by JetBrains.

the class KarmaServer method formatUrl.

@NotNull
private String formatUrl(@NotNull String path, boolean withUrlRoot) {
    if (!path.startsWith("/")) {
        path = "/" + path;
    }
    KarmaConfig config = myState.getKarmaConfig();
    if (config != null) {
        String baseUrl = "http://" + config.getHostname() + ":" + getServerPort();
        String urlRoot = config.getUrlRoot();
        if (!withUrlRoot || "/".equals(urlRoot)) {
            return baseUrl + path;
        }
        return baseUrl + config.getUrlRoot() + path;
    }
    LOG.error("Karma config isn't ready yet.");
    return "http://localhost:" + getServerPort() + path;
}
Also used : KarmaConfig(com.intellij.javascript.karma.KarmaConfig) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

KarmaConfig (com.intellij.javascript.karma.KarmaConfig)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 File (java.io.File)2 IOException (java.io.IOException)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 ExecutionException (com.intellij.execution.ExecutionException)1 Executor (com.intellij.execution.Executor)1 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 AbstractFileHyperlinkFilter (com.intellij.execution.filters.AbstractFileHyperlinkFilter)1 com.intellij.execution.process (com.intellij.execution.process)1 TestConsoleProperties (com.intellij.execution.testframework.TestConsoleProperties)1 SMTestRunnerConnectionUtil (com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil)1 SMTRunnerConsoleProperties (com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties)1 SMTestLocator (com.intellij.execution.testframework.sm.runner.SMTestLocator)1 TestProxyFilterProvider (com.intellij.execution.testframework.sm.runner.TestProxyFilterProvider)1 SMTRunnerConsoleView (com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView)1 RemoteDebuggingFileFinder (com.intellij.javascript.debugger.RemoteDebuggingFileFinder)1 KarmaSourceMapStacktraceFilter (com.intellij.javascript.karma.filter.KarmaSourceMapStacktraceFilter)1 KarmaScopeKind (com.intellij.javascript.karma.scope.KarmaScopeKind)1