|  | 
| 1 | 1 | package org.utbot.cpp.clion.plugin | 
| 2 | 2 | 
 | 
| 3 | 3 | import com.intellij.ide.util.RunOnceUtil | 
|  | 4 | +import com.intellij.openapi.components.service | 
| 4 | 5 | import com.intellij.openapi.project.Project | 
| 5 | 6 | import com.intellij.openapi.startup.StartupActivity | 
| 6 | 7 | import org.utbot.cpp.clion.plugin.client.Client | 
| 7 | 8 | import org.utbot.cpp.clion.plugin.client.ClientManager | 
| 8 | 9 | import org.utbot.cpp.clion.plugin.settings.pluginSettings | 
| 9 | 10 | import org.utbot.cpp.clion.plugin.settings.settings | 
| 10 | 11 | import org.utbot.cpp.clion.plugin.ui.wizard.UTBotWizard | 
| 11 |  | -import org.utbot.cpp.clion.plugin.utils.getCurrentClient | 
| 12 | 12 | import org.utbot.cpp.clion.plugin.utils.invokeOnEdt | 
| 13 | 13 | 
 | 
| 14 | 14 | class UTBotStartupActivity : StartupActivity { | 
| 15 | 15 |     override fun runActivity(project: Project) { | 
| 16 |  | -        // we initialize Client here, so that initialization will not happen when user issues first | 
| 17 |  | -        // generation request which would cause a UI freeze | 
|  | 16 | +        // We initialize Client here, so that initialization will not happen | 
|  | 17 | +        // when user issues first generation request which would cause a UI freeze. | 
| 18 | 18 |         initializeClient(project) | 
| 19 | 19 |         guessPathsOnFirstOpen(project) | 
| 20 | 20 |         showWizardOnFirstOpen(project) | 
| 21 | 21 |     } | 
| 22 | 22 | 
 | 
| 23 | 23 |     // Here we address the service ClientManager for the first time so that it | 
| 24 | 24 |     // will be initialized by the ide and Client will be created. | 
| 25 |  | -    // Client in turn will create a grpc channel and start heartbeating the server | 
|  | 25 | +    // Client in turn will create a grpc channel and start heart-beating the server. | 
| 26 | 26 |     private fun initializeClient(project: Project) = project.service<ClientManager>() | 
| 27 | 27 | 
 | 
| 28 | 28 | 
 | 
|  | 
0 commit comments