How can I make VS2010 insert using statements in the order dictated by StyleCop rules.
Posted
by Hamish Grubijan
on Stack Overflow
See other posts from Stack Overflow
or by Hamish Grubijan
Published on 2010-05-20T15:31:46Z
Indexed on
2010/05/20
15:40 UTC
Read the original article
Hit count: 212
The related default StyleCop rules are:
- Place
using
statements insidenamespace
. - Sort
using
statements alphabetically. - But ...
System
using
come first (still trying to figure out if that means justusing System;
orusing System[.*];
).
So, my use case:
- I find a bug and decide that I need to at least add an intelligible Assert to make debugging less painful for the next guy. So I start typing
Debug.Assert(
and intellisense marks it in Red. I hover mouse overDebug
and betweenusing System.Diagnostics;
andSystem.Diagnostics.Debug
I choose the former. This insertsusing System.Diagnostics;
after all otherusing
statements. It would be nice if VS2010 did not assist me in writing code that won't build due to warnings as errors.
How can I make VS2010 smarter? Is there some sort of setting, or does this require a full-fledged add-in of some sort?
© Stack Overflow or respective owner