@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTest
1414import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE_K1
1515import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE_K2
1616import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.PRETTY_RENDERER_OPTION
17+ import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.RENDER_IS_PUBLIC_API
1718import org.jetbrains.kotlin.analysis.api.renderer.declarations.KaDeclarationRenderer
1819import org.jetbrains.kotlin.analysis.api.renderer.declarations.impl.KaDeclarationRendererForDebug
1920import org.jetbrains.kotlin.analysis.api.renderer.declarations.renderers.KaClassifierBodyRenderer
@@ -330,8 +331,12 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiBasedTest() {
330331 }
331332
332333 protected open fun KaSession.renderSymbolForComparison (symbol : KaSymbol , directives : RegisteredDirectives ): String {
333- val renderExpandedTypes = directives[PRETTY_RENDERER_OPTION ].any { it == PrettyRendererOption .FULLY_EXPANDED_TYPES }
334- return with (DebugSymbolRenderer (renderExtra = true , renderExpandedTypes = renderExpandedTypes)) { render(useSiteSession, symbol) }
334+ val renderer = DebugSymbolRenderer (
335+ renderExtra = true ,
336+ renderExpandedTypes = directives[PRETTY_RENDERER_OPTION ].any { it == PrettyRendererOption .FULLY_EXPANDED_TYPES },
337+ renderIsPublicApi = RENDER_IS_PUBLIC_API in directives
338+ )
339+ return with (renderer) { render(useSiteSession, symbol) }
335340 }
336341}
337342
@@ -363,6 +368,8 @@ object SymbolTestDirectives : SimpleDirectivesContainer() {
363368 val PRETTY_RENDERER_OPTION by enumDirective(description = " Explicit rendering mode" ) { PrettyRendererOption .valueOf(it) }
364369
365370 val TARGET_FILE_NAME by stringDirective(description = " The name of the main file" )
371+
372+ val RENDER_IS_PUBLIC_API by directive(description = " Render `isPublicApi` attribute for symbols" )
366373}
367374
368375enum class PrettyRendererOption (val transformation : (KaDeclarationRenderer ) -> KaDeclarationRenderer ) {
0 commit comments