This is a migrated thread and some comments may be shown as answers.

Naming Convention bug?

1 Answer 153 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 01 Jun 2012, 05:23 PM
Running vs2010 with Version Q2 2012 Internal Build (2012.2.531.4)

When I switch private fields to use camel_Underscore it looks like the code change reccomendation stays as camelCase even after restarting VS2010 or doing a refresh on the CodeAnalysis.
Am I just misunderstanding how that rule should translate private fields?

What I was originally looking to do was _camelCase which I realize is accomplished by putting the underscore in the prefix box.

Thanks,

John

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 05 Jun 2012, 10:58 AM
Hi,

Thank you for your feedback. Setting a rule to camel_Underscore would allow words that are camel case to have underscores within them. For example camel_Case is allowed from this rule. However, camelCase words start always with a lower case letter. That is why a warning is shown when an identifier like this is found _camelCase and the prefix box is empty.
As you have found out - if you want identifiers to start with a underscore, you should add underscore in the prefix box. If you want them to contain underscores set the rule to camel_Underscore.
If you have any more questions or remarks, please do not hesitate to contact us again!

Greetings,
Ivan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Code Analysis
Asked by
John
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or