Skip to content

Commit 1d9cec9

Browse files
authored
fix some toc resolution (#275)
1 parent 968e8f8 commit 1d9cec9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/kotlin/com/emberjs/utils/EmberUtils.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,16 @@ class EmberUtils {
263263
val TS = JavaScriptSupportLoader.TYPESCRIPT
264264

265265
val inJs = view.findElementAt(element.startOffset, TS) ?: view.findElementAt(element.startOffset, JS)
266-
cls = PsiTreeUtil.findFirstParent(inJs) { it is JSClass } as JSElement?
266+
cls = inJs?.parent as? JSClass
267267
if (cls == null) {
268268
cls = inJs?.parent?.children?.last() as? TypeScriptVariable
269269
if (cls != null) {
270270
return cls
271271
}
272+
cls = inJs?.prevSibling?.children?.last() as? TypeScriptVariable
273+
if (cls != null) {
274+
return cls
275+
}
272276
}
273277
if (cls == null) {
274278
cls = (inJs?.parent as? TypeScriptAsExpression)

0 commit comments

Comments
 (0)