@@ -22,14 +22,17 @@ private static Func<CompilationOptions, byte, CompilationOptions> CreateWithMeta
2222 }
2323
2424 public static Document CreateProjectDocumentFromTree ( this CompilationOptions options ,
25- Workspace workspace , SyntaxTree tree , IEnumerable < MetadataReference > references , ParseOptions parseOptions )
25+ Workspace workspace , SyntaxTree tree , IEnumerable < MetadataReference > references , ParseOptions parseOptions ,
26+ string singleDocumentAssemblyName = null )
2627 {
28+ singleDocumentAssemblyName = singleDocumentAssemblyName ?? "ProjectToBeConverted" ;
2729 ProjectId projectId = ProjectId . CreateNewId ( ) ;
28- var solution = workspace . CurrentSolution . AddProject ( projectId , "ProjectToBeConverted" ,
29- "ProjectToBeConverted" , options . Language ) ;
30+ var solution = workspace . CurrentSolution . AddProject ( projectId , singleDocumentAssemblyName ,
31+ singleDocumentAssemblyName , options . Language ) ;
3032
3133 var project = solution . GetProject ( projectId )
3234 . WithCompilationOptions ( options )
35+ . WithParseOptions ( parseOptions )
3336 . WithMetadataReferences ( references ) ;
3437 return project . AddDocument ( "CodeToConvert" , tree . GetRoot ( ) , filePath : Path . Combine ( Directory . GetCurrentDirectory ( ) , "TempCodeToConvert.txt" ) ) ;
3538 }
0 commit comments