Skip to content

Commit 77ffa63

Browse files
authored
Connection settings change in one project enables plugin for another project (#515)
1 parent 6bffa2e commit 77ffa63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clion-plugin/src/main/kotlin/org/utbot/cpp/clion/plugin/client/ManagedClient.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ class ManagedClient(val project: Project) : Disposable {
5757
})
5858
subscribe(ConnectionSettingsListener.TOPIC, object : ConnectionSettingsListener {
5959
override fun connectionSettingsChanged(newPort: Int, newServerName: String) {
60+
// Connection settings are global for all projects, so when they are changed in one project
61+
// we should not start the client
62+
if (!project.settings.storedSettings.isPluginEnabled)
63+
return
6064
if (newPort != client?.port || newServerName != client?.serverName) {
6165
project.logger.trace { "Connection settings changed. Setting up new client." }
6266
client?.dispose()

0 commit comments

Comments
 (0)