remove unused code

This commit is contained in:
Matt Parker
2025-10-19 13:43:48 +10:00
parent 13e0db3dbc
commit 83ca5ee76b

View File

@@ -1,16 +1,12 @@
using System.Collections.Concurrent;
using SharpIDE.Application.Features.Analysis;
using SharpIDE.Application.Features.Events;
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(RoslynAnalysis roslynAnalysis)
public class IdeOpenTabsFileManager
{
private readonly RoslynAnalysis _roslynAnalysis = roslynAnalysis;
private ConcurrentDictionary<SharpIdeFile, Lazy<Task<string>>> _openFiles = new();
/// Implicitly 'opens' a file if not already open, and returns the text.
@@ -35,26 +31,6 @@ public class IdeOpenTabsFileManager(RoslynAnalysis roslynAnalysis)
_openFiles[file] = newLazyTask;
}
public async Task ReloadFileFromDisk(SharpIdeFile file)
{
if (!_openFiles.ContainsKey(file)) throw new InvalidOperationException("File is not open in memory.");
var newTextTaskLazy = new Lazy<Task<string>>(() => File.ReadAllTextAsync(file.Path));
_openFiles[file] = newTextTaskLazy;
var textTask = newTextTaskLazy.Value;
}
public async Task<bool> ReloadFileFromDiskIfOpenInEditor(SharpIdeFile file)
{
if (!_openFiles.ContainsKey(file)) return false;
var newTextTaskLazy = new Lazy<Task<string>>(() => File.ReadAllTextAsync(file.Path));
_openFiles[file] = newTextTaskLazy;
//var textTask = newTextTaskLazy.Value;
return true;
}
public async Task SaveFileAsync(SharpIdeFile file)
{
if (!_openFiles.ContainsKey(file)) throw new InvalidOperationException("File is not open in memory.");