@@ -17,6 +17,7 @@ import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTest
17
17
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE_K1
18
18
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.DO_NOT_CHECK_SYMBOL_RESTORE_K2
19
19
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.PRETTY_RENDERER_OPTION
20
+ import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.symbols.SymbolTestDirectives.RENDER_IS_PUBLIC_API
20
21
import org.jetbrains.kotlin.analysis.api.renderer.declarations.KaDeclarationRenderer
21
22
import org.jetbrains.kotlin.analysis.api.renderer.declarations.impl.KaDeclarationRendererForDebug
22
23
import org.jetbrains.kotlin.analysis.api.renderer.declarations.renderers.KaClassifierBodyRenderer
@@ -376,8 +377,12 @@ abstract class AbstractSymbolTest : AbstractAnalysisApiBasedTest() {
376
377
}
377
378
378
379
protected open fun KaSession.renderSymbolForComparison (symbol : KaSymbol , directives : RegisteredDirectives ): String {
379
- val renderExpandedTypes = directives[PRETTY_RENDERER_OPTION ].any { it == PrettyRendererOption .FULLY_EXPANDED_TYPES }
380
- return with (DebugSymbolRenderer (renderExtra = true , renderExpandedTypes = renderExpandedTypes)) { render(useSiteSession, symbol) }
380
+ val renderer = DebugSymbolRenderer (
381
+ renderExtra = true ,
382
+ renderExpandedTypes = directives[PRETTY_RENDERER_OPTION ].any { it == PrettyRendererOption .FULLY_EXPANDED_TYPES },
383
+ renderIsPublicApi = RENDER_IS_PUBLIC_API in directives
384
+ )
385
+ return with (renderer) { render(useSiteSession, symbol) }
381
386
}
382
387
}
383
388
@@ -411,6 +416,8 @@ object SymbolTestDirectives : SimpleDirectivesContainer() {
411
416
val TARGET_FILE_NAME by stringDirective(description = " The name of the main file" )
412
417
413
418
val ILLEGAL_PSI by stringDirective(description = " Symbol should not be created for this PSI element" )
419
+
420
+ val RENDER_IS_PUBLIC_API by directive(description = " Render `isPublicApi` attribute for symbols" )
414
421
}
415
422
416
423
enum class PrettyRendererOption (val transformation : (KaDeclarationRenderer ) -> KaDeclarationRenderer ) {
0 commit comments