Cleanup NetworkChannel

This commit is contained in:
Dale Wijnand 2018-03-12 17:49:43 +00:00
parent 933668076a
commit 6ceed00f48
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
3 changed files with 9 additions and 12 deletions

View File

@ -451,9 +451,12 @@ lazy val mainProj = (project in file("main"))
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
mimaSettings,
mimaBinaryIssueFilters ++= Vector(
// Changed signature or removed something in the internal pacakge
// Changed signature or removed something in the internal package
exclude[DirectMissingMethodProblem]("sbt.internal.*"),
// Made something final in the internal package
exclude[FinalClassProblem]("sbt.internal.*"),
// New and changed methods on KeyIndex. internal.
exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"),

View File

@ -20,7 +20,8 @@ import sbt.internal.langserver._
import sbt.internal.util.ObjectEvent
import sbt.util.Logger
private[sbt] case class LangServerError(code: Long, message: String) extends Throwable(message)
private[sbt] final case class LangServerError(code: Long, message: String)
extends Throwable(message)
private[sbt] object LanguageServerProtocol {
lazy val internalJsonProtocol = new InitializeOptionFormats with sjsonnew.BasicJsonProtocol {}

View File

@ -46,18 +46,12 @@ final class NetworkChannel(val name: String,
private val VsCodeOld = "application/vscode-jsonrpc; charset=utf8"
private lazy val jsonFormat = new sjsonnew.BasicJsonProtocol with JValueFormats {}
def setContentType(ct: String): Unit = synchronized {
_contentType = ct
}
def setContentType(ct: String): Unit = synchronized { _contentType = ct }
def contentType: String = _contentType
protected def authenticate(token: String): Boolean = {
instance.authenticate(token)
}
protected def authenticate(token: String): Boolean = instance.authenticate(token)
protected def setInitialized(value: Boolean): Unit = {
initialized = value
}
protected def setInitialized(value: Boolean): Unit = initialized = value
protected def authOptions: Set[ServerAuthentication] = auth
@ -74,7 +68,6 @@ final class NetworkChannel(val name: String,
var bytesRead = 0
def resetChannelState(): Unit = {
contentLength = 0
// contentType = ""
state = SingleLine
}
def tillEndOfLine: Option[Vector[Byte]] = {