From 3d16b65a7e3bd3a2d348a498faa404a92a7d3978 Mon Sep 17 00:00:00 2001 From: "adrien.vanegue.etu" Date: Wed, 20 Mar 2024 14:48:13 +0100 Subject: [PATCH] fixing highlight of code corresponding to node targets of debug points --- .../DebugPointCodePresenter.class.st | 22 ++++++++++++++----- .../DebugPointNodeTarget.extension.st | 4 ++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/NewTools-DebugPointsBrowser/DebugPointCodePresenter.class.st b/src/NewTools-DebugPointsBrowser/DebugPointCodePresenter.class.st index 6c8bab24..f7ea4f85 100644 --- a/src/NewTools-DebugPointsBrowser/DebugPointCodePresenter.class.st +++ b/src/NewTools-DebugPointsBrowser/DebugPointCodePresenter.class.st @@ -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 ] diff --git a/src/NewTools-DebugPointsBrowser/DebugPointNodeTarget.extension.st b/src/NewTools-DebugPointsBrowser/DebugPointNodeTarget.extension.st index 92cb2b67..e6fa7493 100644 --- a/src/NewTools-DebugPointsBrowser/DebugPointNodeTarget.extension.st +++ b/src/NewTools-DebugPointsBrowser/DebugPointNodeTarget.extension.st @@ -3,6 +3,6 @@ Extension { #name : 'DebugPointNodeTarget' } { #category : '*NewTools-DebugPointsBrowser' } DebugPointNodeTarget >> updateDebugPointUIManager: aDebugPointUIManager [ - aDebugPointUIManager updateCode: self. - aDebugPointUIManager switchToNodeTargetView + aDebugPointUIManager switchToNodeTargetView. + aDebugPointUIManager updateCode: self ]