mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[debugger] new UI for inline breakpoints, IDEA-324621
* prevent put of "line and lambdas" breakpoint in case of new UI GitOrigin-RevId: 8054680085287585cfa11e59aed3528ae1c546dd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6ac20a4dc7
commit
424e5d0867
@@ -46,10 +46,7 @@ import com.intellij.xdebugger.frame.XExecutionStack;
|
||||
import com.intellij.xdebugger.frame.XStackFrame;
|
||||
import com.intellij.xdebugger.frame.XSuspendContext;
|
||||
import com.intellij.xdebugger.frame.XValueContainer;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XBreakpointBase;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XBreakpointManagerImpl;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XBreakpointUtil;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
|
||||
import com.intellij.xdebugger.impl.breakpoints.*;
|
||||
import com.intellij.xdebugger.impl.breakpoints.ui.grouping.XBreakpointFileGroupingRule;
|
||||
import com.intellij.xdebugger.impl.evaluate.quick.common.ValueLookupManager;
|
||||
import com.intellij.xdebugger.impl.frame.XStackFrameContainerEx;
|
||||
@@ -280,7 +277,8 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
|
||||
|
||||
Promise<List<? extends XLineBreakpointType.XLineBreakpointVariant>> variantsAsync = getLineBreakpointVariants(project, types, position);
|
||||
if (areInlineBreakpointsEnabled()) {
|
||||
return variantsAsync.then(variants -> {
|
||||
return variantsAsync.then(variantsWithAll -> {
|
||||
var variants = variantsWithAll.stream().filter(v -> !InlineBreakpointInlayManager.isAllVariant(v)).toList();
|
||||
|
||||
var breakpointOrVariant = getBestMatchingBreakpoint(caretOffset,
|
||||
Stream.concat(
|
||||
|
||||
@@ -214,13 +214,6 @@ internal class InlineBreakpointInlayManager(private val project: Project, privat
|
||||
}
|
||||
}
|
||||
|
||||
private fun isAllVariant(variant: XLineBreakpointType<*>.XLineBreakpointVariant): Boolean {
|
||||
// Currently, it's the easiest way to check that it's really multi-location variant.
|
||||
// Don't try to check whether the variant is an instance of XLineBreakpointAllVariant, they all are.
|
||||
// FIXME[inline-bp]: introduce better way for this or completely get rid of multi-location variants
|
||||
return variant.icon === AllIcons.Debugger.MultipleBreakpoints
|
||||
}
|
||||
|
||||
private fun areMatching(variant: XLineBreakpointType<*>.XLineBreakpointVariant, breakpoint: XLineBreakpointImpl<*>, codeStartOffset: Int): Boolean {
|
||||
return variant.type == breakpoint.type &&
|
||||
getBreakpointVariantRangeStartOffset(variant, codeStartOffset) == getBreakpointRangeStartOffset(breakpoint, codeStartOffset)
|
||||
@@ -274,5 +267,17 @@ internal class InlineBreakpointInlayManager(private val project: Project, privat
|
||||
@JvmStatic
|
||||
fun getInstance(project: Project): InlineBreakpointInlayManager =
|
||||
project.service<InlineBreakpointInlayManager>()
|
||||
|
||||
/**
|
||||
* Returns whether this breakpoint variant covers multiple locations (e.g. "line and lambdas" aka "All").
|
||||
* Such variants aren't used with new inline breakpoints inlays because user can manually put separate breakpoints at every location.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun isAllVariant(variant: XLineBreakpointType<*>.XLineBreakpointVariant): Boolean {
|
||||
// Currently, it's the easiest way to check that it's really multi-location variant.
|
||||
// Don't try to check whether the variant is an instance of XLineBreakpointAllVariant, they all are.
|
||||
// FIXME[inline-bp]: introduce better way for this or completely get rid of multi-location variants
|
||||
return variant.icon === AllIcons.Debugger.MultipleBreakpoints
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user