remove file from in-memory cache on tab close

This commit is contained in:
Matt Parker
2025-10-22 19:36:49 +10:00
parent 14c31b8f5d
commit b529bd3f3f
2 changed files with 6 additions and 0 deletions

View File

@@ -70,6 +70,11 @@ public class IdeOpenTabsFileManager
await SaveFileAsync(file);
}
}
public void CloseFile(SharpIdeFile file)
{
_openFiles.TryRemove(file, out _);
}
}
#pragma warning restore VSTHRD011

View File

@@ -126,6 +126,7 @@ public partial class SharpIdeCodeEdit : CodeEdit
{
_currentFile?.FileContentsChangedExternally.Unsubscribe(OnFileChangedExternally);
GlobalEvents.Instance.SolutionAltered.Unsubscribe(OnSolutionAltered);
_openTabsFileManager.CloseFile(_currentFile!);
}
private void OnBreakpointToggled(long line)