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

   ### Apache NetBeans version
   
   Apache NetBeans 19
   
   ### What happened
   
   The number one rule of an IDE is that, if I type everything myself (as 
opposed to taking advantage of what the IDE automatically fills in for me), the 
IDE shouldn't get in my way.
   
   So, in PHP, say I want to type:
   ```
   $array['key']
   ```
   I start by typing:
   ```
   $array[
   ```
   The IDE autocompletes it to:
   ```
   $array[]
   ```
   and my cursor is between the `[` and the `]`.
   Now I type a single `'`, and the IDE autocompletes it to:
   ```
   $array['']
   ```
   and my cursor is now between the two `''`s, excellent.
   
   Now I type `key'`, with the closing `'`.
   Intelligently and as expected, when I type the closing `'`, the IDE does not 
add an extra `'`; rather, it replaces the one that it had already added for me 
with the one that I'm typing, so now I have:
   ```
   $array['key']
   ```
   and my cursor is right before the `]`. So far so good.
   
   Now here comes the problem. **When I type the closing `]`** (either because 
I'm used to, or because in the end it's the exact same effort as hitting the 
right-arrow key to move past the `]` that is already there), **the IDE now 
suddenly becomes stupid** and blindly outputs the `]` that I've just typed in 
front of the one that is already there, and I end up with this:
   ```
   $array['key']]
   ```
   and the cursor is between the two `]`s.
   
   Note that this is **ACTUALLY WORSE** than doing no autocomplete at all and 
leaving me type on my own (however, I don't want that either, I want the IDE to 
do an IDE's job).
   
   PHPStorm does this right. **Even Kate does this right**.
   
   
   ### How to reproduce
   
   In a php file type:
   ```
   $array['key']
   ```
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Manjaro Linux
   
   ### JDK
   
   Java: 21; OpenJDK 64-Bit Server VM 21+35
   
   ### Apache NetBeans packaging
   
   Third-party package
   
   ### 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