Remove local declarations from Project View model
This commit is contained in:
@@ -23,38 +23,7 @@ internal class KtDeclarationTreeNode(
|
||||
|
||||
override fun extractPsiFromValue(): PsiElement? = value
|
||||
|
||||
override fun getChildrenImpl(): Collection<AbstractTreeNode<*>> {
|
||||
val settings = settings
|
||||
val project = project
|
||||
|
||||
if (!settings.isShowMembers) return emptyList()
|
||||
val declaration = value ?: return emptyList()
|
||||
|
||||
val result = mutableListOf<AbstractTreeNode<*>>()
|
||||
declaration.acceptChildren(object : KtTreeVisitorVoid() {
|
||||
override fun visitClassOrObject(classOrObject: KtClassOrObject) {
|
||||
result.add(
|
||||
KtClassOrObjectTreeNode(
|
||||
project = project,
|
||||
ktClassOrObject = classOrObject,
|
||||
viewSettings = settings
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun visitNamedFunction(function: KtNamedFunction) {
|
||||
result.add(
|
||||
KtDeclarationTreeNode(
|
||||
project = project,
|
||||
ktDeclaration = function,
|
||||
viewSettings = settings
|
||||
)
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
override fun getChildrenImpl(): Collection<AbstractTreeNode<*>> = emptyList()
|
||||
|
||||
override fun updateImpl(data: PresentationData) {
|
||||
val declaration = value ?: return
|
||||
@@ -62,8 +31,6 @@ internal class KtDeclarationTreeNode(
|
||||
data.presentableText = tryGetRepresentableText(declaration, project)
|
||||
}
|
||||
|
||||
override fun expandOnDoubleClick(): Boolean = false
|
||||
|
||||
override fun isDeprecated(): Boolean = value?.let { KtPsiUtil.isDeprecated(it) } ?: false
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user