A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-ct.1033.mcz ==================== Summary ==================== Name: Tools-ct.1033 Author: ct Time: 12 March 2021, 1:17:45.909559 pm UUID: 19163e49-2ba1-3148-981f-2e219da2c514 Ancestors: Tools-mt.1030 Fixes styling in change sorters if no real method is selected. No need to invoke Shout on messages such as "method was removed". Using an instance variable for this to avoid duplication of the contents logic. Reuploaded to fix #warnIverNotCopiedIn:sel: warning. Replaces Tools-ct.1031, which can be moved to the treated inbox. =============== Diff against Tools-mt.1030 =============== Item was changed: CodeHolder subclass: #ChangeSorter + instanceVariableNames: 'parent myChangeSet currentClassName currentSelector priorChangeSetList contentsAreStyleable' - instanceVariableNames: 'parent myChangeSet currentClassName currentSelector priorChangeSetList' classVariableNames: '' poolDictionaries: '' category: 'Tools-Changes'! + !ChangeSorter commentStamp: 'ct 3/10/2021 18:24' prior: 0! - !ChangeSorter commentStamp: 'wiz 2/3/2010 23:38' prior: 0! I display a ChangeSet. Two of me are in a DualChangeSorter. aStringOrNil Instance Variables currentClassName: <aStringOrNil> currentSelector: <aStringOrNil> myChangeSet: <aChangeSet> parent: <aDualChangeSorterOrNil> priorChangeSetList: <aCollection> + contentsAreStyleable <aBoolean> currentClassName - string parseable into class-name [class] [class trait] needs to be fitlered by (self withoutItemAnnotation: currentClassName) to remove pakaging note currentSelector - string parseable into selector-name needs to be fitlered by (self withoutItemAnnotation: currentSelector) to remove pakaging note myChangeSet - name of current changeset parent -the dual changesorter that contains this one. Used for dealing with the other half. priorChangeSetList + - holds the current change set list. Used to detect changes in list when a newly generated list no long match the prior list.! - - holds the current change set list. Used to detect changes in list when a newly generated list no long match the prior list. - ! Item was changed: ----- Method: ChangeSorter>>aboutToStyle: (in category 'code pane') ----- aboutToStyle: aStyler "This is a notification that aStyler is about to re-style its text. Set the classOrMetaClass in aStyler, so that identifiers will be resolved correctly. Answer true to allow styling to proceed, or false to veto the styling" + contentsAreStyleable ~= false ifFalse: [^false]. - self isModeStyleable ifFalse: [^false]. - self currentSelector ifNil: [^false]. aStyler classOrMetaClass: self selectedClassOrMetaClass. ^true! Item was changed: ----- Method: ChangeSorter>>setContents (in category 'code pane') ----- setContents "return the source code that shows in the bottom pane" | sel class strm changeType | self clearUserEditFlag. + contentsAreStyleable := false. myChangeSet ifNil: [^ contents := String empty]. "should not happen but can" currentClassName ifNil: [^ contents := myChangeSet preambleString ifNil: [String empty]]. class := self selectedClassOrMetaClass. (sel := self selectedMessageName) == nil ifFalse: [changeType := (myChangeSet atSelector: (sel := sel asSymbol) class: class). changeType == #remove ifTrue: [^ contents := 'Method has been removed (see versions)']. changeType == #addedThenRemoved ifTrue: [^ contents := 'Added then removed (see versions)']. class ifNil: [^ contents := 'Method was added, but cannot be found!!']. (class includesSelector: sel) ifFalse: [^ contents := 'Method was added, but cannot be found!!']. + contentsAreStyleable := true. contents := class sourceCodeAt: sel. (#(prettyPrint prettyDiffs) includes: contentsSymbol) ifTrue: [contents := class prettyPrinterClass format: contents in: class notifying: nil]. + self showingAnyKindOfDiffs ifTrue: [ + contentsAreStyleable := false. + contents := self diffFromPriorSourceFor: contents]. - self showingAnyKindOfDiffs - ifTrue: [contents := self diffFromPriorSourceFor: contents]. ^ contents := contents asText makeSelectorBoldIn: class] ifTrue: [strm := WriteStream on: (String new: 100). (myChangeSet classChangeAt: (self withoutItemAnnotation: currentClassName)) do: [:each | each = #remove ifTrue: [strm nextPutAll: 'Entire class was removed.'; cr]. each = #addedThenRemoved ifTrue: [strm nextPutAll: 'Class was added then removed.']. each = #rename ifTrue: [strm nextPutAll: 'Class name was changed.'; cr]. each = #add ifTrue: [strm nextPutAll: 'Class definition was added.'; cr]. each = #change ifTrue: [strm nextPutAll: 'Class definition was changed.'; cr]. each = #reorganize ifTrue: [strm nextPutAll: 'Class organization was changed.'; cr]. each = #comment ifTrue: [strm nextPutAll: 'New class comment.'; cr. ]]. ^ contents := strm contents].! Item was changed: ----- Method: ChangeSorter>>veryDeepInner: (in category 'creation') ----- veryDeepInner: deepCopier "Copy all of my instance variables. Some need to be not copied at all, but shared." super veryDeepInner: deepCopier. "parent := parent. Weakly copied" "myChangeSet := myChangeSet. Weakly copied" currentClassName := currentClassName veryDeepCopyWith: deepCopier. "currentSelector := currentSelector. Symbol" priorChangeSetList := priorChangeSetList veryDeepCopyWith: deepCopier. + "contentsAreStyleable := contentsAreStyleable. Cache"! - - - ! |
Free forum by Nabble | Edit this page |