Skip to content

Commit

Permalink
Fix #527
Browse files Browse the repository at this point in the history
  • Loading branch information
alex999990009 committed Jul 5, 2024
1 parent 67aeb20 commit fcb2306
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/main/kotlin/org/arend/codeInsight/ArendLineMarkerProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ import com.intellij.codeInsight.daemon.LineMarkerInfo
import com.intellij.codeInsight.daemon.LineMarkerProviderDescriptor
import com.intellij.codeInsight.daemon.impl.LineMarkerNavigator
import com.intellij.codeInsight.daemon.impl.MarkerType
import com.intellij.codeInsight.daemon.impl.PsiElementListNavigator
import com.intellij.codeInsight.navigation.BackgroundUpdaterTask
import com.intellij.codeInsight.navigation.PsiTargetNavigator
import com.intellij.icons.AllIcons
import com.intellij.ide.util.PsiElementListCellRenderer
import com.intellij.openapi.components.service
import com.intellij.openapi.editor.markup.GutterIconRenderer
import com.intellij.openapi.progress.ProgressManager
import com.intellij.psi.PsiElement
import org.arend.psi.ext.ArendDefClass
import org.arend.psi.ext.ArendDefIdentifier
import org.arend.psi.ext.ArendDefinition
import org.arend.search.ClassDescendantsSearch
import org.arend.util.FullName
import java.awt.event.MouseEvent

class ArendLineMarkerProvider: LineMarkerProviderDescriptor() {
Expand Down Expand Up @@ -45,20 +41,8 @@ class ArendLineMarkerProvider: LineMarkerProviderDescriptor() {
object : LineMarkerNavigator() {
override fun browse(e: MouseEvent, element: PsiElement) {
val clazz = element.parent.parent as? ArendDefClass ?: return
PsiElementListNavigator.openTargets(e, clazz.project.service<ClassDescendantsSearch>().getAllDescendants(clazz).toTypedArray(), "Subclasses of " + clazz.name,
CodeInsightBundle.message("goto.implementation.findUsages.title", clazz.refName), MyListCellRenderer, null as BackgroundUpdaterTask?)
PsiTargetNavigator(clazz.project.service<ClassDescendantsSearch>().getAllDescendants(clazz).toTypedArray()).navigate(e, "Subclasses of " + clazz.name, element.project)
}
})
}

private object MyListCellRenderer : PsiElementListCellRenderer<ArendDefinition<*>>() {
override fun getElementText(element: ArendDefinition<*>): String {
val fullName = FullName(element)
return fullName.longName.toString() + " in " + fullName.modulePath.toString()
}

override fun getContainerText(element: ArendDefinition<*>, name: String): String? = null

override fun getIconFlags() = 0
}
}
}

0 comments on commit fcb2306

Please sign in to comment.