You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "troizet (via GitHub)" <gi...@apache.org> on 2024/04/12 17:40:06 UTC

[PR] PHP: Fixing a few bugs with phpDoc [netbeans]

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

   - Fix bug where phpdoc for a function or method is generated in the wrong block.
   
   Example:
   ```php
   class ClassExample
   {
   
       public function method1()
       {
           
       }
   
       private function method2($params)
       {
           return false;
       }
   }
   ```
   
   Before:
   
   https://github.com/apache/netbeans/assets/9607501/f2f8b6f6-8d39-4174-83f4-4e8ffe3eb19b
   
   
   After:
   
   https://github.com/apache/netbeans/assets/9607501/6548b366-6ccc-406f-a01c-ec61219c7a99
   
   
   - Fix bug where phpdoc from another block is used to display documentation for a function or method.
   Example:
   ```php
   class ClassExample
   {
   
       public function method1()
       {
           /**
            *
            * @param string $params
            * @return int
            */
       }
   
       private function method2(int $params)
       {
           return 'string';
       }
   }
   ```
   
   Before:
   ![phpdoc_before](https://github.com/apache/netbeans/assets/9607501/a96c719e-ae2c-4430-aa72-c9a66df49aec)
   
   After:
   ![phpdoc_after](https://github.com/apache/netbeans/assets/9607501/3ecaa515-b95e-4ceb-94be-cbf23509401d)
   
   


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


Re: [PR] PHP: Fixing a few bugs with phpDoc [netbeans]

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


##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java:
##########
@@ -78,16 +79,24 @@ public static Comment getCommentForNode(Program root, ASTNode node) {
                 int start = possible.getEndOffset() + 1;
                 int end = getNodeRangeLocatorEndOffset(node);
                 if (start <= end) {
+                    //Check that a possible comment and a node are in the same block
+                    ASTNode cnode = getNodeAtOffset(root, start);

Review Comment:
   Nice.



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


Re: [PR] PHP: Fixing a few bugs with phpDoc [netbeans]

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


##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java:
##########
@@ -78,16 +79,24 @@ public static Comment getCommentForNode(Program root, ASTNode node) {
                 int start = possible.getEndOffset() + 1;
                 int end = getNodeRangeLocatorEndOffset(node);
                 if (start <= end) {
+                    //Check that a possible comment and a node are in the same block
+                    ASTNode cnode = getNodeAtOffset(root, start);

Review Comment:
   Does `c` mean "comment" or "check"?
   I prefer another name to `cnode`.



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


Re: [PR] PHP: Fixing a few bugs with phpDoc [netbeans]

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


##########
php/php.editor/src/org/netbeans/modules/php/editor/parser/api/Utils.java:
##########
@@ -78,16 +79,24 @@ public static Comment getCommentForNode(Program root, ASTNode node) {
                 int start = possible.getEndOffset() + 1;
                 int end = getNodeRangeLocatorEndOffset(node);
                 if (start <= end) {
+                    //Check that a possible comment and a node are in the same block
+                    ASTNode cnode = getNodeAtOffset(root, start);

Review Comment:
   Renamed to `nodeAtStartOffset`. 



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


Re: [PR] PHP: Fixing a few bugs with phpDoc [netbeans]

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


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