-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add quick fix to generate a field and initialize from a constructor parameter #15648
Comments
Re "Generate constructor works the other way" I couldn't find it in VS2015U3, how can I use that? |
Select a bunch of fields/properties. Hit |
Well that wasn't my first guess, although it makes sense when you know how to do it. Wouldn't it be better to put it on the unassigned field and suggest to initialize (all) fields in the (possibly existing) constructor? |
There are many different types of interaction models and entry-points that could help improve things here. From the field. From the constructor. From the parameter. It would be nice to continually improve in this area. |
@CyrusNajmabadi It seems that currently we don't have any analyzer that works on various entry points? I think these kinds of analyzers belong to a different category, namely "code generation". Perhaps we need a separate menu for all applicable code generation options related to a portion of code e.g. a type. |
Probably a duplicate of #8925. |
Generate constructor works the other way, but it would be nice to be able to generate a field and an assignment to it after adding a parameter to a constructor.
With the caret in
string f
, we should be able to generate a field and initialize it.The text was updated successfully, but these errors were encountered: