-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: Support multiple searches #16488
Comments
@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 |
Hi @sandy081, |
Hi @sandy081, |
@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 |
Hi @sandy081, |
Hi @sandy081 and everyone, I have thought about this feature and have prepared some screenshots explaining the design. If the close button of a search is clicked, then the associated search is removed. Unresolved questionsShould 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, |
@KalitaAlexey Thanks for the details. I am wondering why not using the following flow with current design (Single Search) -> Search for 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 |
@sandy081, |
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. Here, for instance, I searched for "grdf" and "test", and each result set is kept in a different pane. |
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.) |
@theclapp, |
@KalitaAlexey 👍 |
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. |
@theclapp, |
This is an absolute must for me and a few of my co-workers. We have a very large codebase. Currently, I use IntelliJ. I'm often involved in very large refactors. I might do a search for something that I need to refactor. I work my way down the list slowly. I might have that search tab open for a day and a half. If I need to search for something else, I can search in a new tab without losing my place in my refactoring effort. Switching between search terms is not a viable solution to this problem since I lose my place in the search results every time I have to do a new search. This is a feature that NetBeans, IntelliJ, and even Sublime Text (via a plugin) have. If you'd like to see how IntelliJ did the UI:
By default, the "Open in new tab" is unchecked so as not to confuse the newbies. However, more advanced users such as myself have it checked all the time. BTW, this is the single, most important feature that prevents me from being able to use VS Code. |
I agree that this is an important feature. Often when analyzing the results of a search it's helpful to run additional exploratory searches without losing the context on the original search. One helpful feature that search currently has is a close button to remove individual files from the search to prune out irrelevant results. If you've been analyzing and pruning a search and then start a new search, you currently lose all of the pruning you've done. |
@sandy081 , Although i have nothing extra to add, VS2015, provides this option via ctrl+shift+f, append results or list results in results 2 window. This would be a good addition to VSCode if you can accommodate the request. |
But please don't limit count of searches to 2. |
I like VS Code very much and try to use it as much as possible. However multiple searches is one feature for which I am forced to get help from some other editor. I would suggest taking a look at Notepad++ before designing the feature for VS Code. |
+1 to multiple search windows. It is very helpful when you want to do follow up searches to understand the context of something you found in the first search. I often have to fire up Idea just for this specific thing. Would like to be able to move to VSCode for everything. |
One nice workaround to handle this problem is to do:
You can even do it from the terminal within VS Code. This will pop open a temporary file with the search results, and you can edit or delete them as you go through them. |
This is mandatory, how can we get this prioritized? |
Encountered same use case, I downloaded another editor for simple solution, but would love to see this in VScode |
Hey all, this sprint I'll be working on a somewhat related feature, "Search Tabs", where search results can be copied over to a tab while preserving "go-to-result" support. You could have an arbitrarily large number of these "Search Tabs", but (at least for the initial implementation), the query will not be modifiable once the results have been dumped into a tab. I believe this would solve many of the pain points listed in this thread, and I'm interested to hear if anyone here has a use case that would not be satisfied with such a model. |
@JacksonKearl That sounds perfect, especially if the search tabs will be formatted in the same way as the search results, i.e. grouped by source file and with the option to permanently remove items from the list once they have been assessed to be either irrelevant or dealt with. |
@aramando The search tabs will be text editors (a. la. Sublime), so removing results is deleting text. |
@JacksonKearl Awesome! Glad to see movement on this. My opinion is that the search panel should be done away with altogether. Search results should always open in a separate persisted tab. If I think about all the searches I've done recently not a single one of them made sense as a temporary set of results in the side panel. Nearly all global searches I do lead to subsequent searches based on the original result set which is currently impossible to do while keeping the original results around. This lackluster search function is by far my biggest pain point with VSCode. |
@AndrewMorsillo This is just the MVP to start to get an idea of what the Search Editor flow is like, many people have similarly requested to skip the search viewlet/panel entirely and we may in the future make the overall search position configuration |
(Sorry for "invading" this thread - well, it's not really invading, it's about the search feature after all and all other threads are closed.) I really appreciate that you made the search feature remember the search phrases by pressing up/down or alt+up/alt+down. |
@JacksonKearl Having search tabs is a nice to have feature, but I would step a bit further. On every search tabs, there could be a "-" and a "+" button to be able to subtract and add other search tab results to(from) the actual one. On search tabs: On the selection modal: Addition and subtraction should operate between filenames, instead of between the resulted lines since lines can be subtracted out by an in-tab search. |
A new Search Editor implementation is out for testing, which enables having multiple active searches: You can try this out with the Let me know how this works for your multiple searches use cases. More details at #88154. |
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. |
@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? |
What I rly end up needing all the time is
|
@jaroslawjanas I would like to hear more about all of those points. Please open a new issue
|
Do you mean searching for a string within the results of a different search? This is possible with search editors. |
@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. |
|
Please, let's discuss in a new issue |
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? |
See the release notes: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_43.md#search-editors |
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:
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.
The text was updated successfully, but these errors were encountered: