diff options
Diffstat (limited to 'main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions')
3 files changed, 9 insertions, 5 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs index bf1523421d..d9d8be69ac 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/Actions/MoveTypeToFile.cs @@ -72,7 +72,7 @@ namespace MonoDevelop.CSharp.Refactoring.CodeActions if (IsSingleType (ctx)) { FileService.RenameFile (ctx.TextEditor.FileName, correctFileName); if (ctx.FileContainerProject != null) - ctx.FileContainerProject.Save (new NullProgressMonitor ()); + ctx.FileContainerProject.Save (new ProgressMonitor ()); return; } @@ -103,7 +103,7 @@ namespace MonoDevelop.CSharp.Refactoring.CodeActions File.WriteAllText (correctFileName, content); context.FileContainerProject.AddFile (correctFileName); - MonoDevelop.Ide.IdeApp.ProjectOperations.Save (context.FileContainerProject); + MonoDevelop.Ide.IdeApp.ProjectOperations.SaveAsync (context.FileContainerProject); } static bool IsBlankLine (TextDocument doc, int i) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs index a831bc4171..8674904f33 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs @@ -235,7 +235,7 @@ namespace MonoDevelop.CSharp.Refactoring.CodeActions if (sharedResolver == null) return null; return new MDRefactoringContext (document, sharedResolver, loc, cancellationToken); - }, TaskContinuationOptions.ExecuteSynchronously); + }); } internal MDRefactoringContext (Document document, CSharpAstResolver resolver, TextLocation loc, CancellationToken cancellationToken = default (CancellationToken)) : base (resolver, cancellationToken) diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs index 80db3eb8a1..02e35f0e04 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs @@ -269,7 +269,11 @@ namespace MonoDevelop.CSharp.Refactoring.CodeActions if (operationsRunning-- == 0) { isDisposed = true; undoGroup.Dispose (); - base.Dispose (); + try { + base.Dispose (); + } catch (Exception e) { + LoggingService.LogError ("Error while disposing refactoring script", e); + } } foreach (var script in startedScripts) script.Dispose (); @@ -363,7 +367,7 @@ namespace MonoDevelop.CSharp.Refactoring.CodeActions if (project != null) { project.AddFile (correctFileName); - IdeApp.ProjectOperations.Save (project); + IdeApp.ProjectOperations.SaveAsync (project); } IdeApp.Workbench.OpenDocument (correctFileName, project); } |