I used to be able to search for a text in every file in solution, like that: http://vvcap.net/db/lWMPaSHxormUrFYlLo0Q.htp . After upgrading to VS2010 SP1, this doesn't work anymore:
Find all "description", Match case, Whole word, Subfolders, Keep modified files open, Find Results 1, "Entire Solution", "*.*"
No files were found to look in.
Find was stopped in progress.
What's interesting, I can still search if I know file extension, like this: http://vvcap.net/db/IFr8jCUa7J79sauBsNFC.htp :
Find all "description", Match case, Whole word, Subfolders, Keep modified files open, Find Results 1, "Entire Solution", "*.cs"
...
...
Matching lines: 485 Matching files: 109 Total files searched: 970
Anyone knows wtf is going on here, and how to get around this?
I don't know what happened, but now my VS is searching for "*" again. Maybe after last windows update... I have no reasonable explanation as to wtf happened
It's a known bug. You can get the visual studio search results to appear by using CTRL + Break in the Find Results window
Related
In the file Foo.razor, I have the code <span style="font-size: smaller">. When I search for "font-size: sm" in the entire solution, there are 3 results, 1 of course in Foo.razor. But when I add an "a", so I search for "font-size: sma", I only get 2 results. Visual Studio does not find it in Foo.razor. Why and how can I get really all results?
Adding more letters does not help. With less letters, the text is found in Foo.razor. But I do not think, it is the number of letters, because searching for "font-size: sma" does deliver results, but not the one in Foo.razor.
I know, there is an issue with the search results, described here. But the accepted answer does not solve my problem.
Here's a screenshot of my search window:
Many thanks!
I want to simplify Visual Studio Find in Files result, and I found a posting.
And I found it is not quite satisfactory.
Is there a way to display partial portion of directory in find result window?
ie)
x:\users\myname\project\solution_home\project1_home\src\project1.cpp
x:\users\myname\project\solution_home\project1_home\src\helper.cpp
x:\users\myname\project\solution_home\project2_home\src\helper.cpp
into
\project1_home\project1.cpp
\project1_home\helper.cpp
\project2_home\helper.cpp
IMHO, filename alone is not enough to distinguish important result, particulary in large soultion.
but, I want to eliminate certain part of directory path being repeated in every single result.
I wish there would be directory depth designation in $d format string.
ie)
$0d : file's directory
$1d : parent directory
$2d : parent of parent
... etc
Is there any extension and/or technique to do this?
PS: sorry for my poor english
I have something of a hack for this problem: map the local path to a drive. For example:
> subst Y: x:\users\myname\project\solution_home
Your Find Results will then be:
Y:\project1_home\project1.cpp
Y:\project1_home\helper.cpp
Y:\project2_home\helper.cpp
N.B. It has the side effect of breaking the CodeLens Team indicators (which must be a bug).
In VS Find and Replace > Replace in Files seems to repeatedly search skipped matches before finding new matches.
Perform a Find and Replace in multiple files: File_1, File_2 and File_3
Skip one of the matches on File_1 and proceed to the next file with Find Next
Make some replacements on the next file, File_2, using Replace
After the final replacement on File_2, the Find Next match goes back to previously searched files, File_1 in this case, before going on to matches in File_3
I end up skipping through more and more previously searched files and skipped matches, just to find new matches. The Skip File option doesn't seem to help.
Is there a way to make Find/Replace search all un-searched files before looping back to the previously searched files?
I'm using VS 2012 but I seem to remember the same behavior in 2010.
Update: this is a bug. Please vote for a fix on this Visual Studio UserVoice suggestion.
I never noticed that. You can do a Find in Files, Find All. That way you have a list of all instances and can work your way down the list. Double-click the first one, press Ctrl-H, and replace or skip all matches in that file. Go back to your list and click the first match in the next file.
It will be harder to lose your place this way, but it is still tedious if you have a lot of files/matches to go through.
VS 2013 has the same behavior, in case you were curious. Sorry I don't have a better answer.
I am using ctrl+shift+f to trigger "Find and replace", going to the tab "Replace in files".
I do a regexp search in the entire solution (which contains around 11000 files) for:
#layout(\d+)-top
replacing that with
#layout$1 .layout-top
A lot of files are changed by the operation, but when I after the operation open a certain css file, I still can read lines like:
#layout5-top,
#layout6-top
{
width: 960px;
height: 104px;
margin: 0 auto;
}
Why?
If I do the same search & replace with that file open, the operation will affect the file.
I can find numerous files that are not changed by the way.
In the progress indicator that comes up when the search and replace runs, I see that every file is processed, not just open files.
I hit exactly the same problem. It only seems to happen when using a regular expression. I know that the files are being matched because if I swap to just 'find in files', the correct lines are matched in the files. It seems to be a bug to me. Possibly, Microsoft don't trust us not to shoot ourselves in the foot with regexes. ;)
The only way I could resolve it was to select the option:
Replace All will open all files with changes for editing
If you don't get this warning dialog, you may have disabled it, see here.
Then just type ALTfl to save all files and close all.
This seemed to work when there were around 200 files with replacements (the full set of files searched was around 10000). I am not sure how many files Visual Studio can have open at one time, so I imagine at some point it will no longer work or replacements will be missed, in which case you may need to run it a number of times.
Let's say I have a folder on my desktop with the following files:
file_c.txt
file_c-1.txt
file_b.txt
file_b-1.txt
file_a.txt
file_a-1.txt
Then, I do a finder search, in the folder, looking at the filenames and not the content.
If I enter a search criteria of: -1.
I get NO results!
Also, I cannot seem to find ANY documentation on escaping, wildcarding, or anything on the search function inside a folder....
Does anyone know how to search for this type of filename? I have a client that I have to constantly filter out these types of files from the contents of a folder on my desktop, so it would be REALLY helpful to simply search for them and delete them en mass.
Anyone run into this before? And how did you resolve it?
You need to enclose the search string in quotes: "-1." which now should give the result you want.
I banged my head on a desk for a long time before I figured this one out by accident.
I also count'd find anything online... weird.