Issue 3261 in pharo: Fix select unchanged definitions for variableSubclass: class defs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3261 in pharo: Fix select unchanged definitions for variableSubclass: class defs

pharo
Status: Fixed
Owner: stephane.ducasse
Labels: Type-Squeak Milestone-1.2

New issue 3261 by stephane.ducasse: Fix select unchanged definitions for  
variableSubclass: class defs
http://code.google.com/p/pharo/issues/detail?id=3261

Fix select unchanged definitions for variableSubclass: class defs

=============== Diff against Tools-eem.256 ===============

Item was changed:
   ----- Method: ChangeList>>selectUnchangedDefinitions (in category 'menu  
actions') -----
   selectUnchangedDefinitions
    "Selects all recognizable definitions for which there is already a  
definition in the current image, whose source is exactly the same."
    | change class tokens |
    Cursor read showWhile:
    [1 to: changeList size do:
    [:i | change := changeList at: i.
    listSelections at: i put: false.

    (change type = #method
    and: [(class := change methodClass) notNil
    and: [class includesSelector: change methodSelector]]) ifTrue:
    [listSelections
    at: i
    put: change string withBlanksCondensed
    = (class sourceCodeAt: change methodSelector) asString  
withBlanksCondensed].

    (change type == #classComment
    and: [(class := change commentClass) notNil]) ifTrue:
    [listSelections at: i put: change string = class comment asString].

    change type == #doIt ifTrue:
    [tokens := Scanner new scanTokens: change string.

    ((tokens select:
+ [:substr| #(subclass: variableSubclass: variableByteSubclass:  
variableWordSubclass:
- [:substr| #(subclass: variableByteSubclass: variableWordSubclass:
    instanceVariableNames: classVariableNames: ) includes: substr])
    asSet size >= 3
    and: [(class := Smalltalk at: tokens third ifAbsent: []) notNil
    and: [class isBehavior]]) ifTrue:
    [listSelections
    at: i
    put: change string withBlanksCondensed
    = class definition withBlanksCondensed].

    (tokens size = 4
    and: [tokens second == #class
    and: [tokens third == #instanceVariableNames:
    and: [(class := Smalltalk at: tokens first ifAbsent: []) notNil
    and: [class isBehavior]]]]) ifTrue:
    [listSelections
    at: i
    put: change string withBlanksCondensed
    = class class definition withBlanksCondensed].

    (tokens size = 3
    and: [tokens second == #removeSelector:
    and: [(class := Smalltalk at: tokens first ifAbsent: []) isNil
    or: [class isBehavior and: [(class includesSelector: tokens third)  
not]]]]) ifTrue:
    [listSelections at: i put: true].

    (tokens size = 4
    and: [tokens second == #class
    and: [tokens third == #removeSelector:
    and: [(class := Smalltalk at: tokens first ifAbsent: []) isNil
    or: [class isBehavior and: [(class class includesSelector: tokens  
fourth) not]]]]]) ifTrue:
    [listSelections at: i put: true]]]].

    self changed: #allSelections!



Reply | Threaded
Open this post in threaded view
|

Re: Issue 3261 in pharo: Fix select unchanged definitions for variableSubclass: class defs

pharo

Comment #1 on issue 3261 by stephane.ducasse: Fix select unchanged  
definitions for variableSubclass: class defs
http://code.google.com/p/pharo/issues/detail?id=3261

related to Issue 2818


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3261 in pharo: Fix select unchanged definitions for variableSubclass: class defs

pharo
Updates:
        Status: Closed

Comment #2 on issue 3261 by stephane.ducasse: Fix select unchanged  
definitions for variableSubclass: class defs
http://code.google.com/p/pharo/issues/detail?id=3261

in 12240