From e226162c27d0150a86a701f1c9504a087d57dc15 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Fri, 24 Oct 2025 21:49:56 +1000 Subject: [PATCH] another --- .../Features/FilePersistence/IdeOpenTabsFileManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs b/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs index 8a47d23..c3ecd04 100644 --- a/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs +++ b/src/SharpIDE.Application/Features/FilePersistence/IdeOpenTabsFileManager.cs @@ -1,12 +1,15 @@ using System.Collections.Concurrent; +using Microsoft.Extensions.Logging; using SharpIDE.Application.Features.SolutionDiscovery; namespace SharpIDE.Application.Features.FilePersistence; #pragma warning disable VSTHRD011 /// Holds the in memory copies of files, and manages saving/loading them to/from disk. -public class IdeOpenTabsFileManager +public class IdeOpenTabsFileManager(ILogger logger) { + private readonly ILogger _logger = logger; + private ConcurrentDictionary>> _openFiles = new(); /// Implicitly 'opens' a file if not already open, and returns the text. @@ -54,13 +57,13 @@ public class IdeOpenTabsFileManager } } - private static async Task WriteAllText(SharpIdeFile file, string text) + private async Task WriteAllText(SharpIdeFile file, string text) { file.SuppressDiskChangeEvents = true; await File.WriteAllTextAsync(file.Path, text); - Console.WriteLine($"Saved file {file.Path}"); file.LastIdeWriteTime = DateTimeOffset.Now; file.SuppressDiskChangeEvents = false; + _logger.LogInformation("IdeOpenTabsFileManager: Saved file {FilePath}", file.Path); } public async Task SaveAllOpenFilesAsync()