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
This commit is contained in:
Ivan.Yarkov
2025-11-25 18:31:52 +00:00
committed by intellij-monorepo-bot
parent 454e426d3a
commit 53981ce673
@@ -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 <filename from the root of the project> [-suppressErrors] [-timeout <in seconds>] [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<FileEditorManager>() 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<FileEditorManager>() as FileEditorManagerEx)
.openFile(file = file, options = FileEditorOpenOptions(requestFocus = true))
private fun useWaitForCodeAnalysisCode(options: OpenFileCommandOptions?): Boolean = options != null
&& !options.disableCodeAnalysis
&& options.useNewWaitForCodeAnalysisCode