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


   https://issues.apache.org/jira/browse/NETBEANS-4443
   
   - https://wiki.php.net/rfc/constructor_promotion
   
   #### Part 1
   
   - Fix the parser
   - Fix the `PHP80UnhandledError`
   - Add unit tests for the parser
   
   ##### PHP 8.0
   
   
![nb-php80-constructor-property-promotion](https://user-images.githubusercontent.com/738383/104383194-cbdfb300-5572-11eb-8803-64d7c9f2e7cc.png)
   
   ##### PHP 7.4
   
   
![nb-php80-constructor-property-promotion-php74](https://user-images.githubusercontent.com/738383/104383198-cedaa380-5572-11eb-9a7b-404b6f77b2e9.png)
   
   #### Part 2
   
   - Fix the model to index promoted constructor parameters as fields
   - Add the `getModifier` method to the `ParameterElement`
   - Add unit tests for the Model, the Index, and the Navigator
   
   #### Part 3
   
   - Fix hints and SemanticAnalysis
       * InitializeFieldSuggestion (Just ignore)
       * UnusedVariableHint (Just ignore)
       * WrongOrderOfArgsHint  
       
![nb-php80-constructor-property-promotion-wrong-order-of-args-hint](https://user-images.githubusercontent.com/738383/104384977-be77f800-5575-11eb-99d8-c502cd9f805d.gif)
       * FieldRedeclarationHint  
       
![nb-php80-constructor-property-promotion-field-redeclaration1](https://user-images.githubusercontent.com/738383/104384398-bcfa0000-5574-11eb-89e6-fbc74c5e6800.png)
  
       
![nb-php80-constructor-property-promotion-field-redeclaration2](https://user-images.githubusercontent.com/738383/104384497-e74bbd80-5574-11eb-9e01-5a940c431074.png)
       * SemanticAnalysis  
       
![nb-php80-constructor-property-promotion-semantic-analysis](https://user-images.githubusercontent.com/738383/104383780-b7e88100-5573-11eb-98a8-d69582e4e534.png)
   
   
   #### Part 4
   
   - Fix the code generator feature
   
![nb-php80-constructor-property-promotion-code-generator](https://user-images.githubusercontent.com/738383/104385692-0c413000-5577-11eb-89ce-7fec3947be17.gif)
   
   
   #### Part 5
   - Add unit tests for the formatting feature
   - Change the indent behavior in the following case
   ```php
   // there is no parameter
   class Test {
       public function __contruct(^){}
   }
   
   // before: don't add the new line
   class Test {
       public function __contruct(
               ^){}
   }
   
   // after: add the new line
   class Test {
       public function __contruct(
               ^
       ){}
   }
   ```
   
   ```php
   // this behavior is the same as before
   // there is a parameter
   class Test {
       public function __contruct(private int $field,^){}
   }
   
   // don't add the new line
   class Test {
       public function __contruct(private int $field,
               ^){}
   }
   
   ```
   
   #### Part 6
   
   - Fix the MarkOccurences and the GotoDeclaration features
   
   #### Part 7
   
   - Fix the Code Completion feature
   - Fix a bug of the following case for the formatter
   ````php
   // example code
   // if there is an incomplete parameter
   class Example {
       public function __construct(
               private
       ) {}
   }
   
   // result: before
   class Example {
       public function __construct(
       private
       ) {}
   }
   
   // result: after
   class Example {
       public function __construct(
               private
       ) {}
   }
   
   ```


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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to