From 875a58cd5247bb24362dea8e8ddb88b85b9caeff Mon Sep 17 00:00:00 2001 From: enricosada Date: Thu, 6 Aug 2015 14:29:18 -0700 Subject: [PATCH] Fix 483 - project item save filename null The filename parameter of both Envdte.Project.Save and Envdte.ProjectItem.Save is optional ( null value or string.empty ) Implement same behaviour of c# projects fixes https://github.com/Microsoft/visualfsharp/issues/483 closes https://github.com/Microsoft/visualfsharp/pull/493 commit 115edbe9ccf028208df627d8cdc03a9c4876cc85 Author: enricosada Date: Tue Jun 9 11:18:01 2015 +0200 fix dte Project.Save, filename parameter is optional the filename argument behaviour is the same for null value and string.Empty commit b66a0f45d342b1b10e1f4867c89f964b8dcfc7e1 Author: enricosada Date: Mon Jun 8 18:01:18 2015 +0200 fix dte ProjectItem.Save, filename parameter is optional the filename argument behaviour is the same for null value and string.Empty --- .../Common.Source.CSharp/Project/Automation/OAFileItem.cs | 4 ++-- .../Common.Source.CSharp/Project/Automation/OAProject.cs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAFileItem.cs b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAFileItem.cs index 97fe3a10d..330e18766 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAFileItem.cs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAFileItem.cs @@ -218,10 +218,9 @@ public override EnvDTE.Window Open(string viewKind) /// /// The name with which to save the project or project item. /// Is thrown if the save operation failes. - /// Is thrown if fileName is null. public override void Save(string fileName) { - this.DoSave(false, fileName); + this.DoSave(false, fileName ?? string.Empty); } /// @@ -229,6 +228,7 @@ public override void Save(string fileName) /// /// The file name with which to save the solution, project, or project item. If the file exists, it is overwritten /// true if the rename was successful. False if Save as failes + /// Is thrown if fileName is null. public override bool SaveAs(string fileName) { try diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAProject.cs b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAProject.cs index fcdc5b87a..94bd374a1 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAProject.cs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/Automation/OAProject.cs @@ -394,10 +394,9 @@ public virtual void SaveAs(string fileName) /// /// The file name of the project /// Is thrown if the save operation failes. - /// Is thrown if fileName is null. public virtual void Save(string fileName) { - this.DoSave(false, fileName); + this.DoSave(false, fileName ?? string.Empty); } /// -- GitLab