Debugger: remove unnecessary whitespaces in presentation of line breakpoint variants
This commit is contained in:
@@ -190,6 +190,7 @@ Issues fixed:
|
||||
- Show error message when debug info for some local variable is corrupted
|
||||
- Avoid 1s delay in completion in debugger fields if session is not stopped on a breakpoint
|
||||
- Avoid cast to runtime type unavailable in current scope
|
||||
- Fix text with line breaks in popup with line breakpoint variants
|
||||
|
||||
### Java to Kotlin converter
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.xdebugger.XSourcePosition;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpoint;
|
||||
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
|
||||
import kotlin.text.StringsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties;
|
||||
@@ -155,6 +156,11 @@ public class KotlinLineBreakpointType extends JavaLineBreakpointType {
|
||||
super(position, element, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return StringsKt.replace(super.getText(), " ", "", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return KotlinIcons.FUNCTION;
|
||||
|
||||
@@ -36,7 +36,9 @@ import org.jetbrains.kotlin.idea.refactoring.getLineNumber
|
||||
import org.jetbrains.kotlin.idea.refactoring.getLineStartOffset
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||
import org.jetbrains.kotlin.psi.psiUtil.parentsWithSelf
|
||||
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
|
||||
import java.util.*
|
||||
|
||||
fun canPutAt(file: VirtualFile, line: Int, project: Project, breakpointTypeClass: Class<*>): Boolean {
|
||||
@@ -96,11 +98,12 @@ fun computeVariants(
|
||||
|
||||
val result = LinkedList<JavaLineBreakpointType.JavaBreakpointVariant>()
|
||||
|
||||
val mainMethod = KotlinLineBreakpointType.getContainingMethod(pos.elementAt)
|
||||
val elementAt = pos.elementAt.parentsWithSelf.firstIsInstance<KtElement>()
|
||||
val mainMethod = KotlinLineBreakpointType.getContainingMethod(elementAt)
|
||||
if (mainMethod != null) {
|
||||
result.add(kotlinBreakpointType.KotlinLineBreakpointVariant(
|
||||
XSourcePositionImpl.createByElement(mainMethod),
|
||||
CodeInsightUtils.getTopmostElementAtOffset(pos.elementAt, pos.offset) ?: mainMethod))
|
||||
CodeInsightUtils.getTopmostElementAtOffset(elementAt, pos.offset) ?: mainMethod))
|
||||
}
|
||||
|
||||
lambdas.forEachIndexed { ordinal, lambda ->
|
||||
|
||||
Reference in New Issue
Block a user