Skip to content

Commit

Permalink
Merge pull request #726 from adri09070/dp-browser-refactorings
Browse files Browse the repository at this point in the history
Fix code highlighting in debug points browser, for debug points set on AST node
  • Loading branch information
jecisc authored Apr 15, 2024
2 parents c41bce7 + 1a4f66e commit b4cea87
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions src/NewTools-DebugPointsBrowser/DebugPointCodePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ Class {
#package : 'NewTools-DebugPointsBrowser'
}

{ #category : 'adding' }
DebugPointCodePresenter >> addHighlightForNode: aDebugPointNodeTarget [

self addTextSegmentDecoration:
(SpTextPresenterDecorator forHighlight
interval: (aDebugPointNodeTarget node start to: aDebugPointNodeTarget node stop + 1);
yourself)
]

{ #category : 'updating - presenters' }
DebugPointCodePresenter >> updateCode: aDebugPointNodeTarget [
"updates the code window with the code of the selected debug point"
aDebugPointNodeTarget ifNil:[self text: ''.^self].
self text: aDebugPointNodeTarget sourceCode;

aDebugPointNodeTarget ifNil: [
self text: ''.
^ self ].
self
text: aDebugPointNodeTarget sourceCode;
beForMethod: aDebugPointNodeTarget method;
addTextSegmentDecoration:
(SpTextPresenterDecorator forHighlight
interval: (aDebugPointNodeTarget node start to: ((aDebugPointNodeTarget node stop) +1));
yourself) .
addHighlightForNode: aDebugPointNodeTarget
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Extension { #name : 'DebugPointNodeTarget' }
{ #category : '*NewTools-DebugPointsBrowser' }
DebugPointNodeTarget >> updateDebugPointUIManager: aDebugPointUIManager [

aDebugPointUIManager updateCode: self.
aDebugPointUIManager switchToNodeTargetView
aDebugPointUIManager switchToNodeTargetView.
aDebugPointUIManager updateCode: self
]

0 comments on commit b4cea87

Please sign in to comment.