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

Fix code highlighting in debug points browser, for debug points set on AST node #726

Merged
merged 2 commits into from
Apr 15, 2024
Merged
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
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
]
Loading