use of com.intellij.javascript.debugger.RemoteDebuggingFileFinder in project intellij-plugins by JetBrains.
the class JstdDebuggingFileFinderProvider method provideFileFinder.
@NotNull
public RemoteDebuggingFileFinder provideFileFinder() throws ExecutionException {
ResolvedConfiguration resolvedConfiguration = resolveConfiguration();
BiMap<String, VirtualFile> mappings = HashBiMap.create();
addAllRemoteUrlMappings(resolvedConfiguration.getTests(), mappings);
addAllRemoteUrlMappings(resolvedConfiguration.getFilesList(), mappings);
return new RemoteDebuggingFileFinder(mappings, null);
}
use of com.intellij.javascript.debugger.RemoteDebuggingFileFinder in project intellij-plugins by JetBrains.
the class KarmaDebugProgramRunner method getDebuggableFileFinder.
private static DebuggableFileFinder getDebuggableFileFinder(@NotNull KarmaServer karmaServer) {
BiMap<String, VirtualFile> mappings = HashBiMap.create();
KarmaConfig karmaConfig = karmaServer.getKarmaConfig();
if (karmaConfig != null) {
VirtualFile basePath = LocalFileSystem.getInstance().findFileByPath(karmaConfig.getBasePath());
if (basePath != null && basePath.isValid()) {
if (karmaConfig.isWebpack()) {
mappings.put("webpack:///" + basePath.getPath(), basePath);
VirtualFile nodeModulesDir = basePath.findChild(NodeModuleUtil.NODE_MODULES);
if (nodeModulesDir != null && nodeModulesDir.isValid() && nodeModulesDir.isDirectory()) {
mappings.put(karmaServer.formatUrlWithoutUrlRoot("/base/" + NodeModuleUtil.NODE_MODULES), nodeModulesDir);
}
} else {
mappings.put(karmaServer.formatUrlWithoutUrlRoot("/base"), basePath);
}
}
}
if (SystemInfo.isWindows) {
VirtualFile[] roots = ManagingFS.getInstance().getLocalRoots();
for (VirtualFile root : roots) {
String key = karmaServer.formatUrlWithoutUrlRoot("/absolute" + root.getName());
if (mappings.containsKey(key)) {
LOG.warn("Duplicate mapping for Karma debug: " + key);
} else {
mappings.put(key, root);
}
}
} else {
VirtualFile[] roots = ManagingFS.getInstance().getLocalRoots();
if (roots.length == 1) {
mappings.put(karmaServer.formatUrlWithoutUrlRoot("/absolute"), roots[0]);
}
}
return new RemoteDebuggingFileFinder(mappings, null);
}
Aggregations