-
Notifications
You must be signed in to change notification settings - Fork 166
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
Modern and well-integrated Find-replace #1091
Modern and well-integrated Find-replace #1091
Conversation
As mentioned on the issue, changing the editors or views layout is a bit too much at the moment. |
I think this one looks great. Eclipse search dialog is one of the worst out their and with your change, it looks very modern (and similar to other modern tools). Would it be possible to have individual commits for isolated changes / isolated enhancements? For example, extraction of the search logic so that is can be reused? We prefer to have have isolated commits and it think isolating your changes into smaller commits will make it more likely to get them integrated. |
Thanks for your feedback @mickaelistria @vogella! |
@merks The existing dialog must remain existant and working anyway, since we we don't know who may uses it for their views. Even if it was possible to replace the old dialog with a new visualization without breaking existing APIs (syntactically or w.r.t. their existing contracts), it is not what you should expect from the Eclipse platform. However, it is also a goal of the new functionality to make views able to define their search provider (like @Wittmaxi has prototyped for the problems view), so that it may even be possible that structured viewers in EMF adopt that functionality easily. |
Please get started with creating the first PR which should be merged. Making plans is good, getting started with the integration of new functionality even better. A good approach is typically to start with desired refactorings which do not change functionality but make the code easier to read and re-use before adding new functionality. |
What is the status of this one? Should it be closed as #1192 is in now? |
@akurtakov yes! |
Proposal: modern and well-integrated Find-replace
Proof of concept implemented in my Fork of eclipse.ui
Problem
User-Interface
The current solution opens a Modal on keypress Control + F - prompting a user to enter a string for finding
and optionally a string to replace the currently found string with.
The status quo also has multiple options for searching which are available by selecting
the appropriate checkbox.
Integration
A lot of views currently don't provide a Find/Replace functionality. The Find/Replace-Dialog binds to them but will not perform any actions. Furthermore, the Interface of the Find/Replace-Functionality using
IFindReplaceTargetExtension
is rigid and taylor-made for Editor-Views only.Solution
The solution will
The new solution aims at being enabled by default in some products such as the IDE.
It is up for discussion wether the implementations should have a button to swith to the other representation (i.e., to modify the preference)
Look and Feel
Design goals
The new Dialog should be well integrated, within the workbench and not on top. Additionally, the Dialog should be very easy to use quickly and not feel like a burden to use.
Design Options
I have opted for integrating the search-bar on the bottom of the editor (like IntelliJ does). There is an option to implement the Dialog as a subtle overly to the view (like in VSCode). This can be discussed in the exploration phase of this Proposal.
Concrete Proof of Concept
The Design is not definitive and can be discussed. The Icons will be replaced to fit into the general Eclipse-Theme
The proposed solution consists of an inline-search bar, that pops up from below the text-editor.
3
and4
Additional
As a proof-of-concept, the same dialog was implemented for the
Problems View
to show that this feature can easily be extended to other views. The Problems-view does not allow for replacing, for example, so the search-bar does not show that as an option.As part of the interface-design, each view can optionally specify which "search providers" it supports (See Search-providers), if it wants to provide a search-functionality.
Design (Engineering)
The old Dialog
Part of this proposal is extracting the business-logic of the old Find/Replace-Dialog and sharing it with the new inline visualization. This brings the following advantages:
Search-providers
Each view should be able to specify it's search-providers and it's search-options. When opening the FindReplace-popupbar, the the bar will request the viewpart for search providers and a UI-renderer from the viewpart. It is likely tha tthe UI-Renderer will be shared across most views while the functional search provider will depend on the view type.
Further ideas
More search options
Inline-toolbar
This proposal introduces an "inline popup toolbar", which can later be used by other features which are currently implemented as modals, for example a new refactoring.
Views that provide support for such an inline toolbar, can inherit from
IInlinePopupToolbarProvider
which specifies functions for creating the toolbar composite and closing it.