Typing open bracket should surround the selected text with brackets
Surround the selected text with brackets in all editors when an opening bracket is inserted. Brackets included are (,<,[,{,",',`
Fixes https://github.com/eclipse-platform/eclipse.platform.ui/issues/865 #1141
Linked to #1718
Test Results
1 818 files + 483 1 818 suites +483 1h 53m 11s :stopwatch: + 50m 49s 7 712 tests + 1 7 483 :white_check_mark: ± 0 228 :zzz: ± 0 1 :x: +1 24 297 runs +4 430 23 549 :white_check_mark: +4 197 747 :zzz: +232 1 :x: +1
For more details on these failures, see this check.
Results for commit 284107e1. ± Comparison against base commit 54479d7a.
:recycle: This comment has been updated with latest results.
@mickaelistria @laeubi is there an issue with this approach or this issue fix is not required now?
I have some concern that changing selection that way is likely to conflict with some other auto editor strategies that would run after this one for the same event and alter the command changing the size of the inserted text, or that would implement a similar strategy to also change the selection. But both are minor and I think the best way to figure it out is to merge. Another thing I noticed, which is not related and is deeper in the editor, is that this very convenient feature wouldn't work for multiple or block text selection. But this seems out of the scope for this change.
So IMO, please just rebase to get the MANIFEST.MF compatible with current master branch and we can merge.
Content of this PR is plain wrong as it contains many other unrelated changes.
Content of this PR is plain wrong as it contains many other unrelated changes.
Its my mistake. I am checking on it.
this very convenient feature wouldn't work for multiple or block text selection
@mickaelistria It works in generic editor for all cases but works in Java editor only if text blocks surrounds with { and ` Is it expected or is further analysis required to fix this in java editor as well?
https://github.com/user-attachments/assets/4604c702-c1fc-4eb8-9fe2-3804008bad7c
The Java editor has some extra configuration here and there to tweak the edition experience. I don't mind merging it if it works for the generic editor and most text editors. The JDT part will probably have to be investigated in JDT directly anyway, without need to fix anything here. I'm sorry we missed to merge this change earlier, since we're in RC phase, it's most likely better to wait until next stream starts (so we have time to get feedback and improve it if necessary).
Now is a good time to merge. Thank you! Please add a note to the noteworthy documentation about this new feature.
Thank you for this PR! @mickaelistria the next time please make sure that such long standing PRs are rebased so that the version-bump bot can do it's duty. This is now missing, but I have created https://github.com/eclipse-platform/eclipse.platform.ui/pull/2598, to apply it.
Oops, sorry and thank you for addressing it!
@mickaelistria you suggest that JDT can tweak this, but the way it is configured doesn't allow subclasses to override the behavior. What did you have in mind when you gave green light to merge?
please fix https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1843
please fix eclipse-jdt/eclipse.jdt.ui#1843
Please also consider comments from @szarnekow and do not fix JDT UI, but improve platform code - the change here shouldn't break clients!
Just discovered that this change also broke source hover functionality in Java editor (Shift + Hover over method to see implementation) => https://github.com/eclipse-platform/eclipse.platform.ui/issues/2600
I will check the root cause and fix it ASAP . Thanks for reviewing .
Where is the feature? The option is lost in the last Eclipse builds. What happened?
The feature seems available by default in most text ediors; but the Java Editor seems to override it so it's not available for Java files. An issue should be opened to eclipse-jdt (if not already done) to make this work there too.
I use CDT and there are no editors that supports this features. But a few updates ago it'd been working. I'm pretty sure there was an option in General/Text Editors preferences. And now it's gone. What am I doing wrong?