Skip to content

Commit efab02d

Browse files
committed
some lookups/completions did not work anymore
1 parent 53ed604 commit efab02d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Changelog
44
===============================================================================
5+
## 2022.2.17
6+
- fix: some lookups/completions did not work anymore
7+
58
## 2022.2.16
69
- fix: need to notify glint about ts/js files
710

src/main/kotlin/com/emberjs/hbs/HbsLocalReference.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,8 @@ class HbsLocalReference(private val leaf: PsiElement, val target: PsiElement?) :
399399
return referenceBlocks(element, name)
400400
?: resolveToLocalJs(element)
401401
?: let {
402-
val psiFile = PsiManager.getInstance(element.project).findFile(element.originalVirtualFile!!)
403-
val document = PsiDocumentManager.getInstance(element.project).getDocument(psiFile!!)!!
404-
HbsLocalReference(element,
405-
GlintLanguageServiceProvider(element.project).getService(element.originalVirtualFile!!)
406-
?.getNavigationFor(document, element)?.firstOrNull()?.parent
407-
)
402+
val resolved = service?.getNavigationFor(document, element)?.firstOrNull()?.parent
403+
resolved?.let { HbsLocalReference(element, it) }
408404
}
409405
}
410406
}

0 commit comments

Comments
 (0)