From cd68d0323eb97f18c10281847c831f8e361506b9 Mon Sep 17 00:00:00 2001 From: mattwar Date: Wed, 7 Jan 2015 11:00:16 -0800 Subject: [PATCH] Fix for bug 1101013 Added optional filePath argument to AddDocument overloads. (changeset 1393692) --- .../Portable/Workspace/Solution/Project.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Src/Workspaces/Core/Portable/Workspace/Solution/Project.cs b/Src/Workspaces/Core/Portable/Workspace/Solution/Project.cs index c94ade18bdb..c2869f9485f 100644 --- a/Src/Workspaces/Core/Portable/Workspace/Solution/Project.cs +++ b/Src/Workspaces/Core/Portable/Workspace/Solution/Project.cs @@ -592,49 +592,49 @@ public Project WithAnalyzerReferences(IEnumerable analyzerRef /// /// Creates a new document in a new instance of this project. /// - public Document AddDocument(string name, SyntaxNode syntaxRoot, IEnumerable folders = null) + public Document AddDocument(string name, SyntaxNode syntaxRoot, IEnumerable folders = null, string filePath = null) { var id = DocumentId.CreateNewId(this.Id); // use preserve identity for forked solution directly from syntax node. // this lets us not serialize temporary tree unnecessarily - return this.Solution.AddDocument(id, name, syntaxRoot, folders, preservationMode: PreservationMode.PreserveIdentity).GetDocument(id); + return this.Solution.AddDocument(id, name, syntaxRoot, folders, filePath, preservationMode: PreservationMode.PreserveIdentity).GetDocument(id); } /// /// Creates a new document in a new instance of this project. /// - public Document AddDocument(string name, SourceText text, IEnumerable folders = null) + public Document AddDocument(string name, SourceText text, IEnumerable folders = null, string filePath = null) { var id = DocumentId.CreateNewId(this.Id); - return this.Solution.AddDocument(id, name, text, folders).GetDocument(id); + return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id); } /// /// Creates a new document in a new instance of this project. /// - public Document AddDocument(string name, string text, IEnumerable folders = null) + public Document AddDocument(string name, string text, IEnumerable folders = null, string filePath = null) { var id = DocumentId.CreateNewId(this.Id, debugName: name); - return this.Solution.AddDocument(id, name, text, folders).GetDocument(id); + return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id); } /// /// Creates a new additional document in a new instance of this project. /// - public TextDocument AddAdditionalDocument(string name, SourceText text, IEnumerable folders = null) + public TextDocument AddAdditionalDocument(string name, SourceText text, IEnumerable folders = null, string filePath = null) { var id = DocumentId.CreateNewId(this.Id); - return this.Solution.AddAdditionalDocument(id, name, text, folders).GetAdditionalDocument(id); + return this.Solution.AddAdditionalDocument(id, name, text, folders, filePath).GetAdditionalDocument(id); } /// /// Creates a new additional document in a new instance of this project. /// - public TextDocument AddAdditionalDocument(string name, string text, IEnumerable folders = null) + public TextDocument AddAdditionalDocument(string name, string text, IEnumerable folders = null, string filePath = null) { var id = DocumentId.CreateNewId(this.Id); - return this.Solution.AddAdditionalDocument(id, name, text, folders).GetAdditionalDocument(id); + return this.Solution.AddAdditionalDocument(id, name, text, folders, filePath).GetAdditionalDocument(id); } /// -- GitLab