You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "php4fan (via GitHub)" <gi...@apache.org> on 2023/11/15 16:47:48 UTC
[I] Typing closing ] adds an extra ], stupidest thing I've ever seen [netbeans]
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: 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
Re: [I] "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly [netbeans]
Posted by "php4fan (via GitHub)" <gi...@apache.org>.
php4fan commented on issue #6706:
URL: https://github.com/apache/netbeans/issues/6706#issuecomment-1816296223
The exact literal example I gave reproduces it for me, I don't know why it doesn't for 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
Re: [I] "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6706:
URL: https://github.com/apache/netbeans/issues/6706#issuecomment-1815778270
I can't reproduce it. Maybe, there is a difference between your context and mine.
So, please write a reproducible 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
Re: [I] "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 closed issue #6706: "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly
URL: https://github.com/apache/netbeans/issues/6706
--
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: [I] "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6706:
URL: https://github.com/apache/netbeans/issues/6706#issuecomment-1817506358
Fixed.
--
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: [I] "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6706:
URL: https://github.com/apache/netbeans/issues/6706#issuecomment-1817258650
OK, Reproducible, now. Thanks for your example 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
Re: [I] "Insert closing brackets automatically" doesn't handle closing square bracket "]" correctly [netbeans]
Posted by "php4fan (via GitHub)" <gi...@apache.org>.
php4fan commented on issue #6706:
URL: https://github.com/apache/netbeans/issues/6706#issuecomment-1816980801
You're right, it does depend on the context.
I have found a minimal reproducing example.
Try this:
```
<?php
$yyy = 123;
$xxx = "[$yyy lalala]";
// Type below here
```
And there you type `$array['key']`.
The `$yyy = 123;` is not necessary, it's just to make sure that you reproduce the issue with 100% valid code.
The line provoking the issue (i.e. `$xxx = .....`) doesn't have to be near to where you type, the mere presence of something like that in the whole file will cause the issue, as far as I can tell wherever you type.
If you change this:
```
$xxx = "[$yyy lalala]";
```
to this:
```
$xxx = "[$yyy]";
```
then it will no longer reproduce.
--
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: [I] Typing closing ] adds an extra ], stupidest thing I've ever seen [netbeans]
Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on issue #6706:
URL: https://github.com/apache/netbeans/issues/6706#issuecomment-1813648635
Please remove unnecessary things from the issue title.
--
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