[DevExpress Support Team: CLONED FROM T294233: Smart Constructor - Add an ability to initialize properties]
Hi Eugene,
I found one more issue with this feature that you might want to address.
If there is a property on the type, whose lower-case representation conflicts with a language keyword, the refactoring produces syntactically incorrect code.
For example, if you have a property "Default" on your class, and use the "cc" template, the resulting constructor parameter is named "default" which is a reserved keyword. This results in an immediate compiler error.
This refactoring should prefix such parameter names with @, i.e. "@default".
SmartConstructor should not get reserved keywords as a parameter name
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
Hi Daniel,
Thank you for informing us about this problem. We'll make corrections and let you know of our results.
Hi Daniel,
We've released the new version of CodeRush for Roslyn, which contains a fix for this problem.
Working on the solution, we added the new Naming Conventions functionality into the product.
It allows you to specify name rules for a different code element such as Namespaces, Types, Members, and these rules will be used in refactorings, declarations and templates automatically.
Indeed it works fine now - thanks!
And the new Naming Conventions feature is definitely a big step forward!
Hi Daniel,
You are welcome.