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

[GitHub] [netbeans] junichi11 opened a new pull request, #5745: Fix code completion for `@mixin` #4683

junichi11 opened a new pull request, #5745:
URL: https://github.com/apache/netbeans/pull/5745

   - https://github.com/apache/netbeans/issues/4683
   - Also get mixin fields as inherited fields
   - Fix CC for the following case: `$variable->field::STATIC_MEMBER;`
   


-- 
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


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

Posted by "lalo-mx (via GitHub)" <gi...@apache.org>.
lalo-mx commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1153632596


##########
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:
   off-topic: any ideas to improve debugging of lambda expressions?



-- 
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


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

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1153628352


##########
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:
   Thanks. Nothing personal, of course ☺️



-- 
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


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

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1153227216


##########
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:
   I don't want to do it. Maybe, hard to debug.



-- 
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


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

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1153662057


##########
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:
   I am not sure but I think that IntelliJ IDEA has some special "view" fir it when debugging. And also, a hint to convert streams into loops (and vice versa). 
   



-- 
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


[GitHub] [netbeans] tmysik merged pull request #5745: Fix code completion for `@mixin` #4683

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik merged PR #5745:
URL: https://github.com/apache/netbeans/pull/5745


-- 
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


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

Posted by "lbownik (via GitHub)" <gi...@apache.org>.
lbownik commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1153588929


##########
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:
   just a loose suggestions, feel free to ignore :)



-- 
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


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

Posted by "lbownik (via GitHub)" <gi...@apache.org>.
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


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

Posted by "lbownik (via GitHub)" <gi...@apache.org>.
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


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

Posted by "tmysik (via GitHub)" <gi...@apache.org>.
tmysik commented on code in PR #5745:
URL: https://github.com/apache/netbeans/pull/5745#discussion_r1153574010


##########
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:
   I tend to agree - streams are nice and useful for simple things. But quite difficult to debug in case of problems 😅



-- 
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