<commit_before>package org.rust.lang.structure

import com.intellij.ide.structureView.impl.common.PsiTreeElementBase
import com.intellij.psi.PsiElement
import org.rust.lang.core.psi.*
import org.rust.lang.core.psi.impl.RustFileImpl

class RustFileTreeElement(file: RustFileImpl) : PsiTreeElementBase<RustFileImpl>(file) {
    override fun getPresentableText(): String? = element?.name


    override fun getChildrenBase(): Collection<RustStructureViewElement> {
        val result = arrayListOf<RustStructureViewElement>()
        element?.accept(object : RustVisitor() {
            override fun visitElement(o: PsiElement) {
                o.acceptChildren(this)
            }

            override fun visitEnumItem(o: RustEnumItem) {
                result += (RustStructureViewElement(o))
            }

            override fun visitStructItem(o: RustStructItem) {
                result += (RustStructureViewElement(o))
            }

            override fun visitFnItem(o: RustFnItem) {
                result += (RustStructureViewElement(o))
            }

            override fun visitImplMethod(o: RustImplMethod) {
                result += (RustStructureViewElement(o))
            }
        })
        return result;
    }
}<commit_msg>FileTreeElement: Generalize getChildrenBase() return type<commit_after>package org.rust.lang.structure

import com.intellij.ide.structureView.StructureViewTreeElement
import com.intellij.ide.structureView.impl.common.PsiTreeElementBase
import com.intellij.psi.PsiElement
import org.rust.lang.core.psi.*
import org.rust.lang.core.psi.impl.RustFileImpl

class RustFileTreeElement(file: RustFileImpl) : PsiTreeElementBase<RustFileImpl>(file) {
    override fun getPresentableText(): String? = element?.name


    override fun getChildrenBase(): Collection<StructureViewTreeElement> {
        val result = arrayListOf<StructureViewTreeElement>()
        element?.accept(object : RustVisitor() {
            override fun visitElement(o: PsiElement) {
                o.acceptChildren(this)
            }

            override fun visitEnumItem(o: RustEnumItem) {
                result += (RustStructureViewElement(o))
            }

            override fun visitStructItem(o: RustStructItem) {
                result += (RustStructureViewElement(o))
            }

            override fun visitFnItem(o: RustFnItem) {
                result += (RustStructureViewElement(o))
            }

            override fun visitImplMethod(o: RustImplMethod) {
                result += (RustStructureViewElement(o))
            }
        })
        return result;
    }
}
{'fraction_non_alphanumeric': 0.09299655568312284, 'fraction_numerical': 0.0, 'mean_word_length': 2.575923392612859, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4734210', 'n_tokens_mistral': 725, 'n_tokens_neox': 687, 'n_words': 124}