How many times it happened that, while writing code, you misspelled a type name? This is most common and this kind of typos can happen with everyone. Visual Studio 2015 provides a way to correct such spelling mistakes using “fuzzy matching” direct from the light bulb.
Today we are going to discuss on this topic and see how it can help you. Continue reading this post and don’t forget to check my other posts on Visual Studio 2015 Tips & Tricks.
If I am not wrong, I guess that the fuzzy matching to correct the misspelled types was introduced in Visual Studio 2015 Update 2. Using this, you can fix the typos not only in the type names but also in the namespace declarations.
Whenever you have such spelling errors, Visual Studio 2015 will highlight those words with a hazy red underline. Hovering over on that will show the light bulb, which when clicked will give you options to correct the type errors.
For example, instead of writing “string” you misspelled it as “strimg” or similar to that. Now the light bulb will provide you option with a preview of changes to correct it to “string” or “String”, as shown in the below screenshots:
Similarly if you have any system level or custom class that you misspelled while declaration or in other code path, you can fix them too from the light bulb. The below two screenshots shows how Visual Studio 2015 corrects “systemhost” and “SystemMonitro” to correct type names “SystemHost” and “SystemMonitor” respectively:
You can also click on the “Preview changes” link to see all the places this will auto correct. The preview changes dialog will list all the files and places where the changes will have effect.
I hope you liked this Visual Studio features which you can find in any latest updates of Visual Studio 2015. If you haven’t upgraded it yet, checkout http://downloads.kunal-chowdhury.com for any latest updates.
Also, don’t miss my other posts on Visual Studio 2015 Tips & Tricks that I already published and also don’t miss my new posts coming on this topic. These will surely improve your daily productivity coding in our favourite Visual Studio 2015.