Skip to content

Commit

Permalink
source pane uses context object
Browse files Browse the repository at this point in the history
I *think* that it is reasonable to ask the parentPresenter for it's context object when doing ad-hoc source code executions

Partial fix for #77
  • Loading branch information
Eric Winger authored and Eric Winger committed Aug 22, 2018
1 parent 35798f4 commit 4484a9b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
12 changes: 0 additions & 12 deletions sources/CodeSourcePresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,6 @@ environment: anInteger
environment := anInteger.
!

executeSelectionOrLine

[
^true -> (gciSession executeString: self currentSelectionOrLine fromContext: model environment: environment).
] on: GsCompileError do: [:ex |
^false -> ex list.
].
self error: 'How did we get here?'.
^false -> #(nil).
!

fileSave
"Private - Answer whether the save succeeded (false means to stay on the window and cancel any attempt to leave)"

Expand Down Expand Up @@ -474,7 +463,6 @@ updateCodeFont
!CodeSourcePresenter categoriesFor: #editReplace!edit!private! !
!CodeSourcePresenter categoriesFor: #editSelectAll!edit!private! !
!CodeSourcePresenter categoriesFor: #environment:!public! !
!CodeSourcePresenter categoriesFor: #executeSelectionOrLine!Jade!private! !
!CodeSourcePresenter categoriesFor: #fileSave!private! !
!CodeSourcePresenter categoriesFor: #findClassList!public! !
!CodeSourcePresenter categoriesFor: #handleInvalidSession!public! !
Expand Down
4 changes: 1 addition & 3 deletions sources/JadeDebugger.cls
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ codeSourcePresenterClass
!

contextObject

^gciSession oopTypeWithOop: frame vars first key key asNumber.
!
^gciSession oopTypeWithOop: frame vars first key key asNumber!

copyStack
| copyStream |
Expand Down
1 change: 0 additions & 1 deletion sources/JadeServer64bit3x.cls
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describeMethod: aMethod
^super describeMethod: aMethod!

executeString: aString fromContext: anObject environment: anInteger

[
^super executeString: aString fromContext: anObject environment: anInteger.
] on: CompileWarning do: [:ex |
Expand Down
4 changes: 4 additions & 0 deletions sources/JadeiteMethodListPresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ comparisonTab
[comparisonTab := self textTabs
detect: [:each | (each class canUnderstand: #text) ifTrue: [each text = 'Comparison'] ifFalse: [each = 'Comparison']]]!

contextObject
^nil!

createComponents
methodListPresenter := self add: JadeiteBasicMethodListPresenter new name: 'methodList'.
methodSourcePresenter := (self add: JadeiteMethodSourcePresenter new name: 'methodSource')
Expand Down Expand Up @@ -75,6 +78,7 @@ updateSource
methodSourcePresenter methodService: selection.
methodSourcePresenter update. ! !
!JadeiteMethodListPresenter categoriesFor: #comparisonTab!private!selection!text tabs! !
!JadeiteMethodListPresenter categoriesFor: #contextObject!public! !
!JadeiteMethodListPresenter categoriesFor: #createComponents!public! !
!JadeiteMethodListPresenter categoriesFor: #createSchematicWiring!public! !
!JadeiteMethodListPresenter categoriesFor: #getViews!public! !
Expand Down
15 changes: 14 additions & 1 deletion sources/Rowan UI Base.pax
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ package classNames

package methodNames
add: #CodeSourcePresenter -> #browseSelectedClass;
add: #CodeSourcePresenter -> #executeSelectionOrLine;
add: #Collection -> #prepareForReplication;
add: #GciSession -> #computeGemHost;
add: #GciSession -> #computeStoneHost;
Expand Down Expand Up @@ -572,8 +573,20 @@ browseSelectedClass
ifTrue:
[shell := RowanSystemBrowser showOnSession: gciSession.
shell selectClass: string selector: String new]
ifFalse: [parent addSystemBrowserForClass: assoc value]! !
ifFalse: [parent addSystemBrowserForClass: assoc value]!

executeSelectionOrLine

[
^true -> (gciSession executeString: self currentSelectionOrLine fromContext: self parentPresenter contextObject environment: environment).
] on: GsCompileError do: [:ex |
^false -> ex list.
].
self error: 'How did we get here?'.
^false -> #(nil).
! !
!CodeSourcePresenter categoriesFor: #browseSelectedClass!public! !
!CodeSourcePresenter categoriesFor: #executeSelectionOrLine!Jade!private! !

!Collection methodsFor!

Expand Down
6 changes: 0 additions & 6 deletions sources/RowanMethodSourcePresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ browseSelectedClass
shell selectClass:string selector: String new.
!

updateMethodBreakPoints

self rowanFixMe.
!

updateMethodStepPoints

self rowanFixMe.
! !
!RowanMethodSourcePresenter categoriesFor: #browseSelectedClass!public! !
!RowanMethodSourcePresenter categoriesFor: #updateMethodBreakPoints!public! !
!RowanMethodSourcePresenter categoriesFor: #updateMethodStepPoints!public! !

0 comments on commit 4484a9b

Please sign in to comment.