code editor tab on file delete

This commit is contained in:
Matt Parker
2025-10-24 18:55:36 +10:00
parent c6f7e0b9ac
commit 1f2d770c5a
3 changed files with 13 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ public class FileChangedService(RoslynAnalysis roslynAnalysis, IdeOpenTabsFileMa
public async Task SharpIdeFileRemoved(SharpIdeFile file)
{
await file.FileDeleted.InvokeParallelAsync();
if (file.IsRoslynWorkspaceFile)
{
await HandleWorkspaceFileRemoved(file);

View File

@@ -21,6 +21,7 @@ public class SharpIdeFile : ISharpIdeNode, IChildSharpIdeNode, IFileOrFolder
public required bool SuppressDiskChangeEvents { get; set; } // probably has concurrency issues
public required DateTimeOffset? LastIdeWriteTime { get; set; }
public EventWrapper<SharpIdeFileLinePosition?, Task> FileContentsChangedExternally { get; } = new((_) => Task.CompletedTask);
public EventWrapper<Task> FileDeleted { get; } = new(() => Task.CompletedTask);
[SetsRequiredMembers]
internal SharpIdeFile(string fullPath, string name, IExpandableSharpIdeNode parent, ConcurrentBag<SharpIdeFile> allFiles)