in intellij/src/main/kotlin/motif/intellij/MotifService.kt [154:166]
fun onSelectedAncestorScope(element: PsiElement) {
if (element !is PsiClass) {
return
}
val toolWindow: ToolWindow =
ToolWindowManager.getInstance(project).getToolWindow(TOOL_WINDOW_ID) ?: return
if (findContentByDescription(toolWindow, TAB_NAME_ANCESTOR) == null) {
ancestorContent = createAncestorContent(toolWindow)
}
ancestorPanel?.setSelectedScope(element)
ancestorContent?.displayName = TAB_NAME_ANCESTOR_OF.format(element.name)
ancestorContent?.let { toolWindow.contentManager.setSelectedContent(it) }
}