Skip to content

Commit

Permalink
Accessor generator should create formatted version
Browse files Browse the repository at this point in the history
fix #7852
  • Loading branch information
astares committed Nov 25, 2020
1 parent 12edded commit 7d48a5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -59,7 +59,7 @@ RBCreateAccessorsForVariableRefactoring >> defineGetterMethod [
selector := self safeMethodNameFor: definingClass
basedOn: variableName asString.
definingClass
compile: ('<1s><r><t>^ <2s>' expandMacrosWith: selector with: variableName)
compile: ('<1s><r><r><t>^ <2s>' expandMacrosWith: selector with: variableName)
classified: #(#accessing).
^selector
]
Expand All @@ -69,8 +69,8 @@ RBCreateAccessorsForVariableRefactoring >> defineSetterMethod [
| selector definingClass string |
definingClass := self definingClass.
string := self needsReturnForSetter
ifTrue: ['<1s> anObject<r><t>^ <2s> := anObject']
ifFalse: ['<1s> anObject<r><t><2s> := anObject'].
ifTrue: ['<1s> anObject<r><r><t>^ <2s> := anObject']
ifFalse: ['<1s> anObject<r><r><t><2s> := anObject'].
selector := self safeMethodNameFor: definingClass
basedOn: variableName asString , ':'.
definingClass
Expand Down
Expand Up @@ -37,7 +37,7 @@ RBAddVariableAccessorTransformation >> defineGetterMethod [
| selector |
selector := self safeMethodNameFor: self definingClass basedOn: variableName asString.
self definingClass
compile: ('<1s><r><t>^ <2s>' expandMacrosWith: selector with: variableName)
compile: ('<1s><r><r><t>^ <2s>' expandMacrosWith: selector with: variableName)
classified: #(#accessing).
^ selector
]
Expand All @@ -46,7 +46,7 @@ RBAddVariableAccessorTransformation >> defineGetterMethod [
RBAddVariableAccessorTransformation >> defineSetterMethod [

| selector sourceCode |
sourceCode := '<1s> anObject<r><t><2s> := anObject'.
sourceCode := '<1s> anObject<r><r><t><2s> := anObject'.
selector := self safeMethodNameFor: self definingClass basedOn: variableName asString , ':'.
self definingClass
compile: (sourceCode expandMacrosWith: selector with: variableName)
Expand Down

0 comments on commit 7d48a5b

Please sign in to comment.