Name prefix casing

Hi,

I have set up field prefixes "m_" and "s_" in Resharper Options/Languages/Common/Naming Style, but they are not behaving totally as I expected. In particular, when generating a field from a constructor paramater the field name has an initial capital letter (after the m_) which I don't want. For example, the constructor parameter "foo" will have an automatic field name "m_Foo": i would like "m_foo".

Another interesting thing that is observed when you do a rename refactoring to correct m_FooBar to m_fooBar the "rename related symbols" page tries to change the corresponding property FooBar to one called Bar. This is also extremely annoying.

Is there any way to configure this behaviour?

Cheers,
Max

3 comments
Comment actions Permalink

Hi Max,

I couldn't agree more.

If I remember correctly, this used to be the default behavior in the past...

Best Regards,

Wiebe Tijsma


Max Bolingbroke wrote:

Hi,

I have set up field prefixes "m_" and "s_" in Resharper Options/Languages/Common/Naming Style, but they are not behaving totally as I expected. In particular, when generating a field from a constructor paramater the field name has an initial capital letter (after the m_) which I don't want. For example, the constructor parameter "foo" will have an automatic field name "m_Foo": i would like "m_foo".

Another interesting thing that is observed when you do a rename refactoring to correct m_FooBar to m_fooBar the "rename related symbols" page tries to change the corresponding property FooBar to one called Bar. This is also extremely annoying.

Is there any way to configure this behaviour?

Cheers,
Max

0
Comment actions Permalink

This seems to be generally broken in ReSharper 3.0 and hasn't really worked
all that well since ReSharper 1.0. I keep hoping JetBrains will eventually
get around to implementing a ticket that's been open since ReSharper 1.x
days, but I know it's somewhat complex to keep names in sync. When I click
rename, I just turn off the option to rename related entities and do it
manually.

"Max Bolingbroke" <batterseapower@hotmail.com> wrote in message
news:22855814.1188459520274.JavaMail.itn@is.intellij.net...

Hi,

>

I have set up field prefixes "m_" and "s_" in Resharper
Options/Languages/Common/Naming Style, but they are not behaving totally
as I expected. In particular, when generating a field from a constructor
paramater the field name has an initial capital letter (after the m_)
which I don't want. For example, the constructor parameter "foo" will have
an automatic field name "m_Foo": i would like "m_foo".

>

Another interesting thing that is observed when you do a rename
refactoring to correct m_FooBar to m_fooBar the "rename related symbols"
page tries to change the corresponding property FooBar to one called Bar.
This is also extremely annoying.

>

Is there any way to configure this behaviour?

>

Cheers,
Max


0
Comment actions Permalink


Well I never use the option to rename related entities on anyway because
it can have too many side effects,

but the wrong naming convention causes problems in any situation where
fields (private and static) are generated:

- backing fields for properties
- fields from constructor parameters
- etc.

Wiebe

Lothan wrote:

This seems to be generally broken in ReSharper 3.0 and hasn't really
worked all that well since ReSharper 1.0. I keep hoping JetBrains will
eventually get around to implementing a ticket that's been open since
ReSharper 1.x days, but I know it's somewhat complex to keep names in
sync. When I click rename, I just turn off the option to rename related
entities and do it manually.

"Max Bolingbroke" <batterseapower@hotmail.com> wrote in message
news:22855814.1188459520274.JavaMail.itn@is.intellij.net...

>> Hi,
>>
>> I have set up field prefixes "m_" and "s_" in Resharper
>> Options/Languages/Common/Naming Style, but they are not behaving
>> totally as I expected. In particular, when generating a field from a
>> constructor paramater the field name has an initial capital letter
>> (after the m_) which I don't want. For example, the constructor
>> parameter "foo" will have an automatic field name "m_Foo": i would
>> like "m_foo".
>>
>> Another interesting thing that is observed when you do a rename
>> refactoring to correct m_FooBar to m_fooBar the "rename related
>> symbols" page tries to change the corresponding property FooBar to one
>> called Bar. This is also extremely annoying.
>>
>> Is there any way to configure this behaviour?
>>
>> Cheers,
>> Max

0

Please sign in to leave a comment.