Skip to content

Feature: Support multiple searches #16488

Closed

Description

@KalitaAlexey

Hi everybody.

Currently VSCode supports only one active search: I cannot look for multiple things at a time.
I often have need in this feature.
I can implement it myself if someone will guide me.
I suggest to add new tab "Searches", which looks like this:
collapsed_searches
And it expands to:
expanded_searches
Unfortunately, I haven't made a close button. Imagine there is a close button to the right of a search entry.
When a user starts a search, then an entry in the searches is created.
When a user clicks on a search entry, then the entry's search becomes active.
When a user clicks on the close button of a search entry, then the entry is deleted.

I am waiting for your opinions to this feature.

Activity

  1. sandy081 commented on Dec 7, 2016

    @sandy081
    Member

    Alexey (@KalitaAlexey) Very much appreciated with your thoughts and ideas. I see that your base requirement is that you wanted to look multiple things at a time. Can you please explain in little more details how do you want to see above results at the end. Possibly with an example would be good.

    Thanks

  2. KalitaAlexey commented on Dec 7, 2016

    @KalitaAlexey
    Author

    Hi Sandeep Somavarapu (@sandy081),
    Only one search is active at a time.
    Results of the search is shown under the configuration of a search. As it is made now.
    I will include screenshots.

  3. KalitaAlexey commented on Dec 8, 2016

    @KalitaAlexey
    Author

    Hi Sandeep Somavarapu (@sandy081),
    I try to implement it myself.

  4. sandy081 commented on Dec 8, 2016

    @sandy081
    Member

    Alexey (@KalitaAlexey) We are always welcome to receive PRs for VS Code. But I would suggest before starting, it would be good to discuss in detail.

    • What is the problem?
    • What is the proposed solution?
    • Are there any other current ways to overcome the problem

    Hence, I asked to know how the end result looks like and is it going to fix the problem? It would be helpful if you can explain me with an example.

    Thanks

  5. KalitaAlexey commented on Dec 8, 2016

    @KalitaAlexey
    Author

    Hi Sandeep Somavarapu (@sandy081),
    I am downloading source code. I am changing the source code just to prepare an example.
    I am sending pictures then.

  6. KalitaAlexey commented on Dec 8, 2016

    @KalitaAlexey
    Author

    Hi Sandeep Somavarapu (@sandy081) and everyone,

    I have thought about this feature and have prepared some screenshots explaining the design.
    I'm sorry for the close button on the screenshots below.
    Let's assume we open a project.
    We navigate to the "Search" tab.
    It is empty:
    empty_search
    We enter A to the "Search" field and press the Enter button.
    It starts a new search.
    When the search is ended, the "Searches" panel appears:
    a_is_added
    We enter B to the "Search" field and press the Enter button again.
    It starts a new search.
    When the search is ended, in the "Searches" panel the new search appears:
    b_is_active_search
    I click on the "A" search in the "Searches" panel.
    The "A" search becomes active:
    a_is_active_search

    If the close button of a search is clicked, then the associated search is removed.
    If all searches are removed, the "Searches" panel is hidden.

    Unresolved questions

    Should a new search be added to the "Searches" panel either when the search started or ended?

    If it would be added when it is started, then we should think about whether a running search may be cancelled.

    Is an active search customizable?

    If it would be, then there should be a way to start a new search.

    Regards,
    Alexey

  7. sandy081 commented on Dec 8, 2016

    @sandy081
    Member

    Alexey (@KalitaAlexey) Thanks for the details. I am wondering why not using the following flow with current design (Single Search)

    -> Search for value1 you see results
    -> Search for value2 you see results
    -> If you want to see previous results, navigate history in Search input using alt+up and enter and you see results.
    -> if you want to see results matching value1 or value2 at a time why not use Reg ex `(value1)|(value2)

    I am not getting the use case that needs to show results for two search terms at a time. May be I am not sure, but I have not seen in any editor that shows multiple search results at a time.

    Sorry, but I am trying to get the need to build this functionality and how everybody can gain by this.

    Thanks

  8. KalitaAlexey commented on Dec 8, 2016

    @KalitaAlexey
    Author

    Sandeep Somavarapu (@sandy081),
    I didn't know about alt+up, but anyway it doesn't preserve search results. I must start search again.
    Think about it if a project very very big.

  9. leup commented on Jan 26, 2017

    @leup

    Being able to keep search results would be very nice. Sometimes it's useful to be able to switch between search results without relaunching the search everytime.
    So, may be a checkbox "Open results in a new pane", or something.
    Netbeans, for example, keep results in different panes.

    image

    Here, for instance, I searched for "grdf" and "test", and each result set is kept in a different pane.

  10. theclapp commented on Feb 8, 2017

    @theclapp

    You can use regular expressions to search for multiple items at once, though it's obviously still all the same single search. E.g. from your example above, "A|B" would search for A and B at the same time. (Make sure you enable regular expressions for that search; on a Mac, Opt-Cmd-R.)

  11. KalitaAlexey commented on Feb 8, 2017

    @KalitaAlexey
    Author

    Larry Clapp (@theclapp),
    I'd rather open a new window and search there.
    What if I already use regex for something ugly and complex?

  12. leup commented on Feb 8, 2017

    @leup

    Alexey (@KalitaAlexey) 👍
    Larry Clapp (@theclapp) I agree that it could be a solution for some simple searches, but this is not what I am looking for.

  13. theclapp commented on Feb 8, 2017

    @theclapp

    Use parentheses: (ugly-complex-expression)|(some-other-expression)

    Don't get me wrong: You can ask for this (or implement it!), that's fine with me. I'm not saying you shouldn't. I'm just saying there are alternatives or workarounds out there.

    If someone does do this, might I suggest highlighting the different finds in different colors.

  14. KalitaAlexey commented on Feb 8, 2017

    @KalitaAlexey
    Author

    Larry Clapp (@theclapp),
    I know about alternatives, but it isn't convenient.
    I got your point.

  15. 81 remaining items

  16. JacksonKearl commented on Feb 22, 2020

    @JacksonKearl
    Contributor

    As mentioned earlier, we are supporting multiple searches through search editors, which have been available in preview for a couple releases and will be out of preview in the February release.

  17. NickGrease commented on Feb 22, 2020

    @NickGrease

    I appreciate the effort to improve searches, but this is not what I had hoped for. I have more than enough tabs open as it is, adding a half dozen or more tabs is ridiculous. The side bar is where searches belong (for me, my opinion); horizontal workspace is at a premium, and I hope someone over there can appreciate other peoples workflow and viewing restraints.

    To add to the problem, the tab doesn't even show what files/folders/disks are being searched. The sidebar made it easy to see where the search was performed, and at a glance which files had matches. I don't really enjoy the idea of scrolling through 1000's of lines of search results to see if a match was in a specific file.

  18. JacksonKearl commented on Feb 28, 2020

    @JacksonKearl
    Contributor

    Nick Greazaro (@NickGrease) I appreciate your feedback and understand that this isn't exactly what was originally requested, but at the end of the day we aren't in a position where we can dedicate resources to developing many different competing search models.

    With that said, I would be interested in improving one of the current search models to better suit your needs:

    the tab doesn't even show what files/folders/disks are being searched

    Could you explain what you mean by this? It uses the same query editor widget as the search viewlet.

    I don't really enjoy the idea of scrolling through 1000's of lines of search results to see if a match was in a specific file.

    Wouldn't you be doing this in the viewlet as well?

  19. jaroslawjanas commented on Feb 28, 2020

    @jaroslawjanas

    What I rly end up needing all the time is

    1. Nested searches
    2. Search history/selection
    3. More advanced searches
    4. Better documentation on how to actually search stuff because the one you have at the moment is incredibly confusing (at least for me, maybe I'm stupid)
  20. roblourens commented on Feb 28, 2020

    @roblourens
    Member

    Jarosław Janas (@jaroslawjanas) I would like to hear more about all of those points. Please open a new issue

    1. Honestly I'm not sure what you mean by this
    2. You can navigate history with the up/down arrow keys, please tell me more if it's not what you're looking for
    3. Advanced in what way?
    4. And I'd like to improve the documentation, please tell me what you are struggling with
  21. JacksonKearl commented on Feb 28, 2020

    @JacksonKearl
    Contributor

    Jarosław Janas (@jaroslawjanas)

    1. Nested searches

    Do you mean searching for a string within the results of a different search? This is possible with search editors.

  22. JacksonKearl commented on Feb 28, 2020

    @JacksonKearl
    Contributor

    roblourens I think 2. refers to a global history of the full search configuration, so queries get associated with flags and includes/etc. This could be especially useful now that we have two separate ways to run workspace searches.

  23. jaroslawjanas commented on Feb 29, 2020

    @jaroslawjanas
    1. (4.) I just did a quick google search of search editors didn't find anything in the top searches

    2. I mean a search history similar to history of actions in Photoshop, where you get a table with all of your actions listed in order, so something similar for vs code would be nice, rather than jumping from search to search till you find the one you wanted.

    3. Good question, I don't know why but I find the feature lacking in features (no pun intended), I mean it shouldn't be overdeveloped either but maybe some more UI or something that would make complex searches easier to write. Maybe an option to have a preview based on sample data and then you can just swap your actual search params to do the actual search? That'd be pretty handy.

    4. Usages, cases, examples of difficult searches.

  24. roblourens commented on Feb 29, 2020

    @roblourens
    Member

    Please, let's discuss in a new issue

  25. NickGrease commented on Feb 29, 2020

    @NickGrease

    Jackson Kearl (@JacksonKearl)

    the tab doesn't even show what files/folders/disks are being searched

    Could you explain what you mean by this? It uses the same query editor widget as the search viewlet.
    ImageA

    ImageB

    With multiple tabs open, figuring out which tab was which search, is a pain compared to the sidebar view.

    I don't really enjoy the idea of scrolling through 1000's of lines of search results to see if a match was in a specific file.

    Wouldn't you be doing this in the viewlet as well?

    ImageC

    Using your treatment/implementation, the search for "Test" would mean scrolling past 64 results in Scripts, 24 in documentation, to finally find the 4 in research. Using the image above, it takes a split second.

    When I'm searching hierarchies of folders (that I'm not always familiar with) for bits of api code/functions - I need to see at a glance what folders the results are in. If I search for a function that I expect starts with the word "Load", seeing a list of folders that have matches means I can guess what folder I'm likely looking for, for example,if the results show a dozen folders, one is "ShipAI", one is, ShipCrewAPI" one is "PlanetAPI" - if I was looking for how to "load crew" - I'd know instantly what folder to open results in.

    I hope that makes sense; and at the end of the day I've been managing for well over a year now. You do you, and I'll make do :)

  26. frumbert commented on Mar 3, 2020

    @frumbert

    Jarosław Janas (@jaroslawjanas)

    1. Nested searches

    Do you mean searching for a string within the results of a different search? This is possible with search editors.

    I'd like to search for a term to get a list of the files that match that value. THEN with the list of the files, search only those files for a different term. Currently the process is that I click the file in the search result, the press ctrl-f on the file view and search my second term inside the file, stepping through all the matches. It would be far easier to have a "Search within results" option.

    What are search editors?

  27. locked and limited conversation to collaborators on Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requeston-testplansearch

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions