1

How do I query a CsElement object to see if the element is a static field?

I'm building a pair of m_ and s_ prefix rules for member fields and static fields.

Carl R
  • 8,104
  • 5
  • 48
  • 80

1 Answers1

1

You definitely should take a look at StyleCop+. It already contains all naming rules you're trying to create.

Moreover, it's open-source. So you can find there many examples of different code analysis cases (finding all static fields, member fields, etc.)

Oleg Shuruev
  • 1,339
  • 8
  • 10