Skip to content

Commit

Permalink
Fix copying for sbvisualization and generate unique-enough example names
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeAtHPI committed Feb 12, 2025
1 parent 0fdab2e commit ec1e651
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
8 changes: 7 additions & 1 deletion packages/Sandblocks-Babylonian/SBExample.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SBExample class >> instanceSuggestion [
self new
self: SBStGrammarHandler new newNullBlock
args: (SBStArray new type: #dynamic)
label: 'example']
label: self nameSuggestion]
]

{ #category : #'as yet unclassified' }
Expand All @@ -47,6 +47,12 @@ SBExample class >> matchingSelectors [
^ #(#self:args:label: #self:args:label:assert: #example:args:label: #example:args:label:assert:)
]

{ #category : #'as yet unclassified' }
SBExample class >> nameSuggestion [

^ 'example {1}' format: {Random generateInteger}
]

{ #category : #'as yet unclassified' }
SBExample class >> newFor: aMessage [

Expand Down
19 changes: 19 additions & 0 deletions packages/Sandblocks-Babylonian/SBLineChart.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Extension { #name : #SBLineChart }

{ #category : #'*Sandblocks-Babylonian' }
SBLineChart >> layoutedTaggedCopy [

^ self class new
traceValues: self traceValues;
targetHeight: self targetHeight;
scaleY: self scaleY;
extent: self extent;
color: self color;
layoutProperties: self layoutProperties;
layoutPolicy: self layoutPolicy;
borderStyle: self borderStyle;
tag: self tag;
yourself


]
20 changes: 20 additions & 0 deletions packages/Sandblocks-Babylonian/SBRectangleChart.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Extension { #name : #SBRectangleChart }

{ #category : #'*Sandblocks-Babylonian' }
SBRectangleChart >> layoutedTaggedCopy [

^ self class new
traceValues: self traceValues;
targetHeight: self targetHeight;
scaleY: self scaleY;
scaleX: self scaleX;
extent: self extent;
color: self color;
layoutProperties: self layoutProperties;
layoutPolicy: self layoutPolicy;
borderStyle: self borderStyle;
tag: self tag;
yourself


]
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SBStGrammarHandler >> createExampleIn: aMethod classed: aClass [
type: #dynamic
contents: (aMethod arguments collect: [:anArgument |
self extractBlockFromArgumentName: anArgument contents]))
label: 'example'.
label: SBExample nameSuggestion
]

{ #category : #'*Sandblocks-Babylonian' }
Expand Down
2 changes: 1 addition & 1 deletion packages/Sandblocks-Smalltalk/SBStMessageSend.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SBStMessageSend >> asExample [
args: (SBStArray new
type: #dynamic
contents: self arguments veryDeepCopy)
label: 'example'
label: SBExample nameSuggestion
]

{ #category : #converting }
Expand Down

0 comments on commit ec1e651

Please sign in to comment.