riksoft opened a new issue, #7243:
URL: https://github.com/apache/netbeans/issues/7243

   ### Apache NetBeans version
   
   Apache NetBeans 21
   
   ### What happened
   
   In code like this
   ```
   let a, b;
   switch(a){
        case 0:
                //stuff
                break;
        case 1:
                //stuff
                break;
        default:
        switch(b){
                case 0:
                        //stuff
                        break;
        }
   }
   ```
   formatting with ALT+Shift+F the code is formatted you see above with the 
second switch at the same level of "default". A workaround is to add something 
else before between default and switch. Unfortunately cannot be a comment 
because it has the same problem. Must be code, e.g. a useless "let c;" will do.
   
   ```
   let a, b;
   switch(a){
        case 0:
                //stuff
                break;
        case 1:
                //stuff
                break;
        default:
                let c;
                switch(b){
                        case 0:
                                //stuff
                                break;
                }
   }```
   
   ### Language / Project Type / NetBeans Component
   
   PHP project
   
   ### How to reproduce
   
   Open a PHP project then add a JS file and try the above code.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Debian Bookworm (12)
   
   ### JDK
   
   Java: 17.0.10; OpenJDK 64-Bit Server VM 17.0.10+7-Debian-1deb12u1 Runtime: 
OpenJDK Runtime Environment 17.0.10+7-Debian-1deb12u1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### 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: [email protected]

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