Merge pull request #4018 from dwijnand/cleanup/NetworkChannel

Cleanup NetworkChannel
This commit is contained in:
Dale Wijnand 2018-03-20 08:54:04 +00:00 committed by GitHub
commit b23980ce1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
mimaSettings, mimaSettings,
mimaBinaryIssueFilters ++= Vector( mimaBinaryIssueFilters ++= Vector(
// Changed signature or removed something in the internal pacakge // Changed signature or removed something in the internal package
exclude[DirectMissingMethodProblem]("sbt.internal.*"), exclude[DirectMissingMethodProblem]("sbt.internal.*"),
// Made something final in the internal package
exclude[FinalClassProblem]("sbt.internal.*"),
// New and changed methods on KeyIndex. internal. // New and changed methods on KeyIndex. internal.
exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"), exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"),

View File

@ -20,7 +20,8 @@ import sbt.internal.langserver._
import sbt.internal.util.ObjectEvent import sbt.internal.util.ObjectEvent
import sbt.util.Logger 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 { private[sbt] object LanguageServerProtocol {
lazy val internalJsonProtocol = new InitializeOptionFormats with sjsonnew.BasicJsonProtocol {} 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 val VsCodeOld = "application/vscode-jsonrpc; charset=utf8"
private lazy val jsonFormat = new sjsonnew.BasicJsonProtocol with JValueFormats {} private lazy val jsonFormat = new sjsonnew.BasicJsonProtocol with JValueFormats {}
def setContentType(ct: String): Unit = synchronized { def setContentType(ct: String): Unit = synchronized { _contentType = ct }
_contentType = ct
}
def contentType: String = _contentType def contentType: String = _contentType
protected def authenticate(token: String): Boolean = { protected def authenticate(token: String): Boolean = instance.authenticate(token)
instance.authenticate(token)
}
protected def setInitialized(value: Boolean): Unit = { protected def setInitialized(value: Boolean): Unit = initialized = value
initialized = value
}
protected def authOptions: Set[ServerAuthentication] = auth protected def authOptions: Set[ServerAuthentication] = auth
@ -74,7 +68,6 @@ final class NetworkChannel(val name: String,
var bytesRead = 0 var bytesRead = 0
def resetChannelState(): Unit = { def resetChannelState(): Unit = {
contentLength = 0 contentLength = 0
// contentType = ""
state = SingleLine state = SingleLine
} }
def tillEndOfLine: Option[Vector[Byte]] = { def tillEndOfLine: Option[Vector[Byte]] = {