What is "Extentions" and "Database Tools and SQL" in "Scratches and Consoles" section of the project view?

Answered

Is this auto-generated or user added?

Can I remove this?

1 comment
Comment actions Permalink

Hello,

"Extensions" folder is for scripts used in different plugins and subsystems. The scripts for the "Database Tools and SQL" are there by default. Unfortunately, there is no way to configure it in settings, however, if you really want to hide it, you can use the following custom script:

Select "Extensions" node -> New -> File -> enter "com.intellij/startup/hide-extensions-node.groovy", paste the script text, restart.

If you want to return "Extensions", you can then delete the script from %pycharm.config.dir%/extensions/com.intellij

The script:

import java.util.*
import com.intellij.ide.util.treeView.*
import com.intellij.ide.projectView.*
import com.intellij.openapi.project.*

IDE.application.messageBus.connect().subscribe(ProjectManager.TOPIC, new ProjectManagerListener() {
  void projectOpened(Project project) { removeExtensionNode(project) }
})
ProjectManager.getInstance().getOpenProjects().each {removeExtensionNode(it) }

void removeExtensionNode(Project project) {
  TreeStructureProvider.EP.getPoint(project).registerExtension(new TreeStructureProvider() {
    Collection modify(AbstractTreeNode parent, Collection children, ViewSettings settings) {
      if (parent.getValue().equals("Scratches and Consoles")) {
        children.removeIf { it.getValue() instanceof com.intellij.ide.extensionResources.ExtensionsRootType }
      }
      return children
    }
  })
}
0

Please sign in to leave a comment.