use of com.google.cloud.tools.intellij.debugger.CloudDebugProcessStateController.ResolveBreakpointHandler in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudDebugProcess method navigateToSnapshot.
/**
* Finds the snapshot associated with the given id and sets it as the active snapshot in the
* current debug session.
*/
public void navigateToSnapshot(@NotNull final String id) {
if (Strings.isNullOrEmpty(id)) {
LOG.error("unexpected navigation to empty breakpoint id");
return;
}
navigatedSnapshotId = id;
getStateController().resolveBreakpointAsync(id, new ResolveBreakpointHandler() {
@Override
public void onSuccess(@NotNull final Breakpoint result) {
ApplicationManager.getApplication().invokeLater(() -> {
// selections getting queued up.
if (id.equals(navigatedSnapshotId)) {
if (!Boolean.TRUE.equals(result.getIsFinalState()) || result.getStackFrames() == null) {
getBreakpointHandler().navigateTo(result);
if (result.getStackFrames() == null) {
navigateToBreakpoint(result);
}
return;
}
navigateToBreakpoint(result);
}
}, ModalityState.NON_MODAL);
}
@Override
public void onError(String errorMessage) {
LOG.warn("Could not navigate to breakpoint:" + errorMessage);
}
});
}
Aggregations