mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
ABT-26: Enable Misc project for everyone
GitOrigin-RevId: a1f2dd0e20564ea88a93d9124124f12b751b33cb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f14069c14b
commit
d379d00522
@@ -19,7 +19,6 @@
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<refactoring.elementListenerProvider implementation="com.intellij.pycharm.community.ide.impl.miscProject.impl.MiscProjectListenerProvider"/>
|
||||
<statistics.counterUsagesCollector implementationClass="com.intellij.pycharm.community.ide.impl.miscProject.impl.MiscProjectUsageCollector"/>
|
||||
<experiment.abExperimentOption implementation="com.intellij.pycharm.community.ide.impl.miscProject.impl.PyMiscProjectExperimentOption"/>
|
||||
<registryKey defaultValue="5" description="Number of primary buttons on welcome screen (other go to 'more actions')"
|
||||
key="welcome.screen.primaryButtonsCount" restartRequired="true" overrides="true"/>
|
||||
<applicationInitializedListener implementation="com.intellij.pycharm.community.ide.impl.PyCharmCorePluginConfigurator"/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.pycharm.community.ide.impl.miscProject.impl
|
||||
|
||||
import com.intellij.psi.PsiDirectory
|
||||
@@ -12,7 +12,6 @@ import kotlin.io.path.name
|
||||
*/
|
||||
internal class MiscProjectListenerProvider : RefactoringElementListenerProvider {
|
||||
override fun getListener(element: PsiElement): RefactoringElementListener? {
|
||||
if (!miscProjectEnabled.value) return null
|
||||
val dir = (element as? PsiDirectory) ?: return null
|
||||
// dir name is enough
|
||||
return if (dir.name == miscProjectDefaultPath.value.name) MiscProjectRenameReporter else null
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.pycharm.community.ide.impl.miscProject.impl
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionGroup
|
||||
@@ -10,16 +10,13 @@ import com.intellij.pycharm.community.ide.impl.miscProject.MiscFileType
|
||||
internal class PyMiscFileActionGroup : ActionGroup() {
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
e.presentation.isEnabledAndVisible = miscProjectEnabled.value
|
||||
e.presentation.isEnabledAndVisible = true
|
||||
}
|
||||
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
|
||||
|
||||
private val actions = lazy {
|
||||
if (miscProjectEnabled.value)
|
||||
(MiscFileType.EP.extensionList + listOf(MiscScriptFileType)).map { PyMiscFileAction(it) }.toTypedArray()
|
||||
else
|
||||
emptyArray()
|
||||
(MiscFileType.EP.extensionList + listOf(MiscScriptFileType)).map { PyMiscFileAction(it) }.toTypedArray()
|
||||
}
|
||||
|
||||
override fun getChildren(e: AnActionEvent?): Array<out AnAction> = actions.value
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.pycharm.community.ide.impl.miscProject.impl
|
||||
|
||||
import com.intellij.platform.experiment.ab.impl.experiment.ABExperimentOption
|
||||
import com.intellij.platform.experiment.ab.impl.experiment.ABExperimentOptionId
|
||||
import com.intellij.platform.experiment.ab.impl.option.ABExperimentOptionGroupSize
|
||||
|
||||
/**
|
||||
* A/B testing option for misc pycharm project
|
||||
*/
|
||||
internal class PyMiscProjectExperimentOption : ABExperimentOption {
|
||||
override val id: ABExperimentOptionId = ABExperimentOptionId("pycharm.miscProject")
|
||||
|
||||
override fun getGroupSizeForIde(isPopularIde: Boolean): ABExperimentOptionGroupSize = ABExperimentOptionGroupSize(128) // half: 256/2
|
||||
|
||||
override fun checkIdeIsSuitable(): Boolean = true // This module only goes to PyCharm
|
||||
|
||||
override fun checkIdeVersionIsSuitable(): Boolean = true
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.projectRoots.ProjectJdkTable
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
import com.intellij.openapi.vfs.VfsUtil
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.platform.experiment.ab.impl.experiment.ABExperiment
|
||||
import com.intellij.platform.ide.progress.ModalTaskOwner
|
||||
import com.intellij.platform.ide.progress.TaskCancellation
|
||||
import com.intellij.platform.ide.progress.runWithModalProgressBlocking
|
||||
@@ -53,7 +52,6 @@ import kotlin.time.Duration.Companion.milliseconds
|
||||
private val logger = fileLogger()
|
||||
|
||||
internal val miscProjectDefaultPath: Lazy<Path> = lazy { Path.of(SystemProperties.getUserHome()).resolve("PyCharmMiscProject") }
|
||||
internal val miscProjectEnabled: Lazy<Boolean> = lazy { ABExperiment.getABExperimentInstance().isExperimentOptionEnabled(PyMiscProjectExperimentOption::class.java) }
|
||||
|
||||
/**
|
||||
* Creates a project in [projectPath] in a modal window.
|
||||
|
||||
Reference in New Issue
Block a user