You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
And it expands to:
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.
Reacted by dale tan, Arseni Lapunov, Jens Hausdorf, Matt Dillard, Gabriele, Kurt Froehlich, David Lee Chen, Alex St. Amour, Vuong, vscpp and 218 more
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.
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.
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:
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:
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:
I click on the "A" search in the "Searches" panel.
The "A" search becomes active:
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.
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
Reacted by mkasprz, Christopher Wells and David Judge
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.
Reacted by TomasB, mkasprz, Cyrille Pontvieux, RandallFlagg, Nicolas Breitwieser, Manuel Eduardo Cánepa Cihuelo, binyamin and David Ballesteros
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.
Here, for instance, I searched for "grdf" and "test", and each result set is kept in a different pane.
Reacted by Marius, Himanshu, Yukai Huang, Jesse, mkasprz, Daniel Degasperi, kaniansky, Cyrille Pontvieux, Evgeny Lychkovsky, Tom de Grunt and 24 more
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.)
Reacted by Nicolas Breitwieser, Renato Foot Guimarães Costallat, Sunny Chan and David Judge
Larry Clapp (@theclapp),
I'd rather open a new window and search there.
What if I already use regex for something ugly and complex?
Reacted by paul@gh, Marius, Alex St. Amour, mkasprz, Xiao Meng, Cyrille Pontvieux, Michael Romancuk, Tom Weissinger, RandallFlagg, Xavier Qian and 2 more
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.
Reacted by Nicolas Breitwieser and Darko Maksimovic
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.
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.
Reacted by Jianhui Z, Daijobou, Manuel Eduardo Cánepa Cihuelo, Carlo Cardella, Anna Spysz and Joe Jordan
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?
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)
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.
(4.) I just did a quick google search of search editors didn't find anything in the top searches
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.
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.
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.
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?
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 :)
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.
Activity
sandy081 commentedon Dec 7, 2016
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
KalitaAlexey commentedon Dec 7, 2016
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.
KalitaAlexey commentedon Dec 8, 2016
Hi Sandeep Somavarapu (@sandy081),
I try to implement it myself.
sandy081 commentedon Dec 8, 2016
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.
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
KalitaAlexey commentedon Dec 8, 2016
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.
KalitaAlexey commentedon Dec 8, 2016
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:
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:
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:
I click on the "A" search in the "Searches" panel.
The "A" search becomes active:
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
sandy081 commentedon Dec 8, 2016
Alexey (@KalitaAlexey) Thanks for the details. I am wondering why not using the following flow with current design (Single Search)
-> Search for
value1you see results-> Search for
value2you see results-> If you want to see previous results, navigate history in Search input using
alt+upandenterand you see results.-> if you want to see results matching
value1orvalue2at 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
KalitaAlexey commentedon Dec 8, 2016
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.
leup commentedon Jan 26, 2017
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.
Here, for instance, I searched for "grdf" and "test", and each result set is kept in a different pane.
theclapp commentedon Feb 8, 2017
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.)
KalitaAlexey commentedon Feb 8, 2017
Larry Clapp (@theclapp),
I'd rather open a new window and search there.
What if I already use regex for something ugly and complex?
leup commentedon Feb 8, 2017
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.
theclapp commentedon Feb 8, 2017
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.
KalitaAlexey commentedon Feb 8, 2017
Larry Clapp (@theclapp),
I know about alternatives, but it isn't convenient.
I got your point.
81 remaining items
JacksonKearl commentedon Feb 22, 2020
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.
NickGrease commentedon Feb 22, 2020
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.
JacksonKearl commentedon Feb 28, 2020
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:
Could you explain what you mean by this? It uses the same query editor widget as the search viewlet.
Wouldn't you be doing this in the viewlet as well?
jaroslawjanas commentedon Feb 28, 2020
What I rly end up needing all the time is
roblourens commentedon Feb 28, 2020
Jarosław Janas (@jaroslawjanas) I would like to hear more about all of those points. Please open a new issue
JacksonKearl commentedon Feb 28, 2020
Jarosław Janas (@jaroslawjanas)
Do you mean searching for a string within the results of a different search? This is possible with search editors.
JacksonKearl commentedon Feb 28, 2020
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.
jaroslawjanas commentedon Feb 29, 2020
(4.) I just did a quick google search of search editors didn't find anything in the top searches
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.
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.
Usages, cases, examples of difficult searches.
roblourens commentedon Feb 29, 2020
Please, let's discuss in a new issue
NickGrease commentedon Feb 29, 2020
Jackson Kearl (@JacksonKearl)
With multiple tabs open, figuring out which tab was which search, is a pain compared to the sidebar view.
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 :)
frumbert commentedon Mar 3, 2020
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?
JacksonKearl commentedon Mar 3, 2020
frumbert (@frumbert)
See the release notes: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_43.md#search-editors