Skip to content

Commit

Permalink
Merge branch 'Pharo12' of github.com:pharo-spec/NewTools into dev-1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed May 22, 2023
2 parents 29fbd59 + 9e40ec3 commit 9b48135
Show file tree
Hide file tree
Showing 18 changed files with 170 additions and 55 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/newtools-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:

on:
push:
branches: [ Pharo11 ]
branches: [ Pharo12 ]
pull_request:
branches: [ Pharo11 ]
branches: [ Pharo12 ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -19,15 +19,15 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
smalltalk: [ Pharo64-11 ]
smalltalk: [ Pharo64-12 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load Image and Run Release Tests
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalk.release.ston
timeout-minutes: 10
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/newtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:

on:
push:
branches: [ Pharo11, dev-1.0 ]
branches: [ Pharo12, dev-1.0 ]
pull_request:
branches: [ Pharo11, dev-1.0 ]
branches: [ Pharo12, dev-1.0 ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -19,15 +19,15 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
smalltalk: [ Pharo64-11 ]
smalltalk: [ Pharo64-12 ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalk.ston
timeout-minutes: 15
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfNewTools/BaselineOfNewTools.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ BaselineOfNewTools >> sindarin: spec [
spec baseline: 'Sindarin' with: [
spec
repository: (self packageRepositoryURL
ifEmpty: [ 'github://pharo-spec/ScriptableDebugger:Pharo-11' ]);
ifEmpty: [ 'github://pharo-spec/ScriptableDebugger:Pharo12/src' ]);
loads: 'default' ]
]
23 changes: 16 additions & 7 deletions src/NewTools-ChangeSorter/ChangeSorterModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A ChangeSorterModel is a model used by Change Sorter UIs for computation
"
Class {
#name : #ChangeSorterModel,
#superclass : #AbstractTool,
#superclass : #Model,
#classVars : [
'ClassDescriptionsMap'
],
Expand Down Expand Up @@ -50,6 +50,17 @@ ChangeSorterModel >> allChanges [
^ ChangeSet allChangeSets reverse
]

{ #category : #method }
ChangeSorterModel >> browseVersionsFrom: aMethod [
"Create and schedule a Versions Browser, showing all versions of the
currently selected message. Answer the browser or nil."

aMethod selector
ifNil: [ self inform: 'Sorry, only actual methods have retrievable versions.'. ^nil ]
ifNotNil: [:selector |
Smalltalk tools versionBrowser browseVersionsForMethod: aMethod ]
]

{ #category : #text }
ChangeSorterModel >> buildChangeSetDescriptionFor: changeSet [

Expand Down Expand Up @@ -173,7 +184,7 @@ ChangeSorterModel >> forgetSelector: selector inClass: aClass fromChangeSet: aCh
ChangeSorterModel >> removeChangeSet: aChangeSet prompting: doPrompt [
"Completely destroy my change set. Check if it's OK first, and if doPrompt is true, get the user to confirm his intentions first."

| message aName changeSetNumber msg |
| message aName msg |
aName := aChangeSet name.
aChangeSet okayToRemove ifFalse: [^ self]. "forms current changes for some project"
(aChangeSet isEmpty or: [doPrompt not]) ifFalse:
Expand Down Expand Up @@ -204,8 +215,6 @@ lost if you destroy the change set.
Do you really want to go ahead with this?') ifFalse: [^ self]]].

"Go ahead and remove the change set"
changeSetNumber := aChangeSet name initialIntegerOrNil.
changeSetNumber ifNotNil: [SystemVersion current unregisterUpdate: changeSetNumber].
ChangeSet removeChangeSet: aChangeSet.
]

Expand Down Expand Up @@ -254,13 +263,13 @@ ChangeSorterModel >> setContentsOfChangeSet: changeSet forClass: class andSelect
ifNil: [
"Only the change set is currently selected"
^ self buildChangeSetDescriptionFor: changeSet ].
selector
^ selector
ifNil: [
"class is selected but not the selector"
^ self buildClassDescriptionFor: changeSet class: class ]
self buildClassDescriptionFor: changeSet class: class ]
ifNotNil: [
"a class and a selector are selected"
^ self buildSelectorDescriptionFor: changeSet class: class selector: selector ]
self buildSelectorDescriptionFor: changeSet class: class selector: selector ]
]

{ #category : #'change set' }
Expand Down
9 changes: 4 additions & 5 deletions src/NewTools-ChangeSorter/SpChangeSorterPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ SpChangeSorterPresenter >> browseChangeSet [

{ #category : #'menu - message' }
SpChangeSorterPresenter >> browseImplementorsOfMessages [

self model browseMessagesFrom: self selectedSelector
SystemNavigation new browseAllImplementorsOf: self selectedSelector
]

{ #category : #'menu - message' }
Expand All @@ -80,7 +79,7 @@ SpChangeSorterPresenter >> browseMethodFull [
{ #category : #'menu - message' }
SpChangeSorterPresenter >> browseSendersOfMessages [

self model browseSendersOfMessagesFrom: self selectedSelector
self systemNavigation browseAllSendersOf: self selectedSelector
]

{ #category : #'menu - message' }
Expand Down Expand Up @@ -616,7 +615,7 @@ SpChangeSorterPresenter >> remove [
SpChangeSorterPresenter >> removeClass [
"Remove the selected class from the system, at interactive user request. Make certain the user really wants to do this, since it is not reversible. Answer true if removal actually happened."

(self model removeClass: self selectedClass)
(SystemNavigation new removeClass: self selectedClass)
ifTrue: [ self setSelectedChangeSet: self selectedChangeSet ]
]

Expand All @@ -631,7 +630,7 @@ SpChangeSorterPresenter >> removeMessage [
class := self selectedClass.
(class includesSelector: selector) ifFalse:[^ self].
method := class>>selector.
(self model removeMethod: method inClass: class)
(SystemNavigation new removeMethod: method inClass: class)
ifTrue: [ self updateMessagesList ]]
]

Expand Down
10 changes: 5 additions & 5 deletions src/NewTools-Debugger-Tests/StDebuggerCommandTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ StDebuggerCommandTest >> testCommandsInMissingClassContext [
self assert: (StReturnValueCommand forContext: debugger) canBeExecuted.

"Non-executable commands relative to context"
self deny: (StStepIntoCommand forContext: debugger) canBeExecuted.
self deny: (StStepOverCommand forContext: debugger) canBeExecuted.
self deny: (StStepThroughCommand forContext: debugger) canBeExecuted.
self deny: (StRunToSelectionCommand forContext: debugger) canBeExecuted.
self deny: (StProceedCommand forContext: debugger) canBeExecuted.
self assert: (StStepIntoCommand forContext: debugger) canBeExecuted.
self assert: (StStepOverCommand forContext: debugger) canBeExecuted.
self assert: (StStepThroughCommand forContext: debugger) canBeExecuted.
self assert: (StRunToSelectionCommand forContext: debugger) canBeExecuted.
self assert: (StProceedCommand forContext: debugger) canBeExecuted.
self deny: (StDefineSubclassResponsabilityCommand forContext: debugger) canBeExecuted.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,36 @@ StDebuggerContextInteractionModelTest >> testBindingOfPrioritizesContextBindings
equals: 42.
]

{ #category : #tests }
StDebuggerContextInteractionModelTest >> testCompile [

| result |
model context
step;
step;
step;
step. "Perform the two first assigments of the method `helperMethodForBindings`"

result := model compiler evaluate: 'instanceVariableForTest'.
self assert: result equals: 42.
instanceVariableForTest := 52.
result := model compiler evaluate: 'instanceVariableForTest'.
self assert: result equals: 52.

result := model compiler evaluate: 'instanceVariableForTest := 62'.
self assert: result equals: 62.
result := model compiler evaluate: 'instanceVariableForTest'.
self assert: result equals: 62.
self assert: instanceVariableForTest equals: 62.

result := model compiler evaluate: 'tempVariableForTest'.
self assert: result equals: 43.
result := model compiler evaluate: 'tempVariableForTest := 53'.
self assert: result equals: 53.
result := model compiler evaluate: 'tempVariableForTest'.
self assert: result equals: 53
]

{ #category : #tests }
StDebuggerContextInteractionModelTest >> testHasBindingsInContextOf [

Expand Down
4 changes: 2 additions & 2 deletions src/NewTools-Debugger-Tests/StTestDebuggerProvider.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Class {
{ #category : #helpers }
StTestDebuggerProvider class >> compileMissingClassContextBuilder [

self compile: 'buildDebuggerWithMissingClassContext
self compiler permitUndeclared: true; install: 'buildDebuggerWithMissingClassContext
[ MissingClass new ]
[ ^ MissingClass ]
on: Error
do: [ :err |
self sessionFor: err signalerContext copy exception: err.
Expand Down
21 changes: 19 additions & 2 deletions src/NewTools-Debugger/StDebugger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ StDebugger >> createMissingClass [
[
| newClassBinding |
self flag: 'This method is actually hard to test because it requires user input to complete. How to test that automatically?'.
newClassBinding := OCUndeclaredVariableWarning new
newClassBinding := OCCodeReparator new
node: variableNode;
defineClass: variableNode name ]
on: Abort
Expand Down Expand Up @@ -919,6 +919,23 @@ StDebugger >> proceedDebugSession [
self close
]

{ #category : #private }
StDebugger >> protocolSuggestionsFor: aClass [

| classProtocols reject allExistingProtocols interestingProtocols |
classProtocols := aClass organization protocolNames.
reject := Set with: Protocol unclassified.
allExistingProtocols := (SystemNavigation default
allExistingProtocolsFor: aClass isMeta not)
reject: [ :p | classProtocols includes: p ].
interestingProtocols := classProtocols
,
(allExistingProtocols asOrderedCollection
sort: [ :a :b |
a asLowercase < b asLowercase ]).
^ interestingProtocols reject: [ :e | reject includes: e ]
]

{ #category : #actions }
StDebugger >> recompileMethodTo: aString inContext: aContext notifying: aNotifyer [

Expand Down Expand Up @@ -995,7 +1012,7 @@ StDebugger >> requestProtocolIn: aClass [

| entryCompletion applicants choice |
self class fastTDD ifTrue: [ ^ Protocol unclassified ].
applicants := AbstractTool protocolSuggestionsFor: aClass.
applicants := self protocolSuggestionsFor: aClass.
entryCompletion := EntryCompletion new
dataSourceBlock: [ :currText | applicants ];
filterBlock: [ :currApplicant :currText |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ StDebuggerContextInteractionModel >> doItReceiver [

{ #category : #testing }
StDebuggerContextInteractionModel >> hasBindingInContextOf: aString [
"we lookup the name without creating a new variable"
^ (context lookupVar: aString declare: false) notNil
^ (context lookupVar: aString) notNil
]

{ #category : #testing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ StDebuggerErrorContextPredicate >> isContextDoesNotUnderstand [
{ #category : #predicates }
StDebuggerErrorContextPredicate >> isContextMissingClassException [

^ exception class == VariableNotDeclared
^ #(#VariableNotDeclared #UndeclaredVariableRead #UndeclaredVariableWrite) includes: exception class name
]

{ #category : #predicates }
Expand Down
2 changes: 2 additions & 0 deletions src/NewTools-Inspector-Extensions/Bag.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Bag >> inspectionItems: aBuilder [
title: 'Items';
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each key ];
beNotExpandable;
beSortable;
yourself);
addColumn: (SpStringTableColumn new
title: 'Occurences';
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: (self occurrencesOf: each key) ];
beSortable;
yourself);
items: contents associations;
yourself
Expand Down
2 changes: 1 addition & 1 deletion src/NewTools-Inspector-Extensions/Collection.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Collection >> inspectionItems: aBuilder [
addColumn: (SpStringTableColumn new
title: 'Value';
evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each ];
sortFunction: #printString ascending;
beSortable;
yourself);
items: self asOrderedCollection;
yourself
Expand Down
31 changes: 31 additions & 0 deletions src/NewTools-Inspector-Extensions/RPackage.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Extension { #name : #RPackage }

{ #category : #'*NewTools-Inspector-Extensions' }
RPackage >> baselineInspector [

<inspectorPresentationOrder: 2 title: 'Belongs to Baselines'>
| items |
items := BaselineOf allSubclasses select: [ :e | e allPackageNames includes: self name ].
^ SpListPresenter new
items: items;
yourself
]

{ #category : #'*NewTools-Inspector-Extensions' }
RPackage >> overwiew [

<inspectorPresentationOrder: 1 title: 'Overwiew'>
| items |
items :={ 'Classes' -> self classes . 'Defined classes' -> self definedClasses . 'Methods' -> self methods }.
items := items collect: [ :e | StInspectorAssociationNode hostObject: e ].
^ SpTablePresenter new
alternateRowsColor;
items: items;
addColumn: (SpStringTableColumn
title: 'Title'
evaluated: [ :e | e key ] );
addColumn: (SpStringTableColumn
title: 'Value'
evaluated: [ :e | e value size ] );
yourself
]
38 changes: 38 additions & 0 deletions src/NewTools-Inspector/StInspectorTransmissionNode.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"
I am an inspector node that allows the user to specify a custom transmission. I am made to be used inside the Inspector. The user can specify the `transmissionBlock:`
"
Class {
#name : #StInspectorTransmissionNode,
#superclass : #StInspectorNode,
#instVars : [
'transmissionBlock'
],
#category : #'NewTools-Inspector-Model'
}

{ #category : #'instance initialization' }
StInspectorTransmissionNode class >> hostObject: anObject transmissionBlock: aFullBlockClosure [

^ self new
hostObject: anObject;
transmissionBlock: aFullBlockClosure;
yourself
]

{ #category : #accessing }
StInspectorTransmissionNode >> key [

^ self hostObject
]

{ #category : #accessing }
StInspectorTransmissionNode >> rawValue [

^ transmissionBlock value: hostObject
]

{ #category : #accessing }
StInspectorTransmissionNode >> transmissionBlock: aBlock [

transmissionBlock := aBlock
]
Loading

0 comments on commit 9b48135

Please sign in to comment.