From 581dfd340cc849ffd5ab8ada03510260f053cbfa Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Sun, 31 Dec 2023 01:25:55 +0100 Subject: [PATCH] tdb: fix robust context selection for multiple contexts with same name --- .../instance/selectContextSlice..st | 2 ++ .../TDBHistoryExplorer.class/methodProperties.json | 2 +- .../TraceDebugger.class/instance/selectAndExpandContext..st | 6 ++++-- .../TraceDebugger.class/instance/selectContext..st | 1 + .../TraceDebugger.class/methodProperties.json | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/TraceDebugger.package/TDBHistoryExplorer.class/instance/selectContextSlice..st b/packages/TraceDebugger.package/TDBHistoryExplorer.class/instance/selectContextSlice..st index 501e09ff..23557544 100644 --- a/packages/TraceDebugger.package/TDBHistoryExplorer.class/instance/selectContextSlice..st +++ b/packages/TraceDebugger.package/TDBHistoryExplorer.class/instance/selectContextSlice..st @@ -10,6 +10,8 @@ selectContextSlice: aContextSlice and: [(expanded includes: aContextSlice parent) not]) ifTrue: [expanded addAll: aContextSlice withAllParents. + + self flag: #brittle. "if there are multiple slices with the same name..." self changed: #(openPath) , (aContextSlice withAllParents diff --git a/packages/TraceDebugger.package/TDBHistoryExplorer.class/methodProperties.json b/packages/TraceDebugger.package/TDBHistoryExplorer.class/methodProperties.json index 61ec5b67..a8e52482 100644 --- a/packages/TraceDebugger.package/TDBHistoryExplorer.class/methodProperties.json +++ b/packages/TraceDebugger.package/TDBHistoryExplorer.class/methodProperties.json @@ -153,7 +153,7 @@ "resultForContextSlice:ifLeaf:ifParent:" : "ct 7/22/2022 14:20", "resultLabelFor:" : "ct 7/21/2022 21:39", "rootContextSlices" : "ct 6/19/2022 16:03", - "selectContextSlice:" : "ct 12/28/2022 23:06", + "selectContextSlice:" : "ct 12/31/2023 01:24", "selectedClassOrMetaClass" : "ct 7/3/2022 22:07", "selectedContextSlice" : "ct 6/19/2022 16:04", "sendFeedback" : "ct 7/31/2022 19:55", diff --git a/packages/TraceDebugger.package/TraceDebugger.class/instance/selectAndExpandContext..st b/packages/TraceDebugger.package/TraceDebugger.class/instance/selectAndExpandContext..st index 5ca36773..14fa1928 100644 --- a/packages/TraceDebugger.package/TraceDebugger.class/instance/selectAndExpandContext..st +++ b/packages/TraceDebugger.package/TraceDebugger.class/instance/selectAndExpandContext..st @@ -3,8 +3,10 @@ selectAndExpandContext: aContext self cacheSourcesDuring: [self selectContext: aContext. + + self flag: #brittle. "if there are multiple slices with the same name..." self changed: #(openPath) , (self treeSelectedContextPath collect: [:context | context asString]). + self flag: #coroutines. (self selectedContext tdbIdentical: aContext) ifFalse: - [selectedContext := aContext. - self changed: #cursorPosition]]. \ No newline at end of file + [self selectContext: aContext]]. \ No newline at end of file diff --git a/packages/TraceDebugger.package/TraceDebugger.class/instance/selectContext..st b/packages/TraceDebugger.package/TraceDebugger.class/instance/selectContext..st index f3c3c2bc..ceaa11bb 100644 --- a/packages/TraceDebugger.package/TraceDebugger.class/instance/selectContext..st +++ b/packages/TraceDebugger.package/TraceDebugger.class/instance/selectContext..st @@ -4,6 +4,7 @@ selectContext: aContext self cacheSourcesDuring: [self basicSelectContext: aContext. self changed: #treeSelectedContextPath. + self flag: #coroutines. (self selectedContext tdbIdentical: aContext) ifFalse: [selectedContext := aContext. diff --git a/packages/TraceDebugger.package/TraceDebugger.class/methodProperties.json b/packages/TraceDebugger.package/TraceDebugger.class/methodProperties.json index 74d4f074..78f97054 100644 --- a/packages/TraceDebugger.package/TraceDebugger.class/methodProperties.json +++ b/packages/TraceDebugger.package/TraceDebugger.class/methodProperties.json @@ -214,8 +214,8 @@ "restart" : "ct 1/8/2022 01:26", "rootContexts" : "ct 1/25/2022 20:02", "runToSelection:" : "ct 2/17/2022 19:10", - "selectAndExpandContext:" : "ct 12/30/2023 23:17", - "selectContext:" : "ct 12/30/2023 23:17", + "selectAndExpandContext:" : "ct 12/31/2023 01:24", + "selectContext:" : "ct 12/31/2023 01:25", "selectedContext" : "ct 11/20/2021 22:20", "selectedContextPath" : "ct 1/26/2022 17:06", "selectedMessage" : "ct 2/12/2022 22:34",