From 53981ce673d8b0a3d0440fbe0bf2f5ce82f10f28 Mon Sep 17 00:00:00 2001 From: "Ivan.Yarkov" Date: Tue, 25 Nov 2025 15:24:43 +0100 Subject: [PATCH] Revert "RIDER-131796 open an editor and wait for rider-specific activities in perforator tests" This reverts commit 4b11077471ebf1d611a1e4833374d9910b34f4b5. (cherry picked from commit 35146f234fdf8aa0c8bd73529316784b3d1b5529) IJ-MR-183553 GitOrigin-RevId: e2d90e5113a958fbf796b576159125ecc8a9318e --- .../commands/OpenFileCommand.kt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt index ab279215145b..55ab031516d6 100644 --- a/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt +++ b/plugins/performanceTesting/core/src/com/jetbrains/performancePlugin/commands/OpenFileCommand.kt @@ -5,7 +5,6 @@ import com.intellij.ide.impl.ProjectUtil import com.intellij.openapi.application.EDT import com.intellij.openapi.components.service import com.intellij.openapi.components.serviceAsync -import com.intellij.openapi.fileEditor.FileEditorComposite import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx import com.intellij.openapi.fileEditor.impl.FileEditorOpenOptions @@ -37,7 +36,7 @@ import kotlin.time.Duration.Companion.seconds * Command opens file. * Example: %openFile -file [-suppressErrors] [-timeout ] [WARMUP] [-disableCodeAnalysis(-dsa) by default false] */ -open class OpenFileCommand(text: String, line: Int) : PerformanceCommandCoroutineAdapter(text, line) { +class OpenFileCommand(text: String, line: Int) : PerformanceCommandCoroutineAdapter(text, line) { companion object { const val NAME: @NonNls String = "openFile" const val PREFIX: @NonNls String = "$CMD_PREFIX$NAME" @@ -59,11 +58,11 @@ open class OpenFileCommand(text: String, line: Int) : PerformanceCommandCoroutin }.getOrNull() } } - + override fun getName(): String = NAME override suspend fun doExecute(context: PlaybackContext) { - val arguments = extractCommandArgument(prefix) + val arguments = extractCommandArgument(PREFIX) val options = getOptions(arguments) val filePath = (options?.file ?: text.split(' ', limit = 4)[1]).replace("SPACE_SYMBOL", " ") val timeout = options?.timeout ?: 0 @@ -101,7 +100,8 @@ open class OpenFileCommand(text: String, line: Int) : PerformanceCommandCoroutin openFileSpan = startSpan(OPEN_FILE_SPAN_NAME).setAttribute("path", file.path) } - val fileEditor = openEditor(project, file) + val fileEditor = (project.serviceAsync() as FileEditorManagerEx) + .openFile(file = file, options = FileEditorOpenOptions(requestFocus = true)) if (useWaitForCodeAnalysisCode(options)) { HighlightingTestUtil.waitForAnalysisWithNewApproach(project, spanRef, timeout, suppressErrors) @@ -123,12 +123,6 @@ open class OpenFileCommand(text: String, line: Int) : PerformanceCommandCoroutin } } - protected open suspend fun openEditor( - project: Project, - file: VirtualFile, - ): FileEditorComposite = (project.serviceAsync() as FileEditorManagerEx) - .openFile(file = file, options = FileEditorOpenOptions(requestFocus = true)) - private fun useWaitForCodeAnalysisCode(options: OpenFileCommandOptions?): Boolean = options != null && !options.disableCodeAnalysis && options.useNewWaitForCodeAnalysisCode