We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
md5: b62dcc1461f29e6a0e7ddf70d290afa4
Issue Description:
Refactoring that outputs a "best-effort" member-wise init for a class or struct.
Local refactoring, cursor based
Availability: Cursor on class or struct name
Process: For every stored property create a argument with the same name.
class Derived: Base {{{ }}
class Derived: Base {
{{ let property1: Type1}}{{ }}
{{ let property2: Type2?}}
{{}}}
This would generate:
init(property1: Type1, property2: Type2?) {{{ }}
init(property1: Type1, property2: Type2?) {
{{ self.property1 = property1}}
{{ self.property2 = property2}}
{{ super.init()}}
Note: This code is "best-effort" as it may or may not compile depending on the requirements of Base initialization.
public struct Struct {{{ }}
public struct Struct {
{{ let property2: Type2}}
Would create:
public init(property1: Type1, property2: Type2) {{{ }}
public init(property1: Type1, property2: Type2) {
The text was updated successfully, but these errors were encountered:
Comment by Ray Fix (JIRA)
My thought was to dip my toe into refactoring by working on this.
Sorry, something went wrong.
No branches or pull requests
Additional Detail from JIRA
md5: b62dcc1461f29e6a0e7ddf70d290afa4
Issue Description:
Refactoring that outputs a "best-effort" member-wise init for a class or struct.
Local refactoring, cursor based
Availability: Cursor on class or struct name
Process: For every stored property create a argument with the same name.
class Derived: Base {
{{ }}{{ let property1: Type1}}{{ }}
{{ let property2: Type2?}}
{{}}}
This would generate:
init(property1: Type1, property2: Type2?) {
{{ }}{{ self.property1 = property1}}
{{ self.property2 = property2}}
{{ super.init()}}
{{}}}
Note: This code is "best-effort" as it may or may not compile depending on the requirements of Base initialization.
public struct Struct {
{{ }}{{ let property1: Type1}}{{ }}
{{ let property2: Type2}}
{{}}}
Would create:
public init(property1: Type1, property2: Type2) {
{{ }}{{ self.property1 = property1}}
{{ self.property2 = property2}}
{{}}}
The text was updated successfully, but these errors were encountered: