Tuesday, August 14, 2012 9:15 PM
I try to build a novel refactoring tool that performs refactoring on source code files that are not existing in the current work space. Is there a way I can create an IDocument instance from these source code files?
Thanks very much!
Friday, August 17, 2012 6:23 PM
The document instances are part of the solution/project/document model, so you can only have a document instance if you manually add one to a solution instance. So you can either take the solution that the workspace has and add your document to it (it will then be in a separate immutable branch of the solution that workspace doesn't directly know about) or you can create your own separate solution instance and add your document to that.
var solutionId = SolutionId.Create();
var projectId = ProjectId.Create(solutonId);
var documentId = DocumentId.Create(projectId);
var solution = Solution.Create(solutionId).AddProject(projectId, ...).AddDocument(documentId, ...);
var doc = solution.GetDocument(documentId);
Wayward LINQ Lacky
Sunday, August 19, 2012 3:13 AM
Thanks for the reply! They do help a lot!