mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed incorrect first lambda statement on the line
This commit is contained in:
@@ -894,9 +894,18 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
|
||||
if (body == null || !intersects(lineRange, body)) return null;
|
||||
if (body instanceof PsiCodeBlock) {
|
||||
for (PsiStatement statement : ((PsiCodeBlock)body).getStatements()) {
|
||||
if (intersects(lineRange, statement)) {
|
||||
// return first statement starting on the line
|
||||
if (lineRange.contains(statement.getTextOffset())) {
|
||||
return statement;
|
||||
}
|
||||
// otherwise check all children
|
||||
else if (intersects(lineRange, statement)) {
|
||||
for (PsiElement element : SyntaxTraverser.psiTraverser(statement)) {
|
||||
if (lineRange.contains(element.getTextOffset())) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user