From 8651ca23e670436a5bdd2588aa260ad4f51b7df3 Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Sat, 15 Jun 2024 13:41:31 +0200 Subject: [PATCH] 3rd fix attempt --- .../eclipse/jdt/internal/codeassist/impl/AssistParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java index 2194e88bdff..3c03fd5d3dd 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistParser.java @@ -566,9 +566,10 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean } else { statementEnd = statement.sourceEnd; } + boolean insideType = false; for (int i = this.elementPtr; i >= 0; --i) { if (this.elementKindStack[i] == K_TYPE_DELIMITER) - return false; + insideType = true; if (this.elementKindStack[i] != K_LAMBDA_EXPRESSION_DELIMITER) continue; LambdaExpression expression = (LambdaExpression) this.elementObjectInfoStack[i]; @@ -659,7 +660,7 @@ protected boolean triggerRecoveryUponLambdaClosure(Statement statement, boolean } } } - if (this.snapShotPtr > -1) + if (this.snapShotPtr > -1 && !insideType) popSnapShot(); return lambdaClosed; }