idea: fix support for 2024.1+

This commit is contained in:
Alexey Andreev 2024-06-10 19:41:34 +02:00
parent 683b80b2ec
commit 55657036a1
2 changed files with 7 additions and 8 deletions

View File

@ -20,6 +20,7 @@ import com.intellij.execution.ui.ExecutionConsole;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.util.Key;
import com.intellij.xdebugger.XDebugProcess;
import com.intellij.xdebugger.XDebugSession;
@ -44,6 +45,8 @@ import org.teavm.debugging.information.URLDebugInformationProvider;
public class TeaVMDebugProcess extends XDebugProcess {
public static final Key<Breakpoint> INNER_BREAKPOINT_KEY = new Key<>("TeaVM breakpoint");
private static final ExtensionPointName<TeaVMBreakpointProvider<?>> BREAKPOINT_EXT_NAME =
new ExtensionPointName<>("org.teavm.extensions.breakpointProvider");
private TeaVMDebuggerEditorsProvider editorsProvider;
private final Debugger innerDebugger;
private final List<TeaVMLineBreakpointHandler<?>> breakpointHandlers = new ArrayList<>();
@ -91,13 +94,9 @@ public class TeaVMDebugProcess extends XDebugProcess {
breakpointHandlers.add(new TeaVMLineBreakpointHandler<>(JavaLineBreakpointType.class, session.getProject(),
innerDebugger, this));
var breakpointProvider = session.getProject().getExtensionArea()
.<TeaVMBreakpointProvider<?>>getExtensionPoint("org.teavm.extensions.breakpointProvider");
if (breakpointProvider != null) {
for (TeaVMBreakpointProvider<?> provider : breakpointProvider.getExtensions()) {
breakpointHandlers.add(new TeaVMLineBreakpointHandler<>(provider.getBreakpointType(),
session.getProject(), innerDebugger, this));
}
for (var provider : BREAKPOINT_EXT_NAME.getExtensionList()) {
breakpointHandlers.add(new TeaVMLineBreakpointHandler<>(provider.getBreakpointType(),
session.getProject(), innerDebugger, this));
}
}

View File

@ -28,7 +28,7 @@
</extensions>
<extensionPoints>
<extensionPoint qualifiedName="org.teavm.extensions.breakpointProvider" area="IDEA_PROJECT"
<extensionPoint qualifiedName="org.teavm.extensions.breakpointProvider"
interface="org.teavm.idea.debug.TeaVMBreakpointProvider"/>
</extensionPoints>
</idea-plugin>