Use “fuzzy matching” in Visual Studio 2015 to correct misspelled types


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.

 

Use “fuzzy matching” in Visual Studio 2015 to correct misspelled types (www.kunal-chowdhury.com)

 

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:

 

1. Visual Studio 2015 light bulb to correct spelling mistakes of type (www.kunal-chowdhury.com)

 

2. Visual Studio 2015 light bulb to correct spelling mistakes of type (www.kunal-chowdhury.com)

 

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:

 

3. Visual Studio 2015 light bulb to correct spelling mistakes of type (www.kunal-chowdhury.com)

 

4. Visual Studio 2015 light bulb to correct spelling mistakes of type (www.kunal-chowdhury.com)

 

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.

 

5. Visual Studio 2015 light bulb to correct spelling mistakes of type (www.kunal-chowdhury.com)

 

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.

 

 


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

0 comments

 
© 2008-2016 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top