/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 2 0 ĠJetBrains Ġs . r . o . Ġand ĠKotlin ĠProgramming ĠLanguage Ġcontributors . Ċ Ġ* ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe Ġlicense / LICENSE . txt Ġfile . Ċ Ġ*/ Ċ Ċ package Ġorg . jetbrains . kotlin . idea . fir . low . level . api . tras form ers Ċ Ċ import Ġorg . jetbrains . kotlin . fir . F ir Element Ċ import Ġorg . jetbrains . kotlin . fir . F ir Session Ċ import Ġorg . jetbrains . kotlin . fir . declarations . F ir Declaration Ċ import Ġorg . jetbrains . kotlin . fir . resolve . Resolution Mode Ċ import Ġorg . jetbrains . kotlin . fir . resolve . Scope Session Ċ import Ġorg . jetbrains . kotlin . fir . resolve . transformers . contracts . F ir Contract Resolve Transformer Ċ import Ġorg . jetbrains . kotlin . fir . visitor s . Composite Transform Result Ċ import Ġorg . jetbrains . kotlin . fir . visitor s . compose Ċ Ċ internal Ġclass ĠF ir Design ated Contracts Resolve Transformer For IDE ( ĊĠĠĠ Ġprivate Ġval Ġdesign ation : ĠIterator < F ir Declaration >, ĊĠĠĠ Ġtarget Declaration : ĠF ir Declaration , ĊĠĠĠ Ġsession : ĠF ir Session , ĊĠĠĠ Ġscope Session : ĠScope Session , Ċ ) Ġ: ĠF ir Contract Resolve Transformer ( session , Ġscope Session ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġphase Replace Oracle Ġ= ĠPhase Replace Oracle ( target Declaration ) ĊĊĠĠĠ Ġoverride Ġfun Ġtransform Declaration Content ( declaration : ĠF ir Declaration , Ġdata : ĠResolution Mode ): ĠComposite Transform Result < F ir Declaration > Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( designation . hasNext ()) Ġphase Replace Oracle . transform Declaration Inside ( designation . next ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . visit No Transform ( this , Ġdata ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġdeclaration . compose () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġsuper . transform Declaration Content ( declaration , Ġdata ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġneed Replace Phase ( fir Declaration : ĠF ir Declaration ): ĠBoolean Ġ= Ġphase Replace Oracle . need Replace Phase ( fir Declaration ) Ċ } Ċ