Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastening debugger stack navigation #654

Open
wants to merge 3 commits into
base: Pharo13
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/NewTools-Debugger/StDebuggerContext.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ StDebuggerContext >> printOn: aStream [
{ #category : 'nodes' }
StDebuggerContext >> receiverNodes [

^ self context receiver allInspectorNodes reject: [ :node |
node label = 'self' ]
^ self context receiver inspectorNodes
]

{ #category : 'nodes' }
Expand Down
50 changes: 4 additions & 46 deletions src/NewTools-Debugger/StDebuggerInspector.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Class {
'inspector',
'model',
'label',
'rawInspectionSelectionCache',
'assertionFailure',
'lateralToolbar',
'currentLayoutSelector',
Expand Down Expand Up @@ -187,46 +186,6 @@ StDebuggerInspector >> model: aModel [
inspector model: model
]

{ #category : 'accessing' }
StDebuggerInspector >> rawInspectionSelectionCache [
^ rawInspectionSelectionCache ifNil: [
rawInspectionSelectionCache := Dictionary new ]
]

{ #category : 'private' }
StDebuggerInspector >> restoreRawInspectionSelectionForContext: aContext [
aContext ifNil: [ ^ self ].
self getRawInspectorPresenterOrNil
ifNotNil: [ :raw |
| receiverClass selector path |
receiverClass := aContext receiver class.
selector := aContext selector.
path := self rawInspectionSelectionCache
at: receiverClass -> selector
ifAbsent: [ #() ].
path ifEmpty: [ self rawInspectionSelectionCache at: receiverClass ifAbsent: [ #() ] ].
path ifEmpty: [ | roots pathStart |
roots := raw attributeTable roots.
pathStart := 1.
1 to: roots size do: [ :i |
(roots at: i) key = 'Temps' ifTrue: [ pathStart := i ] ].
path := {pathStart. 1} ].
raw selectPath: path ]
]

{ #category : 'private' }
StDebuggerInspector >> saveRawInspectionSelectionForContext: aContext [
| selectionPath |
aContext ifNil: [ ^ self ].
selectionPath := self getRawInspectorSelectedPath.
self rawInspectionSelectionCache
at: aContext receiver class -> aContext selector
put: selectionPath.
self rawInspectionSelectionCache
at: aContext receiver class
put: selectionPath
]

{ #category : 'layout' }
StDebuggerInspector >> setAssertionLayout [
currentLayoutSelector := self assertionLayoutSelector.
Expand Down Expand Up @@ -298,14 +257,13 @@ StDebuggerInspector >> updateLayoutForContexts: aContext isAssertionFailure: isT
StDebuggerInspector >> updateWith: inspectedObject [

| oldContext newContext |
oldContext := self model inspectedObject ifNotNil: [ :dbgCtx |
oldContext := self model inspectedObject ifNotNil: [ :dbgCtx |
dbgCtx context ].
newContext := inspectedObject ifNotNil: [ :dbgCtx | dbgCtx context ].
(self shouldUpdateContext: oldContext with: newContext) ifFalse: [ ^ self ].
(self shouldUpdateContext: oldContext with: newContext) ifFalse: [
^ self ].

shouldBeUpdated := false.
self saveRawInspectionSelectionForContext: oldContext.
self model: (self debuggerInspectorModelClass on: inspectedObject).
self updateEvaluationPaneReceiver.
self restoreRawInspectionSelectionForContext: newContext
self updateEvaluationPaneReceiver
]
Loading