How to get Find And Replace to work in VS2022 - visual-studio

When I click on 'Find All' in the 'Find and Replace' (CTRL + SHIFT + F), it is not returning me correct results.
I noted that in the Find output window, it says 'Total Files searched: 2'. So it is just searching two files for all the texts. When I searched for simple text like '{' or 'select', it returns me result from wwwroot\css file and still returns only two files.
In the find window, I've selected file type as : .cs;.vb;.resx;.xsd;.wsdl;.htm;.html;.aspx;.ascx;.asmx;.svc;.asax;.config;.asp;.asa;.cshtml;.vbhtml;.razor;.css;.xml and also selected Look in: 'Entire solution'
I've tried checking unchecking all options on page like Match Case, Match Whole Word, User Regular Expression, Include miscellaneous files etc. Nothing seem to be helping expand the search on other files. It still says Total Files Searched: 2.
Attached screenshot is an example that Title is available on the page I've opened in the background but search doesn't return that in result. The search is getting limited to two pages(two css files), it is not searching the entire solution.
Any pointers on how to fix it ?

Updating to most recent release fixed the search issue.

Related

Xcode: How to find something only in specific file type?

In Android Studio, I could search something in certain file type using the File mask as shown below. e.g. I could search on Kotlin (*.kt) files only
In Xcode, is it possible to do so as well? E.g. I would like to search only on the Swift file (*.swift). I don't see any filter as shown below, other than Ignore/Matching Case
Below the search field, there's an icon with three dots and a line above and below. In the default case, "In Workspace" is printed next to it.
Click this icon/text and a list of scopes is shown. Click the "+ New Scopeā€¦".
You can define complex rules for your scope, but in your case you would just need one: select File extension in the attribute field, is equal to in the condition field and swift in the value field.
You can give your scope a name and save it if you need it often.
But there is also a second solution: just do your search. At the very bottom of the search panel you see a circle icon with three lines, similar to the "ground" symbol used in electrics (IMHO); next to it is a text field with placeholder "Filter". Enter *.swift here to filter the search results for hits in Swift files.
An alternative way and arguably quicker way to do it is to just type the extension in the filter section below the list of matches.

How to specify the Keyword for search engines in Firefox?

It keeps bothering me that I cannot manage the Keyword for "One-click search engines". The keyword could be displayed as follows in Firefox 38.0.1
Through the help link, I found ways to add/hide/remove search engines. However, it did not give any suggestion on how to modify the search engine.
The practical motivation for me to learn how to change the keyword is that:
Firefox cannot sync "search engines" across different installations. Only bookmarks and add-ons could be synced, so far.
I am using Vimperator with Firefox, where pressing o (or t) followed by TAB, then keyword for search engine, will enable the finishing a search query sequence. Example:
:open google happy 2015
will launch a Google result page searching for "happy 2015".
So, the syntax is: ":open keyword search-pattern".
Can anyone tell me how to change the "keyword" of a search engine? Or, give instruction on how to create a search engine of my own? (either on the web or locally loaded is fine.)
To edit the keyword for a search engine, double-click on the search engine's entry, or highlight it and press F2.
Solution in short, as kindly offered by Brandon Parmenter, goes as follows:
:bmark http://example.com/search#q=%s -keyword=example
Start of the longer/older answer
Though the solution inspired by the following link does not change the entries for search engine, it does offer a fully functional keyword feature.
wikiHow:How to Add a Custom Search Engine to Firefox's Search Bar
Unlike what has been suggested in the external link, no further add-on is needed. The following steps will complete the definition of a search-keyword:
Go to the page on which one can search. (Either google.com, or github.com, or whatever)
Right click the search box (through which one can type search inquiry) and select "Add a Keyword for this search"
Define the keyword and press enter
This is not defining a search engine, but rather a search-keyword. Keywords defined in this way is stored as a Bookmarks entry.
So far, it is yet unclear how would conflicting keywords between search-engines-keywords and one we just defined should be resolved. Hopefully, since Firefox is syncing Bookmarks items, search-keyword may be synced to other installations.
Since the question to modifying the search-engine-keyword is yet unsolved, I will not accept my own answer.
Additionally, if one would be interested to look into the Bookmark entry, %s is the "place-holder" in the "Location" field of such bookmark that will be subsituted by whatever one would like to search.
To programatically change the keyword of a search engine you can do it like this:
var allEngines = Services.search.getEngines()
for (var i=0; i<allEngines.length; i++) {
var currentEngine = allEngines[i];
console.log('name of current engine:', currentEngine.name);
var currentKeyword = currentEngine.alias; // is null if no current key word
}
To change the keyword programtically just set currentEngine.alias
Here is a variable viewer in browser console of allEngines you see its an array and each entry is like this, in this image here one entry is expanded:
If you know the name you can just get the engine by name with var currentEngine = Services.search.getEngineByName('Bing')

