in intellij/src/main/kotlin/motif/intellij/provider/ScopeNavigationLineMarkerProvider.kt [73:105]
override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo<PsiElement>? {
val graph: ResolvedGraph = graph ?: return null
val psiClassElement = element.toPsiClass()
if (psiClassElement is PsiClass && isMotifScopeClass(psiClassElement)) {
val scopeEdges: Array<ScopeEdge>? = getParentScopes(element.project, graph, psiClassElement)
if (scopeEdges?.isNotEmpty() == true) {
val identifier: PsiIdentifier = psiClassElement.nameIdentifier ?: return null
return LineMarkerInfo(
element,
identifier.textRange,
AllIcons.Actions.PreviousOccurence,
UPDATE_ALL,
ConstantFunction<PsiElement, String>(LABEL_NAVIGATE_PARENT_SCOPE),
NavigationScopeHandler(element.project, graph),
LEFT,
)
}
} else {
val methodElement = element.toPsiMethod()
if (isMotifChildScopeMethod(methodElement)) {
return LineMarkerInfo(
element,
element.textRange,
AllIcons.Actions.NextOccurence,
UPDATE_ALL,
ConstantFunction<PsiElement, String>(LABEL_NAVIGATE_CHILD_SCOPE),
NavigationScopeHandler(element.project, graph),
LEFT,
)
}
}
return null
}