mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add currentSessionChanged method to XDebuggerManagerListener
This commit is contained in:
@@ -16,10 +16,16 @@
|
||||
package com.intellij.xdebugger;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface
|
||||
XDebuggerManagerListener {
|
||||
void processStarted(@NotNull XDebugProcess debugProcess);
|
||||
default void processStarted(@NotNull XDebugProcess debugProcess) {
|
||||
}
|
||||
|
||||
void processStopped(@NotNull XDebugProcess debugProcess);
|
||||
default void processStopped(@NotNull XDebugProcess debugProcess) {
|
||||
}
|
||||
|
||||
default void currentSessionChanged(@Nullable XDebugSession previousSession, @Nullable XDebugSession currentSession) {
|
||||
}
|
||||
}
|
||||
@@ -227,7 +227,7 @@ public class XDebuggerManagerImpl extends XDebuggerManager implements Persistent
|
||||
sessionTab.getRunContentDescriptor());
|
||||
}
|
||||
if (myActiveSession.compareAndSet(session, null)) {
|
||||
onActiveSessionChanged();
|
||||
onActiveSessionChanged(session, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,12 +240,13 @@ public class XDebuggerManagerImpl extends XDebuggerManager implements Persistent
|
||||
}
|
||||
}
|
||||
|
||||
private void onActiveSessionChanged() {
|
||||
private void onActiveSessionChanged(@Nullable XDebugSession previousSession, @Nullable XDebugSession currentSession) {
|
||||
myBreakpointManager.getLineBreakpointManager().queueAllBreakpointsUpdate();
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
ValueLookupManager.getInstance(myProject).hideHint();
|
||||
DebuggerUIUtil.repaintCurrentEditor(myProject); // to update inline debugger data
|
||||
}, myProject.getDisposed());
|
||||
myProject.getMessageBus().syncPublisher(TOPIC).currentSessionChanged(previousSession, currentSession);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -287,7 +288,8 @@ public class XDebuggerManagerImpl extends XDebuggerManager implements Persistent
|
||||
}
|
||||
|
||||
void setCurrentSession(@Nullable XDebugSessionImpl session) {
|
||||
boolean sessionChanged = myActiveSession.getAndSet(session) != session;
|
||||
XDebugSessionImpl previousSession = myActiveSession.getAndSet(session);
|
||||
boolean sessionChanged = previousSession != session;
|
||||
if (sessionChanged) {
|
||||
if (session != null) {
|
||||
XDebugSessionTab tab = session.getSessionTab();
|
||||
@@ -298,7 +300,7 @@ public class XDebuggerManagerImpl extends XDebuggerManager implements Persistent
|
||||
else {
|
||||
myExecutionPointHighlighter.hide();
|
||||
}
|
||||
onActiveSessionChanged();
|
||||
onActiveSessionChanged(previousSession, session);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user