Visual Studio 2015 Light Bulb – If you have been using Visual Studio 2015, you will undoubtedly run into the Light Bulb during your ventures into the new IDE. This is a very handy tip and one that is really easy to make use of. This productivity feature is so subtle but incredibly handy and always in the right place at the right time.
Visual Studio 2015 Light Bulb
Using the code example from yesterday, let us assume that we forgot to include the correct namespace for Thread.Sleep. Visual Studio 2015 will highlight errors in your code as usual.
If you hover your mouse cursor over this error, a light bulb will be displayed (on the line that generated the error) that will show you potential fixes to the issues Visual Studio 2015 highlighted in your code.
You can click on the light bulb or you can use the shortcut (Crtl + .) to see the available fixes.
Visual Studio 2015 Light Bulbs offer various fixes in the example above such as importing the correct namespace, changing the line of code to the full qualifier by putting the namespace in front of the Thread method, as well as several other suggestions. Another nice addition to the light bulb suggestion is the code sample preview included to the right of the suggested fix.
As a new productivity feature in Visual Studio 2015, light bulbs make for an excellent way to keep developers writing correct code by bringing the suggested fix or refactoring into a single focal point directly on the line the error is on.
For more information check out the MSDN article here and see the Channel 9 video below. Mark Wilson Thomas discusses how Visual Studio 2015 assists developers to find and remove common coding mistakes on the fly.