rename class
This commit is contained in:
@@ -17,6 +17,9 @@ public class GlobalEvents
|
||||
public FileSystemWatcherInternal FileSystemWatcherInternal { get; } = new();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// All file system events for files we have filtered for, e.g. excluding bin/obj folders. Does not filter out events triggered by us
|
||||
/// </summary>
|
||||
public class FileSystemWatcherInternal
|
||||
{
|
||||
public EventWrapper<string, Task> DirectoryCreated { get; } = new(_ => Task.CompletedTask);
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using SharpIDE.Application.Features.Events;
|
||||
using SharpIDE.Application.Features.Analysis;
|
||||
using SharpIDE.Application.Features.Evaluation;
|
||||
using SharpIDE.Application.Features.Events;
|
||||
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
|
||||
|
||||
namespace SharpIDE.Application.Features.FileWatching;
|
||||
|
||||
public class IdeFileChangeHandler
|
||||
public class IdeFileExternalChangeHandler
|
||||
{
|
||||
public SharpIdeSolutionModel SolutionModel { get; set; } = null!;
|
||||
public IdeFileChangeHandler()
|
||||
public IdeFileExternalChangeHandler()
|
||||
{
|
||||
GlobalEvents.Instance.FileSystemWatcherInternal.FileChanged.Subscribe(OnFileChanged);
|
||||
}
|
||||
@@ -27,5 +29,18 @@ public class IdeFileChangeHandler
|
||||
}
|
||||
Console.WriteLine($"IdeFileChangeHandler: Changed - {filePath}");
|
||||
await sharpIdeFile.FileContentsChangedExternallyFromDisk.InvokeParallelAsync();
|
||||
if (sharpIdeFile.IsCsprojFile)
|
||||
{
|
||||
await HandleCsprojChanged(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleCsprojChanged(string filePath)
|
||||
{
|
||||
var project = SolutionModel.AllProjects.SingleOrDefault(p => p.FilePath == filePath);
|
||||
if (project is null) return;
|
||||
await ProjectEvaluation.ReloadProject(filePath);
|
||||
await RoslynAnalysis.ReloadProject(project);
|
||||
await RoslynAnalysis.UpdateSolutionDiagnostics();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user