package Ġcom . a em tools . completion . ht l . provider Ċ Ċ import Ġcom . a em tools . analysis . ht l . call chain Ċ import Ġcom . a em tools . analysis . ht l . call chain . elements . segment . resolve SelectedItem Ċ import Ġcom . a em tools . common . util . find Parent ByType Ċ import Ġcom . a em tools . completion . ht l . model . Resolution Result Ċ import Ġcom . a em tools . lang . ht l . psi . mixin . Property Access Mixin Ċ import Ġcom . intellij . code Insight . completion . Completion Parameters Ċ import Ġcom . intellij . code Insight . completion . Completion Provider Ċ import Ġcom . intellij . code Insight . completion . Completion ResultSet Ċ import Ġcom . intellij . psi . Psi Element Ċ import Ġcom . intellij . util . Processing Context Ċ Ċ /** Ċ Ġ* Ġ@ author ĠD my tro ĠPrim sh y ts Ċ Ġ*/ Ċ object ĠH tl El Member Access Completion Provider Ġ: ĠCompletion Provider < Completion Parameters >() Ġ{ ĊĠ Ġoverride Ġfun Ġadd Comp letions ( ĊĠĠĠĠĠ Ġparameters : ĠCompletion Parameters , ĊĠĠĠĠĠ Ġcontext : ĠProcessing Context , ĊĠĠĠĠĠ Ġresult : ĠCompletion ResultSet ) Ġ{ ĊĠĠĠ Ġval Ġcurrent Position Ġ= Ġparameters . position ĊĠĠĠ Ġval Ġresolution Result Ġ= Ġresolve ( current Position ) ĊĊĠĠĠ Ġresolution Result . pre defined ?. let Ġ{ ĊĠĠĠĠĠ Ġresult . addAll Elements ( it ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġresult . stop Here () ĊĠ Ġ} ĊĊĠ Ġ/** ĊĠĠ Ġ* ĠResolve Ġgiven Ġpsi Ġelement . ĊĠĠ Ġ* ĊĠĠ Ġ* Ġ@ param Ġelement Ġthe Ġelement ĊĠĠ Ġ* Ġ@ return Ġresolution Ġresult Ġobject ĊĠĠ Ġ*/ ĊĠ Ġfun Ġresolve ( element : ĠPsi Element ): ĠResolution Result Ġ{ ĊĠĠĠ Ġval Ġproperty Access Element Ġ= Ġelement . find Parent ByType ( Property Access Mixin :: class . java ) ĊĠĠĠĠĠĠĠ Ġ?: Ġreturn ĠResolution Result () ĊĊĠĠĠ Ġval Ġchain Ġ= Ġproperty Access Element . call chain () ĊĠĠĠĠĠĠĠ Ġ?: Ġreturn ĠResolution Result () ĊĠĠĠ Ġval Ġlast Segment Ġ= Ġchain . call Chain Segments . last OrNull () ĊĠĠĠĠĠĠĠ Ġ?: Ġreturn ĠResolution Result () ĊĊĠĠĠ Ġreturn Ġlast Segment . resolve SelectedItem () ĊĠ Ġ} Ċ Ċ } Ċ