internal static CSharpCompilation WithSource(this CSharpCompilation compilation, CSharpTestSource newSource) { return(compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(newSource.GetSyntaxTrees(TestOptions.Regular))); }
internal static CSharpCompilation WithSource(this CSharpCompilation compilation, CSharpTestSource newSource) { var previousParseOptions = (CSharpParseOptions)compilation.SyntaxTrees.FirstOrDefault()?.Options; return(compilation.RemoveAllSyntaxTrees().AddSyntaxTrees(newSource.GetSyntaxTrees(previousParseOptions))); }