From 512154b13679d44ff3a3d41c0050078be8c15eed Mon Sep 17 00:00:00 2001 From: Kenzie Schmoll Date: Fri, 1 Oct 2021 08:50:50 -0700 Subject: [PATCH 1/9] Revert "Fix issue where initial script was not always selected in File Explorer (#3400)" This reverts commit a440224c5b6bea40271dad5e6cad411ffe9e20d1. --- .../lib/src/debugger/debugger_controller.dart | 11 +++-------- .../lib/src/debugger/program_explorer_controller.dart | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/devtools_app/lib/src/debugger/debugger_controller.dart b/packages/devtools_app/lib/src/debugger/debugger_controller.dart index dabb293c281..3dd0f156496 100644 --- a/packages/devtools_app/lib/src/debugger/debugger_controller.dart +++ b/packages/devtools_app/lib/src/debugger/debugger_controller.dart @@ -41,14 +41,7 @@ class DebuggerController extends DisposableController _showScriptLocation(ScriptLocation(scriptsHistory.current.value)); }; scriptsHistory.current.addListener(_scriptHistoryListener); - addAutoDisposeListener(currentScriptRef, () async { - if (!programExplorerController.initialized.value) { - await programExplorerController.initialize(); - } - if (currentScriptRef.value != null) { - programExplorerController.selectScriptNode(currentScriptRef.value); - } - }); + programExplorerController.initialize(currentScriptRef.value); if (_service != null) { initialize(); @@ -200,6 +193,8 @@ class DebuggerController extends DisposableController // set to null to ensure that happens. _scriptLocation.value = null; _scriptLocation.value = scriptLocation; + + programExplorerController.selectScriptNode(scriptLocation.scriptRef); } Future