You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "Eugene-Melbourne (via GitHub)" <gi...@apache.org> on 2023/06/16 00:29:09 UTC

[GitHub] [netbeans] Eugene-Melbourne opened a new issue, #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Eugene-Melbourne opened a new issue, #6082:
URL: https://github.com/apache/netbeans/issues/6082

   ### Apache NetBeans version
   
   Apache NetBeans 18
   
   ### What happened
   
   If you use Netbeans for PHP 
   and you work with the file that has no class declaration
   and if this file has comments starting with 2 asterisks like so `/** aaa*/ `
   and you use other files with classes there that needs to be added to the `use` section of your file
   then you press `shift `+ `ctrl `+ `i` 
   the `use` section would be added after the last comment of this sort.
   
   But it should be added at the beginning of the file
   
   
   ### How to reproduce
   
   _No response_
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 17
   
   ### Operating System
   
   Windows 10 version 10.0 running on amd64; UTF-8; en_AU (nb)
   
   ### JDK
   
   19.0.1; Java HotSpot(TM) 64-Bit Server VM 19.0.1+10-21
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
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.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] Eugene-Melbourne commented on issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "Eugene-Melbourne (via GitHub)" <gi...@apache.org>.
Eugene-Melbourne commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1595722500

   The code before pressing `shift `+ `ctrl `+ `i`
   
   ```
   <?php
   /**
    * 1
    */
   function one(): Carbon
   {
       return new Carbon();
   }
   /**
    * 2
    */
   function two(): void
   {
       
   }
   ```
   
   The code after pressing `shift `+ `ctrl `+ `i`
   
   ```
   <?php
   /**
    * 1
    */
   function one(): Carbon
   {
       return new Carbon();
   }
   /**
    * 2
    */
   
   
   use Carbon\Carbon;
   function two(): void
   {
       
   }
   ```
   Expercted
   ```
   use Carbon\Carbon;
   <?php
   /**
    * 1
    */
   function one(): Carbon
   {
       return new Carbon();
   }
   /**
    * 2
    */
   function two(): void
   {
       
   }
   ```


-- 
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] KacerCZ commented on issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "KacerCZ (via GitHub)" <gi...@apache.org>.
KacerCZ commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1594239926

   Please add sample code to reproduce the issue with actual and expected outputs.
   Thank you.


-- 
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 issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1600028534

   @Eugene-Melbourne Please write a whole example code to reproduce it.


-- 
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 issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1627746542

   Reverted "FixImports" changes with #6152 
   It should be OK now.


-- 
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] Eugene-Melbourne commented on issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "Eugene-Melbourne (via GitHub)" <gi...@apache.org>.
Eugene-Melbourne commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1606387320

   @junichi11 
   What am I missing in my previous comment with examples [here](https://github.com/apache/netbeans/issues/6082#issuecomment-1595722500)?
   
   What details would make it "whole example"?


-- 
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 issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1606440067

   @Eugene-Melbourne 
   I cannot reproduce it with only your code.
   `Carbon` is not declared.
   Please write all your code to reproduce it always. (Please don't omit anything.)
   Thanks!


-- 
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 closed issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 closed issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"
URL: https://github.com/apache/netbeans/issues/6082


-- 
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] Eugene-Melbourne commented on issue #6082: in PHP, when file has no class, the "use" section created after the last comment starting with "/**"

Posted by "Eugene-Melbourne (via GitHub)" <gi...@apache.org>.
Eugene-Melbourne commented on issue #6082:
URL: https://github.com/apache/netbeans/issues/6082#issuecomment-1607178365

   Thank you for your explanation.
   You are right there is more to it.
   
   The file must have no `namespace`, but the classes should have some `namespace` other than default.
   I did not know this aspect before. Now I understand why it was difficult to reproduce.
   
   so you would need 2 files
   
   1) `MyClass.php`
   ```
       <?php
       namespace App\Helpers;
       class MyClass
       {}
   ```
   2) tmp.php
   ```
   <?php
   /**
    * 1
    */
   function one(): MyClass
   {
       return new MyClass();
   }
   /**
    * 2
    */
   function two(): void
   {}
   ```
   
   The Actual code after pressing `shift `+ `ctrl `+ `i` in `tmp.php`
   ```
   <?php
   /**
    * 1
    */
   function one(): MyClass
   {
       return new MyClass();
   }
   /**
    * 2
    */
   
   
   use App\Helpers\MyClass;
   function two(): void
   {}
   ```
   
   The Expercted  code after pressing `shift `+ `ctrl `+ `i` in `tmp.php`
   
   ```
   <?php
   use App\Helpers\MyClass;
   /**
    * 1
    */
   function one(): MyClass
   {
       return new MyClass();
   }
   /**
    * 2
    */
   function two(): void
   {}
   ```


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