@@ -12,7 +12,9 @@ import com.dmarcotte.handlebars.psi.impl.HbStatementsImpl
1212import com.emberjs.xml.EmberAttrDec
1313import com.emberjs.xml.EmberXmlElementDescriptor
1414import com.emberjs.glint.GlintLanguageServiceProvider
15+ import com.emberjs.gts.GjsLanguage
1516import com.emberjs.gts.GtsFileViewProvider
17+ import com.emberjs.gts.GtsLanguage
1618import com.emberjs.index.EmberNameIndex
1719import com.emberjs.psi.EmberNamedAttribute
1820import com.emberjs.psi.EmberNamedElement
@@ -23,6 +25,7 @@ import com.emberjs.utils.originalVirtualFile
2325import com.intellij.injected.editor.VirtualFileWindow
2426import com.intellij.lang.Language
2527import com.intellij.lang.ecmascript6.psi.ES6ImportDeclaration
28+ import com.intellij.lang.ecmascript6.psi.ES6ImportSpecifier
2629import com.intellij.lang.injection.InjectedLanguageManager
2730import com.intellij.lang.javascript.JavaScriptSupportLoader
2831import com.intellij.lang.javascript.psi.JSObjectLiteralExpression
@@ -226,6 +229,31 @@ class TagReference(val element: XmlTag, val fullName: String, val rangeInElem: T
226229 var res = resolve()
227230 if (res is EmberNamedElement ) {
228231 res = res.target
232+ if (element.manager.areElementsEquivalent(res, other) || super .isReferenceTo(other)) {
233+ return true
234+ }
235+ }
236+ if (res is ES6ImportSpecifier ) {
237+ var resolved = res.containingFile.viewProvider.findReferenceAt(res.textOffset, GtsLanguage .INSTANCE )?.resolve()
238+ resolved = resolved ? : res.containingFile.viewProvider.findReferenceAt(res.textOffset, GjsLanguage .INSTANCE )?.resolve()
239+ if (element.manager.areElementsEquivalent(resolved, other)) {
240+ return true
241+ }
242+ if (element.manager.areElementsEquivalent(res.reference?.resolve(), other)) {
243+ return true
244+ }
245+ if (res.references.any {
246+ element.manager.areElementsEquivalent(it.element, other) || super .isReferenceTo(other)
247+ }) {
248+ return true
249+ }
250+ val results = res.multiResolve(false )
251+ val r = results.any {
252+ element.manager.areElementsEquivalent(it.element, other) || super .isReferenceTo(other)
253+ }
254+ if (r) {
255+ return true
256+ }
229257 }
230258 return element.manager.areElementsEquivalent(res, other) || super .isReferenceTo(other)
231259 }
0 commit comments