File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/SharpIDE.Application/Features/Analysis Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -996,16 +996,22 @@ public async Task RemoveDocument(SharpIdeFile fileModel)
996996
997997 public async Task MoveDocument ( SharpIdeFile sharpIdeFile , string oldFilePath )
998998 {
999- var document = _workspace ! . CurrentSolution . GetDocumentIdsWithFilePath ( oldFilePath ) . Single ( ) ;
1000- var updatedSolution = _workspace . CurrentSolution . WithDocumentFilePath ( document , sharpIdeFile . Path ) ;
1001- _workspace . TryApplyChanges ( updatedSolution ) ;
999+ var documentId = _workspace ! . CurrentSolution . GetDocumentIdsWithFilePath ( oldFilePath ) . Single ( ) ;
1000+ _workspace . SetCurrentSolution ( oldSolution =>
1001+ {
1002+ var newSolution = oldSolution . WithDocumentFilePath ( documentId , sharpIdeFile . Path ) ;
1003+ return newSolution ;
1004+ } , WorkspaceChangeKind . DocumentInfoChanged , documentId : documentId ) ;
10021005 }
10031006
10041007 public async Task RenameDocument ( SharpIdeFile sharpIdeFile , string oldFilePath )
10051008 {
10061009 var documentId = _workspace ! . CurrentSolution . GetDocumentIdsWithFilePath ( oldFilePath ) . Single ( ) ;
1007- var updatedSolution = _workspace . CurrentSolution . WithDocumentName ( documentId , sharpIdeFile . Name ) ;
1008- _workspace . TryApplyChanges ( updatedSolution ) ;
1010+ _workspace . SetCurrentSolution ( oldSolution =>
1011+ {
1012+ var newSolution = oldSolution . WithDocumentName ( documentId , sharpIdeFile . Name ) ;
1013+ return newSolution ;
1014+ } , WorkspaceChangeKind . DocumentInfoChanged , documentId : documentId ) ;
10091015 }
10101016
10111017 public async Task < string > GetOutputDllPathForProject ( SharpIdeProjectModel projectModel )
You can’t perform that action at this time.
0 commit comments