Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable "Light Bulb" Quick Action "simplification" for Nullable<T>?

For several reasons we prefer Nullable<Int32> over int?. Wherever possible we prefer Types over keywords - as we do so since C#2 we have a large codebase already using that style.

I recently switched to VS2015 and got the annoying light bulbs all over my code. For Int32 and other related non-generic types I fixed that by using this answer. For Nullable<T> however I cannot find the option to disable nagging.

Suggestion to "simplify" <code>Nullable<Int32></code> to <code>Int32?</code>

How do I disable the IDE0001 Name can be simplified. for Nullable<T>?

like image 489
mbx Avatar asked Aug 14 '15 08:08

mbx


2 Answers

In your project properties, under the Build tab, in "Errors and warnings", add IDE0001 to the set of suppressed warnings. I know this isn't really a warning (just a suggestion) but it's the same infrastructure. That removes the suggestion.

like image 81
Jon Skeet Avatar answered Nov 03 '22 19:11

Jon Skeet


There is a feature-request here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9139204-option-to-disable-quick-action-squiggles

concerning disabling the light-bulb. Please add your votes to this if you agree that it is important.

like image 23
Jif Avatar answered Nov 03 '22 19:11

Jif