Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Surround a selection with brackets and quotes in all kind of text editors #1141

Closed
sergeniously opened this issue Sep 19, 2023 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sergeniously
Copy link

({[<"'Hello'">]})

The greeting above was texted in VSCode's default text editor by typing the word Hello, selecting it and sequentially pressing each opening bracket and quote. Is not it amazing?

In all modern and self-respecting IDEs (aka VSCode, CLion, etc) there is a feature that surrounds a selected text with brackets or quotes when you type an opening bracket or quote: (, {, [, <, ", '. It is an extremely useful feature for those people who value their time.

I would say it is the only thing I'm missing in Eclipse since Eclipse CDT has a Bug 431534 in its Surround with... feature which prepends unwanted spaces for ${word_selection} and so that cannot be considered as an applicable feature.

I've come here with the feature request from eclipse-cdt because I think it would be better implement it in the general TextEditor base class so that every Eclipse plugin will automatically support the feature (which could be optionally enabled/disabled in General / Text Editors preferences).

Furthermore, this feature together with another excellent and unique Eclipse feature of selecting text between brackets by double-click could make Eclipse the currently best IDE in the World!

Thank you in advance.

@merks
Copy link
Contributor

merks commented Sep 19, 2023

@sergeniously

Probably you have plans to contribute. All modern self-respecting developers contribute to open source:

https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md

@sergeniously
Copy link
Author

sergeniously commented Sep 20, 2023

@merks
I would be glad to try to contribute if you at least guided me to source files I have to consider to implement the feature.

@merks
Copy link
Contributor

merks commented Sep 20, 2023

If you create an development environment with all the source (as in the link), then you can determine something similar in the editor as it currently functions, and search the source to find out how that's implemented, and, using the debugger to set breakpoints, to see how it's really working at runtime. Unfortunately few are likely to have much time to offer detailed guidance; I'm personally not familiar with the editor implementation to provide such guidance. Perhaps some other other contributor will see this exchange and offer better suggestions.

@sratz
Copy link
Member

sratz commented Sep 20, 2023

org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.BracketInserter might be a good starting point

@codeofandrin
Copy link

How is this basic feature not implemented yet ^^

@mickaelistria
Copy link
Contributor

#1718 is work in progress towards that.

@codeofandrin
Copy link

Sorry, my message was innapropriate, it just drives me crazy that this isn't implemented since years 😄. It's an asked feature since over 9 years (at least this SO question suggests so) which every other recognized IDE has implemented by default (and it's not the only basic feature that is missing in Eclipse).

@laeubi
Copy link
Contributor

laeubi commented Aug 30, 2024

It's an asked feature since over 9 years

If people would not just asking for features but help implementing them it would probably already be there, 9 years seem enough time for that ;-)

and it's not the only basic feature that is missing in Eclipse

I'm working with Eclipse for > 10 yeas (and others even more) even without the "basic features missing" so at least it seem to offer some useful things for a while.

@mickaelistria
Copy link
Contributor

Contributions are welcome to the project. Random comments which do not provide anything constructive are actually wasting everyone's time.

@mickaelistria
Copy link
Contributor

Fixed with #2051 (some fixes yet to be implemented though, but feature is here and following issues are tracked in different tickets)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants