Re: [PR] Micronaut: Method parameters should be resolvable in expression language [netbeans]
dbalek merged PR #7316: URL: https://github.com/apache/netbeans/pull/7316 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Micronaut: Method parameters should be resolvable in expression language [netbeans]
lahodaj commented on code in PR #7316: URL: https://github.com/apache/netbeans/pull/7316#discussion_r1575996846 ## enterprise/micronaut/src/org/netbeans/modules/micronaut/expression/ExpressionTree.java: ## @@ -564,42 +565,44 @@ public R accept(Scanner scanner, D data) { @Override protected void resolve(EvaluationContext ctx) { -List methods = null; +List elements = null; DeclaredType dt = null; if (callee == null) { -methods = ctx.getContextMethods(); +elements = ctx.getContextElements(); } else { TypeMirror calleeTM = callee.getTypeMirror(ctx); if (calleeTM.getKind() == TypeKind.DECLARED) { dt = (DeclaredType) calleeTM; -methods = ElementFilter.methodsIn(((TypeElement) dt.asElement()).getEnclosedElements()); +elements = ElementFilter.methodsIn(((TypeElement) dt.asElement()).getEnclosedElements()); } } -if (methods != null && !methods.isEmpty()) { +if (elements != null && !elements.isEmpty()) { List argTypes = arguments.stream().map(arg -> arg.getTypeMirror(ctx)).collect(Collectors.toList()); -for (ExecutableElement ee : methods) { -TypeMirror enclType = dt != null ? dt : ee.getEnclosingElement().asType(); -if (enclType.getKind() == TypeKind.DECLARED && identifier.contentEquals(ee.getSimpleName()) && ctx.getTrees().isAccessible(ctx.getScope(), ee, (DeclaredType) enclType)) { -ExecutableType et = (ExecutableType) ctx.getTypes().asMemberOf((DeclaredType) enclType, ee); -List paramTypes = et.getParameterTypes(); -if (ee.isVarArgs() && argTypes.size() >= paramTypes.size() || argTypes.size() == paramTypes.size()) { -boolean match = true; -Iterator paramsIt = paramTypes.iterator(); -TypeMirror param = paramsIt.hasNext() ? paramsIt.next() : null; -for (Iterator argsIt = argTypes.iterator(); match && argsIt.hasNext();) { -TypeMirror arg = argsIt.next(); -if (!ctx.getTypes().isAssignable(arg, param)) { -match = false; +for (Element e : elements) { Review Comment: FWIW - might be easier to use `ElementsFilter.methodsIn`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Micronaut: Method parameters should be resolvable in expression language [netbeans]
ebarboni commented on PR #7316: URL: https://github.com/apache/netbeans/pull/7316#issuecomment-2069516881 hi @dbalek consider rebase on delivery for NB22 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[PR] Micronaut: Method parameters should be resolvable in expression language [netbeans]
dbalek opened a new pull request, #7316: URL: https://github.com/apache/netbeans/pull/7316 Code completion for Micronaut Expression Language should be able to resolve parameters of the annotated method. For example `param` in the following snippet: ``` @XYZ("#{param.toUpperCase()}") void test(String param); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists