Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Mar 29, 2024
1 parent 150d7e9 commit dd9fa6a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ private void populateItemsFromScope(ASTNode node, String namePrefix, Completions
MethodNode method = GroovyASTUtils.getMethodFromCallExpression(mce, astContext);
if (method != null && method.getParameters().length > argIndex) {
Parameter parameter = method.getParameters()[argIndex];
// we are currently in a method_call(closure) structure
// try to find a DelegatesTo
for (AnnotationNode ann : parameter.getAnnotations(ClassHelper.makeCached(DelegatesTo.class))) {
Expression valueExpr = ann.getMember("value");
ClassNode classNode = null;
Expand All @@ -536,8 +538,7 @@ private void populateItemsFromScope(ASTNode node, String namePrefix, Completions
if (valueExpr instanceof ConstantExpression ce) {
try {
classNode = ClassHelper.makeCached(Class.forName(ce.getText()));
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
} catch (ClassNotFoundException ignored) {
}
}
}
Expand Down

0 comments on commit dd9fa6a

Please sign in to comment.