in src/main/kotlin/com/pestphp/pest/features/customExpectations/symbols/PestCustomExpectationReference.kt [20:37]
override fun resolveReference(): Collection<Symbol?> {
val pestCustomExtensions = mutableListOf<PestCustomExpectationSymbol>()
methodReference.name?.let {
val extensionName = methodReference.name!!
FileBasedIndex.getInstance()
.processValues(KEY, extensionName, null, { file, value ->
methodReference.manager.findFile(file)?.let { psiFile ->
val range = TextRange.from(value.first(), extensionName.length)
val element = psiFile.findElementAt(range.startOffset)
PhpPsiUtil.getParentOfClass(element, MethodReference::class.java)?.toMethod()?.let {
pestCustomExtensions.add(PestCustomExpectationSymbol(extensionName, psiFile, range, it))
}
}
true
}, GlobalSearchScope.allScope(methodReference.project))
}
return pestCustomExtensions
}