ignore file changes not in workspace

This commit is contained in:
Matt Parker
2025-11-23 18:30:44 +10:00
parent 06cd3a0357
commit 91f19a0552
2 changed files with 15 additions and 6 deletions

View File

@@ -132,7 +132,8 @@ public class FileChangedService
private async Task HandleWorkspaceFileChanged(SharpIdeFile file, string newContents)
{
await _roslynAnalysis.UpdateDocument(file, newContents);
var fileUpdatedInWorkspace = await _roslynAnalysis.UpdateDocument(file, newContents);
if (fileUpdatedInWorkspace is false) return;
GlobalEvents.Instance.SolutionAltered.InvokeParallelFireAndForget();
_updateSolutionDiagnosticsQueue.AddWork();
}
@@ -146,7 +147,8 @@ public class FileChangedService
private async Task HandleWorkspaceFileRemoved(SharpIdeFile file)
{
await _roslynAnalysis.RemoveDocument(file);
var success = await _roslynAnalysis.RemoveDocument(file);
if (success is false) return;
GlobalEvents.Instance.SolutionAltered.InvokeParallelFireAndForget();
_updateSolutionDiagnosticsQueue.AddWork();
}