Skip to content
This repository has been archived by the owner. It is now read-only.

Initialize field from constructor with custom names #179

Open
piteerus opened this issue Feb 19, 2016 · 5 comments
Open

Initialize field from constructor with custom names #179

piteerus opened this issue Feb 19, 2016 · 5 comments

Comments

@piteerus
Copy link

Provide opiotn for initializing field from constructor parameters using specified template like:

  • m_[paramName]
  • _[paramName]

Names generated by Refactoring Essentials should be customizable or detected by heuristic algoritms from already created fields.

Right now there is no way to change the template how new fields are generated and it uses template:
this.[paramName] = [paramName]
which forces me to rename every time when it's created :)

@disklosr
Copy link

Just installed this extension and first thing I tried is generate fields from constructors and I couldn't find a way to customize the naming convention for private fields to match mine. This is an important settings to have imo.

@Rpinski
Copy link
Member

Rpinski commented Mar 16, 2016

Currently RefactoringEssentials is just a compilation of Roslyn-based analyzers/refactorings. They don't support any configuration. We are thinking about configuration through a JSON file inside of the solution/project in question, but that's only an idea at the moment.

@ivanz
Copy link

ivanz commented Apr 11, 2016

@Rpinski I am willing to potentially spend some time on this, but before I do - do you know if:

  1. Is someone else looking into this already?
  2. Is MS potentially working on or planning something in Roslyn for configuration?

@disklosr
Copy link

@ivanz I know that next version of VS will have a settings panel where we can define code styles like this one.

@Rpinski
Copy link
Member

Rpinski commented May 10, 2016

Also see #84 and the related Roslyn issue dotnet/roslyn#4616.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants