Vscode: Save search results

Created on 30 Dec 2016  路  25Comments  路  Source: microsoft/vscode

I love VSCode, but the search result doesn't work all that well sometimes...

For example, it could be great that user can save the details of search results of a folder, such as support copy or export function in search.

  • VSCode Version: 1.8.1
  • OS Version: Microsoft Windows 6.1.7601

Steps to Reproduce:

  1. Click 'Search' button
  2. Enter some keywords and trigger the search
  3. A list of results appears, but user cannot save that results.
*duplicate search

Most helpful comment

There are multiple uses of being able to capture search results in a document.

  1. Ability to use the results for some type of communication to team members.
  2. Ability to do some post processing on results. For example, search all uses of some types of tokens. Then post filtering to find all unique values.
  3. Ability to change the view representation. If the results were captured as CSV for example, sorting on columns by file name, folder, number of results etc.

All 25 comments

@charlestac May I know how it helps in saving search results?

@sandy081 I have a very basic scenario which is logging the search results as part of a document. I can copy the search results out from Notepad++ and proceed further actions (i.e. diff/log/search), so I hope this function could be available as well in VSCode.

Please add this. I've been tasked with determining the scope of rewriting a certain core feature of our code and I want to show my boss just how much work is required. Copying the search results would help me show this.

There are multiple uses of being able to capture search results in a document.

  1. Ability to use the results for some type of communication to team members.
  2. Ability to do some post processing on results. For example, search all uses of some types of tokens. Then post filtering to find all unique values.
  3. Ability to change the view representation. If the results were captured as CSV for example, sorting on columns by file name, folder, number of results etc.

Please add a context menu with "Save" or "Export".
Simply export all items in a log file, or export them in CSV or excel file would be better.
suggested columns:
file path, file name, matched count, match lines, match snippet, etc...

This is a much needed feature.

We currently have a use case to find the files that has a certain snippet. Yeah, the search works but it's kinda tiring to type in all the files that have the snippet.

Having search results in a separate buffer a'la Sublime would be very useful. Maintaining a history and having new searches appended to the buffer would also be great.

Appreciate that this is a nice-to-have though. Possible extension candidate?

This is the one feature that drives me mad for vs code not having - its the only time i've needed to return to notepad++.

Doing search, having full search line matches in a text window to allow more searches and filtering, generating new text file output is a real boon for diagnosis and troubleshooting logs while fixing bugs.

I was also surprised there was no way to even copy the search result text to the clipboard. It's very common in large refactoring projects to start by locating all the affected files, and then transferring the list to a spreadsheet for further analysis and progress tracking. Sure we can do the search with other tools outside VS Code, but that's a pain.

Of course, you can do this in emacs ... :-)

This is indeed a killer feature missing. Why not have a multi-tab search results, like IntelliJ does? Maybe with an option to pin certain search results (or maybe even hierarchical searches).

ideafind

There are so many different ways people would like search results presented.

I would strongly prefer that an API be exposed so that extension authors can make all the flavors of search results that the community wants.

Sure, an API would be even better - I do not insist on having this in the core :-)

Export to JSON would be 馃憣馃徎

I admit being able to save search results would be pretty useful.

I would love to see a also recend search results, it would help me to search two things and compare them.

I think sublimetext had it when i came from it. I just noticed i miss it.

+1

+1

You should also consider putting the search results in an editor like Sublime Text does. Benefits: keeps a history of your search results, allows you to edit them (ex: delete a chunk you don't care about), lets you copy, select paths to files and copy, etc, etc. It's very simple, but very useful.

I wish I could have the search result panel exported to a tab so I could work with multiple result sets that were based on different search queries. Having to reenter search queries and closing out the same unwanted matches wastes time I could be using to fix code. If not a tab, please create the ability to save queries in my settings.json and let me recall a query (and all its filters) using a dropdown box.

@jmo84 i like this approach very much !

+1. Please add this feature. It will make code reviews / security reviews much easier to do inside of VS Code. Example, finding all instances of some pattern, copying out of the search window, and putting into a ticket / code review comment.

+1 definitely useful, export search results

Excellent job! Thank you everyone!

Was this page helpful?
0 / 5 - 0 ratings