From 2f2e9c1a960cb8b5e43cb3f70a581fbe5b784dc9 Mon Sep 17 00:00:00 2001 From: "Ilya.Usov" Date: Fri, 30 Aug 2024 19:30:38 +0200 Subject: [PATCH] Use appStarted instead of beforeApplicationStarted Use StartUpMeasurer.getStartTime as the start point for reportApplicationLoaded Measure indexes are ready Load solution asynchronously without modal progress (as it works in real life) Convert shellhost into a service + listener Add editBackendSettingsSuspending + use the suspend version in perforator Refactor PerformancePlugin logic to coroutines Increment some metrics after changes the way we open a solution and calculate ApplicationLoad and BackendShellLoad GitOrigin-RevId: 6c691c86209fb67ef4767d0e7432735a44e19e17 --- .../rider/plugins/fsharp/test/Extensions.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/rider-fsharp/src/test/kotlin/com/jetbrains/rider/plugins/fsharp/test/Extensions.kt b/rider-fsharp/src/test/kotlin/com/jetbrains/rider/plugins/fsharp/test/Extensions.kt index c4f3a429f5..42e723fd16 100644 --- a/rider-fsharp/src/test/kotlin/com/jetbrains/rider/plugins/fsharp/test/Extensions.kt +++ b/rider-fsharp/src/test/kotlin/com/jetbrains/rider/plugins/fsharp/test/Extensions.kt @@ -4,23 +4,22 @@ import com.intellij.execution.configurations.GeneralCommandLine import com.intellij.execution.process.CapturingProcessHandler import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.project.Project -import com.intellij.openapi.util.SystemInfo import com.intellij.openapi.vfs.LocalFileSystem -import com.jetbrains.rider.protocol.IProtocolHost -import com.jetbrains.rider.protocol.protocolHost -import com.jetbrains.rdclient.util.idea.callSynchronously -import com.jetbrains.rider.RiderEnvironment import com.jetbrains.rider.plugins.fsharp.rdFSharpModel import com.jetbrains.rider.projectView.solution +import com.jetbrains.rider.protocol.IProtocolHost +import com.jetbrains.rider.protocol.protocolHost import com.jetbrains.rider.settings.RiderSettingMaintenanceController import com.jetbrains.rider.test.base.BaseTestWithSolution import com.jetbrains.rider.test.framework.frameworkLogger import com.jetbrains.rider.test.framework.waitBackend import com.jetbrains.rider.test.scriptingApi.BackendSettingsEditorBase import com.jetbrains.rider.test.scriptingApi.dumpSevereHighlighters -import com.jetbrains.rider.test.scriptingApi.editBackendSettings +import com.jetbrains.rider.test.scriptingApi.editBackendSettingsSuspending +import com.jetbrains.rider.test.scriptingApi.runBlockingWithFlushing import java.io.PrintStream import java.nio.file.Path +import kotlin.time.Duration.Companion.minutes fun com.intellij.openapi.editor.Editor.dumpTypeProviders(stream: PrintStream) { with(stream) { @@ -105,11 +104,13 @@ fun flushFileChanges(project: Project) { val Project.fcsHost get() = this.solution.rdFSharpModel.fsharpTestHost -class FsharpBackendSettingsEditor(host: IProtocolHost) : BackendSettingsEditorBase(host) { +class FsharpBackendSettingsEditor(host: IProtocolHost) : BackendSettingsEditorBase(host.session) { var dotnetCliHomeEnvVar by StringEnvVar("DOTNET_CLI_HOME") } fun editFSharpBackendSettings(host: IProtocolHost, action: FsharpBackendSettingsEditor.() -> Unit) = - editBackendSettings(FsharpBackendSettingsEditor(host), action) + runBlockingWithFlushing("editFSharpBackendSettings", 1.minutes) { + editBackendSettingsSuspending(FsharpBackendSettingsEditor(host), action) + }