Skip to content

Commit

Permalink
include code changes in history view
Browse files Browse the repository at this point in the history
  • Loading branch information
tom95 committed Apr 3, 2024
1 parent 72ed5e8 commit 9c4549d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
24 changes: 23 additions & 1 deletion packages/Sandblocks-Babylonian/SBExploriants.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ SBExploriants >> evaluationReceiver [
{ #category : #accessing }
SBExploriants >> ignoreUpdate [

^ ignoreUpdate
^ ignoreUpdate ifNil: [false]
]

{ #category : #accessing }
Expand All @@ -143,18 +143,40 @@ SBExploriants >> initialize [
vResizing: #shrinkWrap
]

{ #category : #initialization }
SBExploriants >> intoWorld: aWorld [

super intoWorld: aWorld.
SystemChangeNotifier uniqueInstance
noMoreNotificationsFor: self;
notify: self ofSystemChangesOfItem: #method using: #methodChanged:
]

{ #category : #testing }
SBExploriants >> isArtefact [

^ true
]

{ #category : #initialization }
SBExploriants >> methodChanged: anEvent [

anEvent isModified ifTrue: [namedBlocks last addCodeSnapshot: anEvent]
]

{ #category : #accessing }
SBExploriants >> objectToPermutation [

^ objectToPermutation
]

{ #category : #initialization }
SBExploriants >> outOfWorld: aWorld [

SystemChangeNotifier uniqueInstance noMoreNotificationsFor: self.
super outOfWorld: aWorld
]

{ #category : #'artefact protocol' }
SBExploriants >> saveTryFixing: aFixBoolean quick: aQuickBoolean [

Expand Down
30 changes: 30 additions & 0 deletions packages/Sandblocks-Babylonian/SBHistoryView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Class {
#category : #'Sandblocks-Babylonian'
}

{ #category : #building }
SBHistoryView >> addCodeSnapshot: aChange [

self submorphs size - 1 "buttonRow" > self maxEpoches ifTrue: [self lastSubmorph delete].

self block addMorph: (self buildCodeSnapshot: aChange) atIndex: 2
]

{ #category : #building }
SBHistoryView >> addEpoche [

Expand All @@ -12,6 +20,28 @@ SBHistoryView >> addEpoche [
self block addMorph: self buildEpoche atIndex: 2
]

{ #category : #building }
SBHistoryView >> buildCodeSnapshot: aChange [

| row lastVersion |
row := self containerRow.

lastVersion := (VersionsBrowser new
scanVersionsOf: aChange item class: aChange item methodClass meta: false
category: aChange item methodReference category selector: aChange item selector) changeList at: 2 ifAbsent: [nil].

^ row
cellGap: 0@10;
listDirection: #topToBottom;
addAllMorphsBack: {
self buildMetaUsageIn: row.
(lastVersion ifNotNil: [
(TextDiffBuilder buildDisplayPatchFrom: lastVersion text to: aChange item getSource inClass: aChange item methodClass prettyDiffs: false)] ifNil: [aChange item getSource]) asMorph
}


]

{ #category : #building }
SBHistoryView >> buildEpoche [

Expand Down

0 comments on commit 9c4549d

Please sign in to comment.