Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Add version list to get human-readable version ids
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Jul 14, 2020
1 parent ed48e0d commit 28344d4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import org.jetbrains.projector.common.protocol.data.Point
import org.jetbrains.projector.common.protocol.handshake.COMMON_VERSION
import org.jetbrains.projector.common.protocol.handshake.ToClientHandshakeFailureEvent
import org.jetbrains.projector.common.protocol.handshake.ToClientHandshakeSuccessEvent
import org.jetbrains.projector.common.protocol.handshake.commonVersionList
import org.jetbrains.projector.common.protocol.toClient.*
import org.jetbrains.projector.common.protocol.toServer.*
import org.jetbrains.projector.server.idea.*
Expand Down Expand Up @@ -420,7 +421,10 @@ class ProjectorServer private constructor(
}

if (toServerHandshakeEvent.commonVersion != COMMON_VERSION) {
sendHandshakeFailureEvent("Incompatible common versions: server - $COMMON_VERSION, client - ${toServerHandshakeEvent.commonVersion}")
val reason =
"Incompatible common protocol versions: server - $COMMON_VERSION (#${commonVersionList.indexOf(COMMON_VERSION)}), " +
"client - ${toServerHandshakeEvent.commonVersion} (#${toServerHandshakeEvent.commonVersionId})"
sendHandshakeFailureEvent(reason)

return
}
Expand Down

0 comments on commit 28344d4

Please sign in to comment.