Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/kotlin/com/emberjs/utils/EmberUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,16 @@ class EmberUtils {
val TS = JavaScriptSupportLoader.TYPESCRIPT

val inJs = view.findElementAt(element.startOffset, TS) ?: view.findElementAt(element.startOffset, JS)
cls = PsiTreeUtil.findFirstParent(inJs) { it is JSClass } as JSElement?
cls = inJs?.parent as? JSClass
if (cls == null) {
cls = inJs?.parent?.children?.last() as? TypeScriptVariable
if (cls != null) {
return cls
}
cls = inJs?.prevSibling?.children?.last() as? TypeScriptVariable
if (cls != null) {
return cls
}
}
if (cls == null) {
cls = (inJs?.parent as? TypeScriptAsExpression)
Expand Down
Loading