/* Ċ Ġ* ĠCopyright Ġ 2 0 0 0 - 2 0 2 1 Ġ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 . sear che very where Ċ Ċ import Ġcom . intellij . ide . actions . sear che very where . SER es ult s Equality Provider . SE Equal Elements ActionType .* Ċ import Ġcom . intellij . ide . actions . sear che very where . Search Every where Found Element Info Ċ import Ġcom . intellij . psi . util . parent OfType Ċ import Ġcom . intellij . test Framework . fixtures . Light Java Code Insight Fixture TestCase Ċ import Ġorg . jetbrains . kotlin . psi . Kt Class Ċ import Ġorg . jetbrains . kotlin . psi . Kt File Ċ Ċ /** Ċ Ġ* Ġ@ see ĠK t Search Every where Equality Provider Ċ Ġ*/ Ċ class ĠK t File And Kt Class Equality Provider Test Ġ: ĠLight Java Code Insight Fixture TestCase () Ġ{ ĊĠĠĠ Ġfun Ġ` test ĠK t File Ġshould Ġbe Ġreplaced Ġby ĠK t Class `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpsi File Ġ= Ġmy Fixture . configure By Text (" Foo . kt ", Ġ" class ĠF < caret > oo ") ĊĠĠĠĠĠĠĠ Ġval Ġklass Ġ= Ġpsi File . findElement At ( my Fixture . caret Offset )?. parent OfType < Kt Class >() !! ĊĠĠĠĠĠĠĠ Ġval Ġkt File Ġ= Ġpsi File . findElement At ( my Fixture . caret Offset )?. parent OfType < Kt File >() !! ĊĊĠĠĠĠĠĠĠ Ġval Ġkt File Element Info Ġ= ĠSearch Every where Found Element Info ( kt File , Ġ 0 , Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġactual Action Ġ= ĠK t Search Every where Equality Provider (). compare Items ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnew Item Ġ= ĠSearch Every where Found Element Info ( klass , Ġ 0 , Ġnull ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġalready Found Items Ġ= ĠlistOf ( kt File Element Info ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( actual Action , ĠReplace ( kt File Element Info )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test ĠK t File Ġshould Ġbe Ġskipped `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpsi File Ġ= Ġmy Fixture . configure By Text (" Foo . kt ", Ġ" class ĠF < caret > oo ") ĊĠĠĠĠĠĠĠ Ġval Ġklass Ġ= Ġpsi File . findElement At ( my Fixture . caret Offset )?. parent OfType < Kt Class >() !! ĊĠĠĠĠĠĠĠ Ġval Ġkt File Ġ= Ġpsi File . findElement At ( my Fixture . caret Offset )?. parent OfType < Kt File >() !! ĊĊĠĠĠĠĠĠĠ Ġval Ġactual Action Ġ= ĠK t Search Every where Equality Provider (). compare Items ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnew Item Ġ= ĠSearch Every where Found Element Info ( kt File , Ġ 0 , Ġnull ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġalready Found Items Ġ= ĠlistOf ( Search Every where Found Element Info ( klass , Ġ 0 , Ġnull )) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( actual Action , ĠSkip ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test ĠK t File Ġand ĠK t Class Ġshouldn 't Ġbe Ġde d uplicated Ġwhen Ġfac ade Ġclass Ġexist `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpsi File Ġ= Ġmy Fixture . configure By Text ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" Foo . kt ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfun Ġfoo () Ġ= ĠUnit Ġ// ĠForce Ġto Ġcreate ĠK t Light Class For Facade ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclass ĠF < caret > oo ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġval Ġkt File Ġ= Ġpsi File . findElement At ( my Fixture . caret Offset )?. parent OfType < Kt File >() !! ĊĠĠĠĠĠĠĠ Ġval Ġkt Class Ġ= Ġpsi File . findElement At ( my Fixture . caret Offset )?. parent OfType < Kt Class >() !! ĊĊĠĠĠĠĠĠĠ Ġval Ġactual Action Ġ= ĠK t Search Every where Equality Provider (). compare Items ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnew Item Ġ= ĠSearch Every where Found Element Info ( kt File , Ġ 0 , Ġnull ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġalready Found Items Ġ= ĠlistOf ( Search Every where Found Element Info ( kt Class , Ġ 0 , Ġnull )) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Do Nothing , Ġactual Action ) ĊĠĠĠ Ġ} Ċ } Ċ