From 98ea3d54fec667cf4d843ad299afe8a43b765e93 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Tue, 22 Oct 2024 21:09:42 +0200 Subject: [PATCH] PY-75909: Expand project view right after new project creation. Platform expands project view automatically once `generateProject` returns but only if it isn't empty. As we generate things in background (see `.launch`) nothing is expanded. So we expand it explicitly 2 times: when SDK is generated and when project is generated. At least one of these actions must create files which is required to expand the tree. This code can't be tested because there is no project view tree in a headless mode. (cherry picked from commit 2390d09619639e8ff8d8906a4e0a284cf24da5ba) KT-MR-18605 GitOrigin-RevId: 115034e348c029ea751072caacf4220d121bc220 --- .../newProjectWizard/PyV3ProjectBaseGenerator.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/src/com/jetbrains/python/newProjectWizard/PyV3ProjectBaseGenerator.kt b/python/src/com/jetbrains/python/newProjectWizard/PyV3ProjectBaseGenerator.kt index 1999ec4eaadb..a40642da3fd6 100644 --- a/python/src/com/jetbrains/python/newProjectWizard/PyV3ProjectBaseGenerator.kt +++ b/python/src/com/jetbrains/python/newProjectWizard/PyV3ProjectBaseGenerator.kt @@ -2,6 +2,7 @@ package com.jetbrains.python.newProjectWizard import com.intellij.facet.ui.ValidationResult +import com.intellij.ide.projectView.impl.AbstractProjectViewPane import com.intellij.openapi.application.EDT import com.intellij.openapi.components.Service import com.intellij.openapi.components.service @@ -51,10 +52,19 @@ abstract class PyV3ProjectBaseGenerator pane.tree }.expandRow(0) + } + override fun createPeer(): ProjectGeneratorPeer = PyV3GeneratorPeer(baseSettings, typeSpecificUI?.let { Pair(it, typeSpecificSettings) }, allowedInterpreterTypes)