Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
162 views
in Technique[技术] by (71.8m points)

How can I get CodeRush to fix my typing? ( {Get; set;} to {get; set;} ) (spellcheck/capscheck)

My most common issue is the caps is still on when I get to Get in a property setter.

I know ReSharper does this, but, doesn't CodeRush? When I type:

public int Count {Get; set;}

I want

public int Count {get; set;}

Where does one change this?

question from:https://stackoverflow.com/questions/66057100/how-can-i-get-coderush-to-fix-my-typing-get-set-to-get-set-spellch

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'm afraid I'm unable to replicate your initial issue. It seems that my copy of studio automatically corrects this in exactly the way you suggest.

However, in case there is some strange quirk at work for me which is failing to work for you, there is a relatively simple Coderush feature which might help you in this area.

When you wish to declare an autoproperty (as seems to be the case here) simple type:

    ai<space>

Coderush will use a template (upgraded version of snippets) to create the following scenario for you.

AutoPropertyTemplate

From here you simply overtype the default property name of 'PropertyName' with your identifier 'Count' and then hit 'Enter ' twice.

You should now be positioned to create more properties or otherwise continue your code without ever having needed to manually express the boilerplate code.

Side Note: There is a pattern to the characters you type in this template. The 'a' stands for AutoProperty and invokes this particular template. Other options include:

p - Property 
r - Readonly property
v - Variable
m - Method

Capitalizing any of these will make them static.

THe 'i' stands for integer and can be replaced with many alternatives including

s - string
b - bool
d - decimal
d8 - date

/ - Name of class you are within
 - value you have on the clipboard.

And finally you can mix these up in any combination you like.

mi - Method returning integer
pb - Property of type boolean
vd.s,d8 - Variable of type Dictionary<string, date>

I do appreciate this isn't exactly what you asked for, but perhaps it will be of help in the situation you face.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...