diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionContext.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionContext.java index 573d2b55c4b..a95761eda4b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionContext.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/DOMCompletionContext.java @@ -239,6 +239,11 @@ public int getTokenLocation() { if (wrappingNode instanceof Block block) { return block.statements().isEmpty() ? TL_STATEMENT_START : 0; } + if( wrappingNode instanceof AnonymousClassDeclaration anon) { + if(isWithinTypeDeclarationBody(wrappingNode, this.cuBuffer, this.offset)) { + return TL_MEMBER_START; + } + } wrappingNode = wrappingNode.getParent(); } return 0;