@@ -3,6 +3,8 @@ package com.emberjs.hbs
33import com.dmarcotte.handlebars.psi.HbSimpleMustache
44import com.dmarcotte.handlebars.psi.HbStringLiteral
55import com.dmarcotte.handlebars.psi.impl.HbStatementsImpl
6+ import com.emberjs.gts.GjsLanguage
7+ import com.emberjs.gts.GtsLanguage
68import com.emberjs.index.EmberNameIndex
79import com.emberjs.psi.EmberNamedAttribute
810import com.emberjs.psi.EmberNamedElement
@@ -11,6 +13,7 @@ import com.emberjs.resolver.EmberName
1113import com.emberjs.utils.originalVirtualFile
1214import com.emberjs.xml.EmberAttrDec
1315import com.intellij.lang.Language
16+ import com.intellij.lang.ecmascript6.psi.ES6ImportSpecifier
1417import com.intellij.openapi.util.TextRange
1518import com.intellij.psi.PsiDirectory
1619import com.intellij.psi.PsiElement
@@ -34,6 +37,28 @@ abstract class HbReference(element: PsiElement): PsiReferenceBase<PsiElement>(el
3437 if (res is EmberNamedElement ) {
3538 res = res.target
3639 }
40+ if (res is ES6ImportSpecifier ) {
41+ var resolved = res.containingFile.viewProvider.findReferenceAt(res.textOffset, GtsLanguage .INSTANCE )?.resolve()
42+ resolved = resolved ? : res.containingFile.viewProvider.findReferenceAt(res.textOffset, GjsLanguage .INSTANCE )?.resolve()
43+ if (element.manager.areElementsEquivalent(resolved, other)) {
44+ return true
45+ }
46+ if (element.manager.areElementsEquivalent(res.reference?.resolve(), other)) {
47+ return true
48+ }
49+ if (res.references.any {
50+ element.manager.areElementsEquivalent(it.element, other) || super .isReferenceTo(other)
51+ }) {
52+ return true
53+ }
54+ val results = res.multiResolve(false )
55+ val r = results.any {
56+ element.manager.areElementsEquivalent(it.element, other) || super .isReferenceTo(other)
57+ }
58+ if (r) {
59+ return true
60+ }
61+ }
3762 return element.manager.areElementsEquivalent(res, other) || super .isReferenceTo(other)
3863 }
3964}
0 commit comments