rename and delete fs events for files

This commit is contained in:
Matt Parker
2025-10-22 00:50:02 +10:00
parent a403cb3389
commit 588299ef39
5 changed files with 60 additions and 0 deletions

View File

@@ -803,4 +803,11 @@ public class RoslynAnalysis
var updatedSolution = _workspace.CurrentSolution.WithDocumentFilePath(document, sharpIdeFile.Path);
_workspace.TryApplyChanges(updatedSolution);
}
public async Task RenameDocument(SharpIdeFile sharpIdeFile, string oldFilePath)
{
var documentId = _workspace!.CurrentSolution.GetDocumentIdsWithFilePath(oldFilePath).Single();
var updatedSolution = _workspace.CurrentSolution.WithDocumentName(documentId, sharpIdeFile.Name);
_workspace.TryApplyChanges(updatedSolution);
}
}