// ĠCopyright Ġ 2 0 0 0 - 2 0 2 1 ĠJetBrains Ġs . r . o . Ġand Ġcontributors . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġorg . jetbrains . kotlin . idea . search . ref Index Ċ Ċ import Ġcom . intellij . compiler . Compiler Reference Service Ċ import Ġcom . intellij . compiler . backward Refs . Compiler Reference Service Base Ċ import Ġcom . intellij . java . compiler . Compiler References TestBase Ċ import Ġcom . intellij . openapi . options . advanced . Advanced Settings Ċ import Ġcom . intellij . openapi . vfs . Virtual File Ċ import Ġcom . intellij . psi . Psi Element Ċ import Ġcom . intellij . psi . Psi Named Element Ċ import Ġcom . intellij . psi . util . parent OfType Ċ import Ġcom . intellij . test Framework . builders . Java Module Fixture Builder Ċ import Ġcom . intellij . test Framework . run All Ċ import Ġorg . jetbrains . kotlin . idea . artifacts . Kotlin Artifact Names Ċ import Ġorg . jetbrains . kotlin . idea . artifacts . Kotlin Artifacts Ċ import Ġorg . jetbrains . kotlin . utils . addTo Std lib . cast Ċ import Ġkotlin . properties . Deleg ates Ċ Ċ abstract Ġclass ĠKotlin Compiler Reference TestBase Ġ: ĠCompiler References TestBase () Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġdefault Enable State Ġby ĠDeleg ates . notNull < Boolean >() ĊĊĠĠĠ Ġoverride Ġfun Ġtune Fixture ( module Builder : ĠJava Module Fixture Builder <* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġmodule Builder . add Library ( Kotlin Artifact Names . K OT LIN _ STD LIB , ĠKotlin Artifacts . instance . kotlin Std lib . path ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . setUp () ĊĠĠĠĠĠĠĠ Ġdefault Enable State Ġ= ĠAdvanced Settings . getBoolean ( Kotlin Compiler Reference Index Service . SETTINGS _ ID ) ĊĠĠĠĠĠĠĠ ĠAdvanced Settings . set Boolean ( Kotlin Compiler Reference Index Service . SETTINGS _ ID , Ġtrue ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠtearDown () Ġ= Ġrun All ( ĊĠĠĠĠĠĠĠ Ġ{ ĠAdvanced Settings . set Boolean ( Kotlin Compiler Reference Index Service . SETTINGS _ ID , Ġdefault Enable State ) Ġ}, ĊĠĠĠĠĠĠĠ Ġ{ Ġsuper . te ar Down () Ġ}, ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprotected Ġfun Ġget Refer ent Files For Element Under Caret (): ĠSet < String >? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġelement At Caret Ġ= Ġmy Fixture . elementAt Caret ĊĠĠĠĠĠĠĠ Ġval Ġdeclaration At Caret Ġ= Ġelement At Caret . parent OfType < Psi Named Element >( with Self Ġ= Ġtrue ) Ġ?: Ġerror (" declaration Ġat Ġcaret Ġnot Ġfound ") ĊĠĠĠĠĠĠĠ Ġreturn Ġget Refer ent Files ( declaration At Caret , Ġtrue ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected Ġfun Ġget Refer ent Files ( element : ĠPsi Element , Ġwith Java Index : ĠBoolean ): ĠSet < String >? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfrom Kotlin Index Ġ= ĠKotlin Compiler Reference Index Service [ project ]. find Reference Files In Tests ( element ) ĊĠĠĠĠĠĠĠ Ġval Ġfrom Java Index Ġ= ĠCompiler Reference Service . getInstance ( project ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. take If Ġ{ Ġwith Java Index Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ? . cast < Compiler Reference Service Base <* >>() ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ? . get Refer ent Files For Tests ( element ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( from Kotlin Index Ġ== Ġnull Ġ&& Ġfrom Java Index Ġ== Ġnull ) Ġreturn Ġnull ĊĠĠĠĠĠĠĠ Ġreturn Ġmutable Set Of < String >(). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfrom Kotlin Index ?. map To ( this , ĠVirtual File :: getName ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfrom Java Index ?. map To ( this , ĠVirtual File :: getName ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }