mirror of
https://github.com/sbt/sbt.git
synced 2026-09-08 03:09:49 +02:00
replace LSP compiler reporter by BSP one
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp
|
||||
/**
|
||||
* Represents a diagnostic, such as a compiler error or warning.
|
||||
* Diagnostic objects are only valid in the scope of a resource.
|
||||
* @param range The range at which the message applies.
|
||||
* @param severity The diagnostic's severity. Can be omitted. If omitted it is up to the
|
||||
client to interpret diagnostics as error, warning, info or hint.
|
||||
* @param code The diagnostic's code. Can be omitted.
|
||||
* @param source A human-readable string describing the source of this
|
||||
diagnostic, e.g. 'typescript' or 'super lint'.
|
||||
* @param message The diagnostic's message.
|
||||
*/
|
||||
final class Diagnostic private (
|
||||
val range: sbt.internal.bsp.Range,
|
||||
val severity: Option[Long],
|
||||
val code: Option[String],
|
||||
val source: Option[String],
|
||||
val message: String) extends Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: Diagnostic => (this.range == x.range) && (this.severity == x.severity) && (this.code == x.code) && (this.source == x.source) && (this.message == x.message)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (17 + "sbt.internal.bsp.Diagnostic".##) + range.##) + severity.##) + code.##) + source.##) + message.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"Diagnostic(" + range + ", " + severity + ", " + code + ", " + source + ", " + message + ")"
|
||||
}
|
||||
private[this] def copy(range: sbt.internal.bsp.Range = range, severity: Option[Long] = severity, code: Option[String] = code, source: Option[String] = source, message: String = message): Diagnostic = {
|
||||
new Diagnostic(range, severity, code, source, message)
|
||||
}
|
||||
def withRange(range: sbt.internal.bsp.Range): Diagnostic = {
|
||||
copy(range = range)
|
||||
}
|
||||
def withSeverity(severity: Option[Long]): Diagnostic = {
|
||||
copy(severity = severity)
|
||||
}
|
||||
def withSeverity(severity: Long): Diagnostic = {
|
||||
copy(severity = Option(severity))
|
||||
}
|
||||
def withCode(code: Option[String]): Diagnostic = {
|
||||
copy(code = code)
|
||||
}
|
||||
def withCode(code: String): Diagnostic = {
|
||||
copy(code = Option(code))
|
||||
}
|
||||
def withSource(source: Option[String]): Diagnostic = {
|
||||
copy(source = source)
|
||||
}
|
||||
def withSource(source: String): Diagnostic = {
|
||||
copy(source = Option(source))
|
||||
}
|
||||
def withMessage(message: String): Diagnostic = {
|
||||
copy(message = message)
|
||||
}
|
||||
}
|
||||
object Diagnostic {
|
||||
|
||||
def apply(range: sbt.internal.bsp.Range, severity: Option[Long], code: Option[String], source: Option[String], message: String): Diagnostic = new Diagnostic(range, severity, code, source, message)
|
||||
def apply(range: sbt.internal.bsp.Range, severity: Long, code: String, source: String, message: String): Diagnostic = new Diagnostic(range, Option(severity), Option(code), Option(source), message)
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp
|
||||
/**
|
||||
* Position in a text document expressed as zero-based line and zero-based character offset.
|
||||
* A position is between two characters like an 'insert' cursor in a editor.
|
||||
* @param line Line position in a document (zero-based).
|
||||
* @param character Character offset on a line in a document (zero-based).
|
||||
*/
|
||||
final class Position private (
|
||||
val line: Long,
|
||||
val character: Long) extends Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: Position => (this.line == x.line) && (this.character == x.character)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (37 * (17 + "sbt.internal.bsp.Position".##) + line.##) + character.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"Position(" + line + ", " + character + ")"
|
||||
}
|
||||
private[this] def copy(line: Long = line, character: Long = character): Position = {
|
||||
new Position(line, character)
|
||||
}
|
||||
def withLine(line: Long): Position = {
|
||||
copy(line = line)
|
||||
}
|
||||
def withCharacter(character: Long): Position = {
|
||||
copy(character = character)
|
||||
}
|
||||
}
|
||||
object Position {
|
||||
|
||||
def apply(line: Long, character: Long): Position = new Position(line, character)
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp
|
||||
/**
|
||||
* Publish Diagnostics
|
||||
* @param textDocument The document where the diagnostics are published.
|
||||
* @param buildTarget The build target where the diagnostics origin.
|
||||
It is valid for one text to belong to multiple build targets,
|
||||
for example sources that are compiled against multiple platforms (JVM, JavaScript).
|
||||
* @param originId The request id that originated this notification
|
||||
* @param diagnostics The diagnostics to be published by the client
|
||||
* @param reset Whether the client should clear the previous diagnostics
|
||||
mapped to the same `textDocument` and buildTarget
|
||||
*/
|
||||
final class PublishDiagnosticsParams private (
|
||||
val textDocument: sbt.internal.bsp.TextDocumentIdentifier,
|
||||
val buildTarget: sbt.internal.bsp.BuildTargetIdentifier,
|
||||
val originId: Option[String],
|
||||
val diagnostics: Vector[sbt.internal.bsp.Diagnostic],
|
||||
val reset: Boolean) extends Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: PublishDiagnosticsParams => (this.textDocument == x.textDocument) && (this.buildTarget == x.buildTarget) && (this.originId == x.originId) && (this.diagnostics == x.diagnostics) && (this.reset == x.reset)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (17 + "sbt.internal.bsp.PublishDiagnosticsParams".##) + textDocument.##) + buildTarget.##) + originId.##) + diagnostics.##) + reset.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"PublishDiagnosticsParams(" + textDocument + ", " + buildTarget + ", " + originId + ", " + diagnostics + ", " + reset + ")"
|
||||
}
|
||||
private[this] def copy(textDocument: sbt.internal.bsp.TextDocumentIdentifier = textDocument, buildTarget: sbt.internal.bsp.BuildTargetIdentifier = buildTarget, originId: Option[String] = originId, diagnostics: Vector[sbt.internal.bsp.Diagnostic] = diagnostics, reset: Boolean = reset): PublishDiagnosticsParams = {
|
||||
new PublishDiagnosticsParams(textDocument, buildTarget, originId, diagnostics, reset)
|
||||
}
|
||||
def withTextDocument(textDocument: sbt.internal.bsp.TextDocumentIdentifier): PublishDiagnosticsParams = {
|
||||
copy(textDocument = textDocument)
|
||||
}
|
||||
def withBuildTarget(buildTarget: sbt.internal.bsp.BuildTargetIdentifier): PublishDiagnosticsParams = {
|
||||
copy(buildTarget = buildTarget)
|
||||
}
|
||||
def withOriginId(originId: Option[String]): PublishDiagnosticsParams = {
|
||||
copy(originId = originId)
|
||||
}
|
||||
def withOriginId(originId: String): PublishDiagnosticsParams = {
|
||||
copy(originId = Option(originId))
|
||||
}
|
||||
def withDiagnostics(diagnostics: Vector[sbt.internal.bsp.Diagnostic]): PublishDiagnosticsParams = {
|
||||
copy(diagnostics = diagnostics)
|
||||
}
|
||||
def withReset(reset: Boolean): PublishDiagnosticsParams = {
|
||||
copy(reset = reset)
|
||||
}
|
||||
}
|
||||
object PublishDiagnosticsParams {
|
||||
|
||||
def apply(textDocument: sbt.internal.bsp.TextDocumentIdentifier, buildTarget: sbt.internal.bsp.BuildTargetIdentifier, originId: Option[String], diagnostics: Vector[sbt.internal.bsp.Diagnostic], reset: Boolean): PublishDiagnosticsParams = new PublishDiagnosticsParams(textDocument, buildTarget, originId, diagnostics, reset)
|
||||
def apply(textDocument: sbt.internal.bsp.TextDocumentIdentifier, buildTarget: sbt.internal.bsp.BuildTargetIdentifier, originId: String, diagnostics: Vector[sbt.internal.bsp.Diagnostic], reset: Boolean): PublishDiagnosticsParams = new PublishDiagnosticsParams(textDocument, buildTarget, Option(originId), diagnostics, reset)
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp
|
||||
/**
|
||||
* A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor.
|
||||
* Therefore the end position is exclusive.
|
||||
* @param start The range's start position.
|
||||
* @param end The range's end position.
|
||||
*/
|
||||
final class Range private (
|
||||
val start: sbt.internal.bsp.Position,
|
||||
val end: sbt.internal.bsp.Position) extends Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: Range => (this.start == x.start) && (this.end == x.end)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (37 * (17 + "sbt.internal.bsp.Range".##) + start.##) + end.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"Range(" + start + ", " + end + ")"
|
||||
}
|
||||
private[this] def copy(start: sbt.internal.bsp.Position = start, end: sbt.internal.bsp.Position = end): Range = {
|
||||
new Range(start, end)
|
||||
}
|
||||
def withStart(start: sbt.internal.bsp.Position): Range = {
|
||||
copy(start = start)
|
||||
}
|
||||
def withEnd(end: sbt.internal.bsp.Position): Range = {
|
||||
copy(end = end)
|
||||
}
|
||||
}
|
||||
object Range {
|
||||
|
||||
def apply(start: sbt.internal.bsp.Position, end: sbt.internal.bsp.Position): Range = new Range(start, end)
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp
|
||||
/** @param uri The file's Uri */
|
||||
final class TextDocumentIdentifier private (
|
||||
val uri: java.net.URI) extends Serializable {
|
||||
|
||||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: TextDocumentIdentifier => (this.uri == x.uri)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
37 * (37 * (17 + "sbt.internal.bsp.TextDocumentIdentifier".##) + uri.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
"TextDocumentIdentifier(" + uri + ")"
|
||||
}
|
||||
private[this] def copy(uri: java.net.URI = uri): TextDocumentIdentifier = {
|
||||
new TextDocumentIdentifier(uri)
|
||||
}
|
||||
def withUri(uri: java.net.URI): TextDocumentIdentifier = {
|
||||
copy(uri = uri)
|
||||
}
|
||||
}
|
||||
object TextDocumentIdentifier {
|
||||
|
||||
def apply(uri: java.net.URI): TextDocumentIdentifier = new TextDocumentIdentifier(uri)
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp.codec
|
||||
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
||||
trait DiagnosticFormats { self: sbt.internal.bsp.codec.RangeFormats with sjsonnew.BasicJsonProtocol =>
|
||||
implicit lazy val DiagnosticFormat: JsonFormat[sbt.internal.bsp.Diagnostic] = new JsonFormat[sbt.internal.bsp.Diagnostic] {
|
||||
override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.Diagnostic = {
|
||||
__jsOpt match {
|
||||
case Some(__js) =>
|
||||
unbuilder.beginObject(__js)
|
||||
val range = unbuilder.readField[sbt.internal.bsp.Range]("range")
|
||||
val severity = unbuilder.readField[Option[Long]]("severity")
|
||||
val code = unbuilder.readField[Option[String]]("code")
|
||||
val source = unbuilder.readField[Option[String]]("source")
|
||||
val message = unbuilder.readField[String]("message")
|
||||
unbuilder.endObject()
|
||||
sbt.internal.bsp.Diagnostic(range, severity, code, source, message)
|
||||
case None =>
|
||||
deserializationError("Expected JsObject but found None")
|
||||
}
|
||||
}
|
||||
override def write[J](obj: sbt.internal.bsp.Diagnostic, builder: Builder[J]): Unit = {
|
||||
builder.beginObject()
|
||||
builder.addField("range", obj.range)
|
||||
builder.addField("severity", obj.severity)
|
||||
builder.addField("code", obj.code)
|
||||
builder.addField("source", obj.source)
|
||||
builder.addField("message", obj.message)
|
||||
builder.endObject()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,14 @@ trait JsonProtocol extends sjsonnew.BasicJsonProtocol
|
||||
with sbt.internal.util.codec.JValueFormats
|
||||
with sbt.internal.bsp.codec.BuildTargetFormats
|
||||
with sbt.internal.bsp.codec.TaskIdFormats
|
||||
with sbt.internal.bsp.codec.TextDocumentIdentifierFormats
|
||||
with sbt.internal.bsp.codec.PositionFormats
|
||||
with sbt.internal.bsp.codec.RangeFormats
|
||||
with sbt.internal.bsp.codec.DiagnosticFormats
|
||||
with sbt.internal.bsp.codec.BuildClientCapabilitiesFormats
|
||||
with sbt.internal.bsp.codec.InitializeBuildParamsFormats
|
||||
with sbt.internal.bsp.codec.InitializeBuildResultFormats
|
||||
with sbt.internal.bsp.codec.PublishDiagnosticsParamsFormats
|
||||
with sbt.internal.bsp.codec.WorkspaceBuildTargetsResultFormats
|
||||
with sbt.internal.bsp.codec.SourcesParamsFormats
|
||||
with sbt.internal.bsp.codec.SourceItemFormats
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp.codec
|
||||
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
||||
trait PositionFormats { self: sjsonnew.BasicJsonProtocol =>
|
||||
implicit lazy val PositionFormat: JsonFormat[sbt.internal.bsp.Position] = new JsonFormat[sbt.internal.bsp.Position] {
|
||||
override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.Position = {
|
||||
__jsOpt match {
|
||||
case Some(__js) =>
|
||||
unbuilder.beginObject(__js)
|
||||
val line = unbuilder.readField[Long]("line")
|
||||
val character = unbuilder.readField[Long]("character")
|
||||
unbuilder.endObject()
|
||||
sbt.internal.bsp.Position(line, character)
|
||||
case None =>
|
||||
deserializationError("Expected JsObject but found None")
|
||||
}
|
||||
}
|
||||
override def write[J](obj: sbt.internal.bsp.Position, builder: Builder[J]): Unit = {
|
||||
builder.beginObject()
|
||||
builder.addField("line", obj.line)
|
||||
builder.addField("character", obj.character)
|
||||
builder.endObject()
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+35
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp.codec
|
||||
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
||||
trait PublishDiagnosticsParamsFormats { self: sbt.internal.bsp.codec.TextDocumentIdentifierFormats with sbt.internal.bsp.codec.BuildTargetIdentifierFormats with sbt.internal.bsp.codec.DiagnosticFormats with sjsonnew.BasicJsonProtocol =>
|
||||
implicit lazy val PublishDiagnosticsParamsFormat: JsonFormat[sbt.internal.bsp.PublishDiagnosticsParams] = new JsonFormat[sbt.internal.bsp.PublishDiagnosticsParams] {
|
||||
override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.PublishDiagnosticsParams = {
|
||||
__jsOpt match {
|
||||
case Some(__js) =>
|
||||
unbuilder.beginObject(__js)
|
||||
val textDocument = unbuilder.readField[sbt.internal.bsp.TextDocumentIdentifier]("textDocument")
|
||||
val buildTarget = unbuilder.readField[sbt.internal.bsp.BuildTargetIdentifier]("buildTarget")
|
||||
val originId = unbuilder.readField[Option[String]]("originId")
|
||||
val diagnostics = unbuilder.readField[Vector[sbt.internal.bsp.Diagnostic]]("diagnostics")
|
||||
val reset = unbuilder.readField[Boolean]("reset")
|
||||
unbuilder.endObject()
|
||||
sbt.internal.bsp.PublishDiagnosticsParams(textDocument, buildTarget, originId, diagnostics, reset)
|
||||
case None =>
|
||||
deserializationError("Expected JsObject but found None")
|
||||
}
|
||||
}
|
||||
override def write[J](obj: sbt.internal.bsp.PublishDiagnosticsParams, builder: Builder[J]): Unit = {
|
||||
builder.beginObject()
|
||||
builder.addField("textDocument", obj.textDocument)
|
||||
builder.addField("buildTarget", obj.buildTarget)
|
||||
builder.addField("originId", obj.originId)
|
||||
builder.addField("diagnostics", obj.diagnostics)
|
||||
builder.addField("reset", obj.reset)
|
||||
builder.endObject()
|
||||
}
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp.codec
|
||||
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
||||
trait RangeFormats { self: sbt.internal.bsp.codec.PositionFormats with sjsonnew.BasicJsonProtocol =>
|
||||
implicit lazy val RangeFormat: JsonFormat[sbt.internal.bsp.Range] = new JsonFormat[sbt.internal.bsp.Range] {
|
||||
override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.Range = {
|
||||
__jsOpt match {
|
||||
case Some(__js) =>
|
||||
unbuilder.beginObject(__js)
|
||||
val start = unbuilder.readField[sbt.internal.bsp.Position]("start")
|
||||
val end = unbuilder.readField[sbt.internal.bsp.Position]("end")
|
||||
unbuilder.endObject()
|
||||
sbt.internal.bsp.Range(start, end)
|
||||
case None =>
|
||||
deserializationError("Expected JsObject but found None")
|
||||
}
|
||||
}
|
||||
override def write[J](obj: sbt.internal.bsp.Range, builder: Builder[J]): Unit = {
|
||||
builder.beginObject()
|
||||
builder.addField("start", obj.start)
|
||||
builder.addField("end", obj.end)
|
||||
builder.endObject()
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+27
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||
*/
|
||||
|
||||
// DO NOT EDIT MANUALLY
|
||||
package sbt.internal.bsp.codec
|
||||
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
||||
trait TextDocumentIdentifierFormats { self: sjsonnew.BasicJsonProtocol =>
|
||||
implicit lazy val TextDocumentIdentifierFormat: JsonFormat[sbt.internal.bsp.TextDocumentIdentifier] = new JsonFormat[sbt.internal.bsp.TextDocumentIdentifier] {
|
||||
override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.TextDocumentIdentifier = {
|
||||
__jsOpt match {
|
||||
case Some(__js) =>
|
||||
unbuilder.beginObject(__js)
|
||||
val uri = unbuilder.readField[java.net.URI]("uri")
|
||||
unbuilder.endObject()
|
||||
sbt.internal.bsp.TextDocumentIdentifier(uri)
|
||||
case None =>
|
||||
deserializationError("Expected JsObject but found None")
|
||||
}
|
||||
}
|
||||
override def write[J](obj: sbt.internal.bsp.TextDocumentIdentifier, builder: Builder[J]): Unit = {
|
||||
builder.beginObject()
|
||||
builder.addField("uri", obj.uri)
|
||||
builder.endObject()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,12 +53,58 @@ type BuildTargetIdentifier {
|
||||
}
|
||||
|
||||
type TaskId {
|
||||
## A unique identifier
|
||||
id: String!
|
||||
## A unique identifier
|
||||
id: String!
|
||||
|
||||
## The parent task ids, if any. A non-empty parents field means
|
||||
## this task is a sub-task of every parent task.
|
||||
parents: [String]
|
||||
## The parent task ids, if any. A non-empty parents field means
|
||||
## this task is a sub-task of every parent task.
|
||||
parents: [String]
|
||||
}
|
||||
|
||||
type TextDocumentIdentifier {
|
||||
## The file's Uri
|
||||
uri: java.net.URI!
|
||||
}
|
||||
|
||||
## Position in a text document expressed as zero-based line and zero-based character offset.
|
||||
## A position is between two characters like an 'insert' cursor in a editor.
|
||||
type Position {
|
||||
## Line position in a document (zero-based).
|
||||
line: Long!
|
||||
|
||||
## Character offset on a line in a document (zero-based).
|
||||
character: Long!
|
||||
}
|
||||
|
||||
## A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor.
|
||||
## Therefore the end position is exclusive.
|
||||
type Range {
|
||||
## The range's start position.
|
||||
start: sbt.internal.bsp.Position!
|
||||
|
||||
## The range's end position.
|
||||
end: sbt.internal.bsp.Position!
|
||||
}
|
||||
|
||||
## Represents a diagnostic, such as a compiler error or warning.
|
||||
## Diagnostic objects are only valid in the scope of a resource.
|
||||
type Diagnostic {
|
||||
## The range at which the message applies.
|
||||
range: sbt.internal.bsp.Range!
|
||||
|
||||
## The diagnostic's severity. Can be omitted. If omitted it is up to the
|
||||
## client to interpret diagnostics as error, warning, info or hint.
|
||||
severity: Long
|
||||
|
||||
## The diagnostic's code. Can be omitted.
|
||||
code: String
|
||||
|
||||
## A human-readable string describing the source of this
|
||||
## diagnostic, e.g. 'typescript' or 'super lint'.
|
||||
source: String
|
||||
|
||||
## The diagnostic's message.
|
||||
message: String!
|
||||
}
|
||||
|
||||
## Initialize Build Request
|
||||
@@ -107,6 +153,27 @@ type InitializeBuildResult {
|
||||
data: sjsonnew.shaded.scalajson.ast.unsafe.JValue
|
||||
}
|
||||
|
||||
## Publish Diagnostics
|
||||
type PublishDiagnosticsParams {
|
||||
## The document where the diagnostics are published.
|
||||
textDocument: sbt.internal.bsp.TextDocumentIdentifier!
|
||||
|
||||
## The build target where the diagnostics origin.
|
||||
## It is valid for one text to belong to multiple build targets,
|
||||
## for example sources that are compiled against multiple platforms (JVM, JavaScript).
|
||||
buildTarget: sbt.internal.bsp.BuildTargetIdentifier!
|
||||
|
||||
## The request id that originated this notification
|
||||
originId: String
|
||||
|
||||
## The diagnostics to be published by the client
|
||||
diagnostics: [sbt.internal.bsp.Diagnostic]
|
||||
|
||||
## Whether the client should clear the previous diagnostics
|
||||
## mapped to the same `textDocument` and buildTarget
|
||||
reset: Boolean!
|
||||
}
|
||||
|
||||
## Workspace Build Targets response
|
||||
type WorkspaceBuildTargetsResult {
|
||||
## The build targets in this workspace that
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* sbt
|
||||
* Copyright 2011 - 2018, Lightbend, Inc.
|
||||
* Copyright 2008 - 2010, Mark Harrah
|
||||
* Licensed under Apache License 2.0 (see LICENSE)
|
||||
*/
|
||||
|
||||
package sbt.internal.bsp
|
||||
|
||||
object DiagnosticSeverity {
|
||||
|
||||
/**
|
||||
* Reports an error.
|
||||
*/
|
||||
val Error = 1L
|
||||
|
||||
/**
|
||||
* Reports a warning.
|
||||
*/
|
||||
val Warning = 2L
|
||||
|
||||
/**
|
||||
* Reports an information.
|
||||
*/
|
||||
val Information = 3L
|
||||
|
||||
/**
|
||||
* Reports a hint.
|
||||
*/
|
||||
val Hint = 4L
|
||||
}
|
||||
Reference in New Issue
Block a user