You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "lbownik (via GitHub)" <gi...@apache.org> on 2023/03/30 08:44:26 UTC

[GitHub] [netbeans] lbownik commented on a diff in pull request #5745: Fix code completion for `@mixin` #4683

lbownik commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1152933862


##########
php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ClassScopeImpl.java:
##########
@@ -335,6 +336,13 @@ public Collection<? extends FieldElement> getInheritedFields() {
                 allFields.add(new FieldElementImpl(traitScope, field));
             }
         }
+        // GH-4683 get fields of mixin
+        Set<TypeMemberElement> mixinTypeMembers = index.getAccessibleMixinTypeMembers(this, this);
+        for (TypeMemberElement mixinTypeMember : mixinTypeMembers) {
+            if (mixinTypeMember instanceof org.netbeans.modules.php.editor.api.elements.FieldElement) {
+                allFields.add((new FieldElementImpl(this, (org.netbeans.modules.php.editor.api.elements.FieldElement) mixinTypeMember)));
+            }

Review Comment:
   how about ?
   index.getAccessibleMixinTypeMembers(this, this).stream().
        filter(m -> m instanceof FieldElement).
        map(m -> new FieldElementImpl(this, (FieldElement) m).
        forEach(allFieds::add).



-- 
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-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists