Skip to content
1 change: 1 addition & 0 deletions packages/BaselineOfSandblocks/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ 'b5e6e6c90e584843b0257d63ce669051' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Babylonian/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ 'b1299e7a859709468ad0cace126ecac3' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Compiler/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ '5ea14b5119035a4eaa852404b6d9fd51' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Core/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ '988aae6a6ced6147abdaae9f02172cc3' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
9 changes: 0 additions & 9 deletions packages/Sandblocks-Core/Behavior.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,3 @@ Behavior >> openFull: converter [

converter do: [SBStClassMethodEditor new class: self]
]

{ #category : #'*Sandblocks-Core-suggestions' }
Behavior >> sandblocksSuggestionsFor: aBlock [
"May be overriden by subclasses."

^ Array streamContents: [:stream |
self withAllSuperclassesDo: [:class |
stream nextPutAll: class selectors sorted]]
]
112 changes: 51 additions & 61 deletions packages/Sandblocks-Core/SBBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ SBBlock >> addBlock: aBlock [
(self insertCommandRequest: aBlock near: nil before: false) do
]

{ #category : #'as yet unclassified' }
{ #category : #hierarchy }
SBBlock >> allBlocksDetect: aBlock [

self allBlocksDetect: aBlock ifFound: [:b | b] ifNone: [self error: 'no such block']
Expand Down Expand Up @@ -116,7 +116,7 @@ SBBlock >> allBlocksFor: anObject withInterfaces: aCollection [
(morph isSandblock and: [morph object = anObject and: [morph satisfies: aCollection]]) ifTrue: [stream nextPut: morph]]]
]

{ #category : #'as yet unclassified' }
{ #category : #hierarchy }
SBBlock >> allBlocksSatisfy: aBlock [

self allBlocksDo: [:b | (aBlock value: b) ifFalse: [^ false]].
Expand All @@ -129,7 +129,7 @@ SBBlock >> allBlocksSelect: aBlock [
^ Array streamContents: [:stream | self allBlocksDo: [:b | (aBlock value: b) ifTrue: [stream nextPut: b]]]
]

{ #category : #'as yet unclassified' }
{ #category : #hierarchy }
SBBlock >> allChildBlocksSatisfy: aBlock [

self allBlocksDo: [:b | (b ~= self and: [(aBlock value: b) not]) ifTrue: [^ false]].
Expand All @@ -143,7 +143,7 @@ SBBlock >> andAllParentSandblocksDo: aBlock [
self parentSandblock ifNotNil: [:p | p andAllParentSandblocksDo: aBlock]
]

{ #category : #'as yet unclassified' }
{ #category : #actions }
SBBlock >> appendElement [
<action>

Expand All @@ -168,15 +168,6 @@ SBBlock >> artefactChanged: aMethodBlock [

]

{ #category : #suggestions }
SBBlock >> artefactCompletionSelectorsFor: aBlock class: aClass [
"May be overridden by subclasses."

aClass ifNil: [^ Symbol allSymbols].

^ aClass sandblocksSuggestionsFor: self
]

{ #category : #accessing }
SBBlock >> artefactForPersisting [

Expand Down Expand Up @@ -233,15 +224,15 @@ SBBlock >> attachToHand: aHand in: anEditor [
aHand grabMorph: s
]

{ #category : #'as yet unclassified' }
{ #category : #layout }
SBBlock >> attractionStrengthTo: aMorph [

^ (self isAttractedTo: aMorph)
ifTrue: [self class implicitAttractionStrength]
ifFalse: [0.0]
]

{ #category : #'as yet unclassified' }
{ #category : #layout }
SBBlock >> attractionTo: aMorph [

^ (self attractionStrengthTo: aMorph) + (aMorph attractionStrengthTo: self)
Expand Down Expand Up @@ -495,7 +486,10 @@ SBBlock >> click: anEvent [

self sandblockEditor selectClick: self at: anEvent position.
(anEvent yellowButtonPressed and: [SBPreferences rightClickContextMenu]) ifTrue: [self promptAction].
(self isInWorld and: [self suggestAlways and: [anEvent redButtonPressed]]) ifTrue: [self queueUpdateSuggestionsFocused: false]
(self isInWorld and: [self suggestAlways and: [anEvent redButtonPressed]]) ifTrue: [
self hasSuggestions
ifFalse: [self queueUpdateSuggestionsFocused: false]
ifTrue: [self removeSuggestionMenu]]
]

{ #category : #hierarchy }
Expand Down Expand Up @@ -541,6 +535,38 @@ SBBlock >> completeSubtree [
^ true
]

{ #category : #suggestions }
SBBlock >> completionKeysFrom: objects matching: matchString stringBlock: stringBlock [

| input exactMatches fuzzyMatches |
input := OrderedCollection withAll: objects.

exactMatches := (Array streamContents: [:stream |
input removeAllSuchThat: [:ea |
((stringBlock value: ea) sandblockBeginsWith: matchString)
ifTrue: [stream nextPut: ea];
yourself]]) sort: [:ea | (stringBlock value: ea) size] ascending.
fuzzyMatches := (Array streamContents: [:stream |
input removeAllSuchThat: [:ea |
((stringBlock value: ea) sandblockMatch: matchString)
ifTrue: [stream nextPut: ea];
yourself]]) sort: [:ea | (stringBlock value: ea) size] ascending.

^ (Array
streamContents: [:stream |
stream
nextPutAll: exactMatches;
nextPutAll: fuzzyMatches.
self suggestAlways ifTrue: [stream nextPutAll: input]]
limitedTo: self maxSuggestions) withoutDuplicates
]

{ #category : #suggestions }
SBBlock >> completionSelectorsFrom: selectors matching: matchString [

^ self completionKeysFrom: selectors matching: matchString stringBlock: [:sel | sel]
]

{ #category : #accessing }
SBBlock >> containingArtefact [

Expand Down Expand Up @@ -1154,7 +1180,7 @@ SBBlock >> grammarHandler [
^ nil
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
SBBlock >> group [

^ self withDecorator: SBForceMoveDecorator do: [:decorator | decorator group] ifAbsent: [nil]
Expand Down Expand Up @@ -1191,7 +1217,7 @@ SBBlock >> hasDecorator: aClass [
^ decorators anySatisfy: [:d | d isKindOf: aClass]
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
SBBlock >> hasGroup [

^ self group notNil
Expand Down Expand Up @@ -1309,7 +1335,7 @@ SBBlock >> insertElementBefore [
^ self insertElement: true
]

{ #category : #'as yet unclassified' }
{ #category : #'action helpers' }
SBBlock >> insertEmptyCommandRequestNear: aBlock before: aBoolean [

| child |
Expand Down Expand Up @@ -1430,7 +1456,7 @@ SBBlock >> isDeclaration [
^ false
]

{ #category : #'as yet unclassified' }
{ #category : #testing }
SBBlock >> isDragging [

^ self withDecorator: SBMoveDecorator do: [:decorator | decorator isDragging] ifAbsent: [false]
Expand Down Expand Up @@ -1575,7 +1601,7 @@ SBBlock >> isValidAction: aPragmaOrMethod [
^ validMode and: [validInvocation]
]

{ #category : #'as yet unclassified' }
{ #category : #testing }
SBBlock >> isWaypoint [

^ false
Expand Down Expand Up @@ -1903,15 +1929,15 @@ SBBlock >> outOfWorld: aWorld [
self triggerEvent: #outOfWorld
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
SBBlock >> outerArtefact [

| a |
a := self containingArtefact.
^ a = self ifTrue: [self parentSandblock ifNotNil: #containingArtefact] ifFalse: [a]
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
SBBlock >> outerMostArtefact [

| a |
Expand Down Expand Up @@ -2129,7 +2155,7 @@ SBBlock >> previousVerticalNear: aNumber [
validBlock: [:candidate | self top >= candidate bottom]
]

{ #category : #'as yet unclassified' }
{ #category : #printing }
SBBlock >> printIdentityStringOn: aStream [

aStream
Expand Down Expand Up @@ -2373,7 +2399,7 @@ SBBlock >> selectLast [
startInputAtEnd
]

{ #category : #'as yet unclassified' }
{ #category : #'action helpers' }
SBBlock >> selectLastInsertPosition [

| last |
Expand Down Expand Up @@ -2438,12 +2464,6 @@ SBBlock >> selectionLabel [
^ self printString
]

{ #category : #'actions tests' }
SBBlock >> shouldAutocomplete [

^ self hasSuggestions and: [self sandblockEditor suggestionMenu activeSuggestion wouldChange: self]
]

{ #category : #suggestions }
SBBlock >> shouldSuggest [

Expand Down Expand Up @@ -2485,36 +2505,6 @@ SBBlock >> slurpFront [
self select]
]

{ #category : #suggestions }
SBBlock >> sortedSuggestions: aCollection for: aString [

| exactMatches fuzzyMatches list |
"sort list of provided suggestion strings by putting exact matches first and clamps to maxSuggestions.

NOTE: may mutate aCollection"
list := (aCollection isKindOf: OrderedCollection)
ifTrue: [aCollection]
ifFalse: [OrderedCollection withAll: aCollection].

exactMatches := (Array streamContents: [:stream |
list removeAllSuchThat: [:sel |
(sel sandblockBeginsWith: aString)
ifTrue: [stream nextPut: sel];
yourself]]) sort: #size ascending.
fuzzyMatches := (Array streamContents: [:stream |
list removeAllSuchThat: [:sel |
(sel sandblockMatch: aString)
ifTrue: [stream nextPut: sel];
yourself]]) sort: #size ascending.

^ (Array
streamContents: [:stream |
stream nextPutAll: exactMatches.
stream nextPutAll: fuzzyMatches.
self suggestAlways ifTrue: [stream nextPutAll: list]]
limitedTo: self maxSuggestions) withoutDuplicates
]

{ #category : #'ast helpers' }
SBBlock >> sourceString [

Expand Down
6 changes: 6 additions & 0 deletions packages/Sandblocks-Core/SBColorPolicy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ SBColorPolicy >> symbolsForCharacter: aBlock [
^ #('$' nil)
]

{ #category : #'as yet unclassified' }
SBColorPolicy >> symbolsForClassVariableDeclaration: aBlock [

^ #(nil nil)
]

{ #category : #'as yet unclassified' }
SBColorPolicy >> symbolsForComment: aBlock [

Expand Down
2 changes: 1 addition & 1 deletion packages/Sandblocks-Core/SBForceMoveDecorator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ SBForceMoveDecorator >> attractionTo: otherMorph [
^ self morph attractionTo: otherMorph
]

{ #category : #'as yet unclassified' }
{ #category : #nil }
SBForceMoveDecorator >> block: aBlock [
"ignore this for performAction in block"

Expand Down
6 changes: 6 additions & 0 deletions packages/Sandblocks-Core/SBSuggestionMenu.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ SBSuggestionMenu >> resize [
ifTrue: [0 @ ((container height + ((focusHint notNil and: [focusHint visible]) ifTrue: [focusHint height] ifFalse: [0]) min: 330) + 2)])
]

{ #category : #accessing }
SBSuggestionMenu >> sandblockEditor [

^ editor
]

{ #category : #'stepping and presenter' }
SBSuggestionMenu >> step [

Expand Down
2 changes: 2 additions & 0 deletions packages/Sandblocks-CustomJavascript/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#ignoredInstanceVariables : { },
#id : UUID [ '9f952c6987fc79499b49d51a8d99f188' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Debugger/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ 'e9c8b9b42c1b3b43acdbfb62f45bcd84' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Drawing/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ 'f03ce260d1607049b8434764c1887ebf' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Explorer/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ '2f1123ad55a39544aea7084960f0ae27' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
2 changes: 2 additions & 0 deletions packages/Sandblocks-Git/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#ignoredInstanceVariables : { },
#id : UUID [ '4541191bab3834448868354f2021b740' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Graph/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ '04bb16c281ff084da04df40607132621' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Layout/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ 'ff896f384886fb4c85c176d089bb6e5b' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
1 change: 1 addition & 0 deletions packages/Sandblocks-Morphs/.squot-contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SquotTrackedObjectMetadata {
#objectClassName : #PackageInfo,
#id : UUID [ '8b70df084c8d8d4982cfda5136641bd7' ],
#objectsReplacedByNames : true,
#serializer : #SquotTonelSerializer
}
Loading