Skip to content

Commit 974bf9b

Browse files
Fix #3705: Code window is empty when select a .baml and refresh
1 parent aad16c6 commit 974bf9b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

ILSpy/AssemblyTree/AssemblyTreeModel.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,12 +946,31 @@ public void Refresh()
946946
}
947947

948948
private void RefreshInternal()
949+
{
950+
_ = RefreshInternalAsync();
951+
}
952+
953+
private async Task RefreshInternalAsync()
949954
{
950955
using (Keyboard.FocusedElement.PreserveFocus())
951956
{
952957
var path = GetPathForNode(SelectedItem);
953958

954959
ShowAssemblyList(settingsService.AssemblyListManager.LoadList(AssemblyList.ListName));
960+
961+
// Ensure assembly loaded before FindNodeByPath to allow lazy-loaded resource nodes to be found
962+
if (path?.Length > 0)
963+
{
964+
foreach (var asm in AssemblyList.GetAssemblies())
965+
{
966+
if (asm.FileName == path[0])
967+
{
968+
await asm.GetMetadataFileAsync().Catch<Exception>(_ => { });
969+
break;
970+
}
971+
}
972+
}
973+
955974
SelectNode(FindNodeByPath(path, true), inNewTabPage: false);
956975

957976
RefreshDecompiledView();

0 commit comments

Comments
 (0)