private static FileContent GetPublicSurface(ISourceFile originalFile, ITypeChecker checker) { using (var writer = new ScriptWriter()) { var printer = new PublicSurfacePrinter(writer, new SemanticModel(checker)); FileContent publicContent; var result = printer.TryPrintPublicSurface(originalFile, out publicContent); XAssert.IsTrue(result); return(publicContent); } }
private FileContent CreatePublicFacadeContent(ISourceFile sourceFile, ISemanticModel semanticModel) { var specPath = sourceFile.Path.AbsolutePath; using (var sw = m_statistics.PublicFacadeComputation.Start(specPath)) { using (var writer = new ScriptWriter()) { var printer = new PublicSurfacePrinter(writer, semanticModel); if (!printer.TryPrintPublicSurface(sourceFile, out var publicFacadeContent)) { m_statistics.PublicFacadeGenerationFailures.Increment(sw.Elapsed); } return(publicFacadeContent); } } }