diff --git a/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt b/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt index e3b4d05a2e2e..3bdc2c92f47e 100644 --- a/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt +++ b/plugins/performanceTesting/commands-model/src/com/intellij/tools/ide/performanceTesting/commands/generalCommandChain.kt @@ -1005,4 +1005,8 @@ fun T.repeatCommand(times: Int, commandChain: (CommandChain) fun T.createScratchFile(filename: String, content: String): T = apply { val modifiedContent = content.replace("\n", "\\n").replace(" ", "_") addCommand("${CMD_PREFIX}createScratchFile $filename $modifiedContent") +} + +fun T.disableKotlinNotification(): T = apply { + addCommand("${CMD_PREFIX}disableKotlinNotification") } \ No newline at end of file diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/BaseCommandProvider.java b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/BaseCommandProvider.java index 2ca816a5e846..83ab1263a80c 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/BaseCommandProvider.java +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/BaseCommandProvider.java @@ -109,7 +109,8 @@ public final class BaseCommandProvider implements CommandProvider { Map.entry(WaitForEDTQueueUnstuckCommand.PREFIX, WaitForEDTQueueUnstuckCommand::new), Map.entry(CreateScratchFile.PREFIX, CreateScratchFile::new), Map.entry(StoreHighlightingResultsCommand.PREFIX, StoreHighlightingResultsCommand::new), - Map.entry(AddContentRootToModule.PREFIX, AddContentRootToModule::new) + Map.entry(AddContentRootToModule.PREFIX, AddContentRootToModule::new), + Map.entry(DisableKotlinNotificationCommand.PREFIX, DisableKotlinNotificationCommand::new) ); } } diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/DisableKotlinNotificationCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/DisableKotlinNotificationCommand.kt new file mode 100644 index 000000000000..4624c0fdfc61 --- /dev/null +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/DisableKotlinNotificationCommand.kt @@ -0,0 +1,22 @@ +package com.jetbrains.performancePlugin.commands + +import com.intellij.ide.util.PropertiesComponent +import com.intellij.openapi.ui.playback.PlaybackContext + +private const val NOTIFICATION_PROPERTIES_KEY = "kotlin.code.style.migration.dialog.show.count" + +class DisableKotlinNotificationCommand(text: String, line: Int) : PerformanceCommandCoroutineAdapter(text, line) { + companion object { + const val NAME: String = "disableKotlinNotification" + const val PREFIX: String = CMD_PREFIX + NAME + } + + override suspend fun doExecute(context: PlaybackContext) { + PropertiesComponent.getInstance().setValue(NOTIFICATION_PROPERTIES_KEY, Integer.MAX_VALUE, 0) + } + + override fun getName(): String { + return NAME + } +} +