How do I exclude commented lines from searches in Xcode?

Is it possible to exclude commented lines (either individual, or groups) from searches in Xcode?
If so, how can this be done?
No, you cannot exclude comment lines from Xcode search.
You can use "search scopes" to search more efficiently in Xcode:
Reference by Apple docs:
The refined search navigator allows all current search options and settings to be seen at a glance. The options are easily manipulated by clicking directly on them in the search navigator. You can set search scopes, including selecting multiple folders in a project, and save them by name for easy re-use. The search results display wraps to allow you to see ore results easily and quickly.

Best Way to Modify Another Programmer's Navigation

"Change an item in the navigation? Sure I can do that in 15 minutes."
So I am trying to update the navigation on a site that I inherited only to find out that the previous programmer was a college student and was using this site as a project of some sort. Needless to say there are zero comments and the code calls function after function and I just can't follow the logic.
I am looking for a roundabout way to update the navigation. I tried using Dreamweaver to search through all of the files in the site and look for any files that contain the name of the page or the url (hoping to find some sort of included file). There was none. I did file text files that control the main navigation but none for the subnavigation.
There is no database.
If it helps here is the site. http://bit.ly/jbs639
And if you want to look at the interesting text file that is parsed to create the main navigation you can find it here: http://bit.ly/m3erna
Hmmm.... Interesting indeed. You have my sympathy.
One thing that I would look at... The file that gets parsed for the main navigation appears to be a simple delimited file. Sure, the delimiter is a rather unusual +++, but that choice means it avoids conflict with things like commas that might be desirable in the link text. It looks as if the last element indicates what type of resource is being accessed (file or directory, although I don't know what - if any - effect that has on the final output). It also appears that there are similar text files (in the framework/cfg/nav/ folder... which should probably not be generally accessible BTW) for the sub-menus. (E.g. the file stores.txt appears to contain the additional navigation items associated with the stores sub-navigation).
You don't mention which sub-menu you're trying to change. I suspect it is the "About TTO" one, which I can't find an entry for... but I'd look to see if there are any similar navigation text files in the /content/about/ folder.
Good Luck!
Of course it was as simple as a function that reads all of the files in the directory and the name of the file. I guess that in this case there was no shortcut.

Search certain files only

In VS2010 is it possible to search within a certain file type only?
I want to search just my cs code and exclude .aspx files and VS generated code from datasets and edmx files.
Go to Find in Files and fill out your search string in Find What: and expand Find options and fill out Look at these file types: with *.cs.
Under Find and Replace/Find in Files (Ctrl+Shift+F), expand "Find options", then you'll notice a box called "look at these file types". Enter "*.cs" in there, and it'll only look at files with the .cs extension.
For more information, you may refer to http://msdn.microsoft.com/en-us/library/dechx2tz.aspx.
Use the Find in Files search.
You can specify the extensions of the files you want to search.
On the "Find in Files" dialog, there is a 'Look in these file types' option, under 'Find Options'

Resources