mirror of https://github.com/sbt/sbt.git
Cleanup NetworkChannel
This commit is contained in:
parent
933668076a
commit
6ceed00f48
|
|
@ -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.*"),
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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]] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue