Skip to content

Commit

Permalink
Fix #66 reenabled breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Winger authored and Eric Winger committed Aug 18, 2018
1 parent 115f96e commit d6d82fc
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 13 deletions.
3 changes: 2 additions & 1 deletion sources/JadeiteMethodListPresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ textTabs
updateMethodSource
methodListPresenter selections isEmpty ifTrue: [^methodSourcePresenter value: String new].
methodListPresenter selections size = 1 ifTrue:[^self updateSingleMethodSource].
self updateMultiMethodComparison
self updateMultiMethodComparison.
self refreshBreakPointsIn: methodSourcePresenter
!

updateMultiMethodComparison
Expand Down
7 changes: 6 additions & 1 deletion sources/JadeiteMethodSourcePresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,18 @@ registerPresentersForUpdates
browser: self!

update
^self updateMethodSource!

updateMethodSource
methodService isNil ifTrue: [^self setDefaultMethod].
documentPresenter
value: methodService source;
isModified: false.
documentPresenter view
backcolor: JadeTextStyles default colorForNoEdits;
isEnabled: true;
yourself!
yourself.
self refreshBreakPointsIn: documentPresenter!

value: string

Expand All @@ -113,5 +117,6 @@ value: string
!JadeiteMethodSourcePresenter categoriesFor: #openMethodListOn:selecting:!menu handlers!private! !
!JadeiteMethodSourcePresenter categoriesFor: #registerPresentersForUpdates!public!register presenters! !
!JadeiteMethodSourcePresenter categoriesFor: #update!public!updating! !
!JadeiteMethodSourcePresenter categoriesFor: #updateMethodSource!public!updating! !
!JadeiteMethodSourcePresenter categoriesFor: #value:!public! !

4 changes: 2 additions & 2 deletions sources/JadeiteProjectsBrowserPresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,7 @@ updateMethodSource
ifTrue: [self updateMultiMethodComparison]
ifFalse:
[self showSuperClassComparison.
self updateSingleMethodSource].
!
self updateSingleMethodSource].!

updateMultiMethodComparison
comparisonPresenter
Expand Down Expand Up @@ -1384,6 +1383,7 @@ updateServices: services

updateSingleMethodSource
methodSourcePresenter value: methodListPresenter selection source.
self refreshBreakPointsIn: methodSourcePresenter.
methodSourcePresenter ensureVisible.
self displayNoMods: methodSourcePresenter. !

Expand Down
50 changes: 50 additions & 0 deletions sources/Rowan UI Base.pax
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ package methodNames
add: #JadeLoginShell -> #aboutJadeite;
add: #JadePresenterA -> #browseImplementorsOf:;
add: #JadePresenterA -> #browseSendersOf:;
add: #JadePresenterA -> #clearBreakPointAt:in:;
add: #JadePresenterA -> #compilationWarningFrom:;
add: #JadePresenterA -> #currentMethodSourceFrom:;
add: #JadePresenterA -> #displayNoMods:;
add: #JadePresenterA -> #editSaveMethod:in:category:;
add: #JadePresenterA -> #isOkayToChangeSource:;
add: #JadePresenterA -> #issueCommand:;
add: #JadePresenterA -> #methodListSelection;
add: #JadePresenterA -> #refreshBreakPointsIn:;
add: #JadePresenterA -> #reportCompileError:in:;
add: #JadePresenterA -> #setBreakPointAt:in:;
add: #JadePresenterA -> #update:afterStonReplication:;
add: #JadeProcessBrowser -> #debugProcess;
add: #JadeServer -> #_describeMethod:;
Expand Down Expand Up @@ -820,6 +824,15 @@ browseSendersOf: aGsMethodOrString
yourself.
!

clearBreakPointAt: stepPoint in: browser
| selection |
selection := self methodListSelection.
selection
command: #clearBreakAt:;
commandArgs: (Array with: stepPoint).
self issueCommand: (Array with: selection).
browser updateMethodSource. !

compilationWarningFrom: methodServices

methodServices do:[:methodService |
Expand Down Expand Up @@ -898,6 +911,30 @@ issueCommand: services
ensure: [services do: [:service | service clearCommand]].
^self update: services afterStonReplication: stonResultString.!

methodListSelection

self subclassResponsibility!

refreshBreakPointsIn: methodSourcePresenter
| indicators selection |
selection := self methodListSelection.
methodSourcePresenter view clearContainerIndicators.
indicators := OrderedCollection new.
1 to: selection stepPoints size
do:
[:stepPoint |
| range string styleName |
range := (selection stepPoints at: stepPoint) key.
styleName := (selection breakPoints includes: stepPoint) ifTrue: [9] ifFalse: [8].
string := ((selection breakPoints includes: stepPoint) ifTrue: ['Break at '] ifFalse: [''])
, 'step point #' , stepPoint printString.
indicators add: (ScintillaIndicator
styleName: styleName
range: range
tag: string)].
methodSourcePresenter view indicators: indicators.
methodSourcePresenter view update. !

reportCompileError: anArrayOfArray in: methodSourcePresenter

| source position stream string indicators |
Expand All @@ -924,17 +961,30 @@ reportCompileError: anArrayOfArray in: methodSourcePresenter
self statusBarText: (string copyFrom: 1 to: string size - 2).
!

setBreakPointAt: stepPoint in: browser
| selection |
selection := self methodListSelection.
selection
command: #setBreakAt:;
commandArgs: (Array with: stepPoint).
self issueCommand: (Array with: selection).
browser updateMethodSource. !

update: services afterStonReplication: stonResults
^BrowserUpdate current update: services afterStonReplication: stonResults! !
!JadePresenterA categoriesFor: #browseImplementorsOf:!public! !
!JadePresenterA categoriesFor: #browseSendersOf:!public! !
!JadePresenterA categoriesFor: #clearBreakPointAt:in:!Jadeite!public! !
!JadePresenterA categoriesFor: #compilationWarningFrom:!Jadeite!public! !
!JadePresenterA categoriesFor: #currentMethodSourceFrom:!Jadeite!public! !
!JadePresenterA categoriesFor: #displayNoMods:!displaying!public! !
!JadePresenterA categoriesFor: #editSaveMethod:in:category:!Jadeite!public! !
!JadePresenterA categoriesFor: #isOkayToChangeSource:!Jadeite!public! !
!JadePresenterA categoriesFor: #issueCommand:!Jadeite!public! !
!JadePresenterA categoriesFor: #methodListSelection!Jadeite!public! !
!JadePresenterA categoriesFor: #refreshBreakPointsIn:!Jadeite!public! !
!JadePresenterA categoriesFor: #reportCompileError:in:!Jadeite!public! !
!JadePresenterA categoriesFor: #setBreakPointAt:in:!Jadeite!public! !
!JadePresenterA categoriesFor: #update:afterStonReplication:!Jadeite!public! !

!JadeProcessBrowser methodsFor!
Expand Down
23 changes: 14 additions & 9 deletions sources/RowanMethodService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,28 @@ accessedInstVars
accessedInstVars: anObject
accessedInstVars := anObject!

addBreakPointMenuAt: stepPoint to: aMenu presenter: anObject
addBreakPointMenuAt: stepPoint to: aMenu presenter: presenter
| desc args menuCommand |
args := Array with: stepPoint with: presenter parentPresenter.
(self breakPoints includes: stepPoint)
ifTrue:
[args := Array with: stepPoint with: 'clear'.
[command := #clearBreakPointAt:in:.
desc := 'Clear break at step point ' , stepPoint printString]
ifFalse:
[args := Array with: stepPoint with: 'set'.
[command := #setBreakPointAt:in:.
desc := 'Break at step point ' , stepPoint printString].
menuCommand := MessageSend
receiver: self
selector: #breakAt:operation:
receiver: presenter parentPresenter
selector: command
arguments: args.
aMenu
addSeparator;
addCommand: menuCommand description: desc;
yourself.
aMenu addCommand: menuCommand description: desc.
^menuCommand!

appendToSourceMenu: aMenu presenter: methodSourcePresenter
| stepPoint menuCommand messageSelector |
stepPoint := self stepPointFromCursorIn: methodSourcePresenter.
stepPoint isNil ifTrue: [^self].
aMenu addSeparator.
menuCommand := self
addBreakPointMenuAt: stepPoint
to: aMenu
Expand Down Expand Up @@ -218,6 +217,11 @@ packageName
packageName: anObject
packageName := anObject!

prepareForReplication

stepPoints := Array new.
breakPoints := Array new. !

printOn: target
"Append, to the <puttableStream>, target, a string whose characters are a
the same as those which would result from sending a #printString
Expand Down Expand Up @@ -417,6 +421,7 @@ user: anObject
!RowanMethodService categoriesFor: #oopType!public! !
!RowanMethodService categoriesFor: #packageName!accessing!private! !
!RowanMethodService categoriesFor: #packageName:!accessing!private! !
!RowanMethodService categoriesFor: #prepareForReplication!public!replication! !
!RowanMethodService categoriesFor: #printOn:!printing!public! !
!RowanMethodService categoriesFor: #projectName!accessing!private! !
!RowanMethodService categoriesFor: #projectName:!accessing!private! !
Expand Down

0 comments on commit d6d82fc

Please sign in to comment.