-
-
Notifications
You must be signed in to change notification settings - Fork 399
[Refactoring] Fix generating accessors variable slots bug #18777
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
base: Pharo14
Are you sure you want to change the base?
Changes from all commits
2e7082d
960ee55
bc96dcd
7546875
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,13 +22,14 @@ SycGenerateVariableAccessorCommand >> defaultMenuItemName [ | |
|
|
||
| { #category : 'execution' } | ||
| SycGenerateVariableAccessorCommand >> execute [ | ||
|
|
||
| (ReGenerateAccessorsDriver new | ||
| targetClass: variables first definingClass; | ||
| scopes: toolContext refactoringScopes; | ||
| selectedVariables: (variables collect: [:each | each name ]) ) runRefactoring | ||
|
|
||
|
|
||
| (ReGenerateAccessorsDriver new | ||
| targetClass: variables first definingClass; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The #definingClass actually gives you the correct class side object for class side variables. variables first definingClass isInstanceSideNo need to analyze the toolContext at all. Variables are first class objects with the full information.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is shame that new driver system is based on raw string names for variables
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal is to make it easy to use for scripting.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @dionisiydk you are right. We should get two APIs. |
||
| scopes: toolContext refactoringScopes; | ||
| scopeInstanceSide: ((toolContext respondsTo: #metaLevelScope) | ||
| ifTrue: [ toolContext metaLevelScope isInstanceSide ] | ||
| ifFalse: [ toolContext isInstanceSide ]); | ||
| selectedVariables: (variables collect: [ :each | each name ])) runRefactoring | ||
| ] | ||
|
|
||
| { #category : 'factory method' } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this one strange.
And I also wondered why we could not use metaLevelOf: even if I do not like the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metaLevelOf: is for classes I think and there we want to check it for variables