Kenn
Kenn

Reputation: 2769

making a custom resharper rule to support multiple uppercase letters in a field name

So at my new place I my Resharper options files to accommodate the way things work here but I have a slight problem. They love to name things like _personBC. It's everywhere, I can't change and nor do I want to start telling people to change it, it doesn't hurt anything and it's fine except I can't seem to define a rule to deal with it.

I would like to say, "all provate fields need to at start with underscore / lower case" but when I go to "Resharper -> Options -> "Advanced Setting" and try to add a rule there doesn't seem to be a way to say "^_[a-z]*" or something like that - anyone know how I might be able to do this?

Thanks!

Upvotes: 3

Views: 683

Answers (1)

wal
wal

Reputation: 17739

Update

Are you using Resharper 7?

You can press Alt-Enter and add the abbreviation (for example BC or AD) to the abbreviation list:

enter image description here

Previous answer

This irritates me too but alas I don't believe (as of Resharper 7) you can change the settings to be tolerant of adjacent uppercase letters. The default setting for private fields are:

enter image description here

So lots of options but not the one you're looking for!

The only option I see is turning off the inspection options (or show as hint only) so it doesnt distract you.

Upvotes: 6

Related Questions