JS backend: added ability to debug kotlin code in browser with using JavaScript Debugger configuration.
(cherry picked from commit 8537ce4, 72eeb92)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="com.jetbrains">
|
||||
<javaScriptBreakpointAware implementation="org.jetbrains.jet.plugin.debugger.KotlinJavaScriptBreakpointAware"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -11,6 +11,7 @@
|
||||
<depends optional="true" config-file="junit.xml">JUnit</depends>
|
||||
<depends optional="true" config-file="testng-j.xml">TestNG-J</depends>
|
||||
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
|
||||
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
|
||||
|
||||
<project-components>
|
||||
<component>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package org.jetbrains.jet.plugin.debugger;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.PairProcessor;
|
||||
import org.jetbrains.jet.plugin.JetFileType;
|
||||
import org.jetbrains.jet.plugin.framework.KotlinFrameworkDetector;
|
||||
|
||||
public class KotlinJavaScriptBreakpointAware implements PairProcessor<VirtualFile, Project> {
|
||||
@Override
|
||||
public boolean process(VirtualFile file, Project project) {
|
||||
if (file.getFileType() == JetFileType.INSTANCE) {
|
||||
Module module = ModuleUtilCore.findModuleForFile(file, project);
|
||||
if (module != null) {
|
||||
return KotlinFrameworkDetector.isJsKotlinModule(module);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user