feat(lsp-api): Add infoType (#915)

Add infoType
This commit is contained in:
InversionSpaces 2023-09-28 12:00:53 +02:00 committed by GitHub
parent 878990a837
commit 1e636cc076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -61,7 +61,15 @@ object TokenLocation {
}
@JSExportAll
case class ErrorInfo(start: Int, end: Int, message: String, location: UndefOr[String])
case class ErrorInfo(
start: Int,
end: Int,
message: String,
location: UndefOr[String]
) {
// Used to distinguish from WarningInfo in TS
val infoType: String = "error"
}
object ErrorInfo {
@ -77,7 +85,15 @@ object ErrorInfo {
}
@JSExportAll
case class WarningInfo(start: Int, end: Int, message: String, location: UndefOr[String])
case class WarningInfo(
start: Int,
end: Int,
message: String,
location: UndefOr[String]
) {
// Used to distinguish from ErrorInfo in TS
val infoType: String = "warning"
}
object WarningInfo {

View File

@ -17,6 +17,7 @@ export interface TokenImport {
}
export interface ErrorInfo {
infoType: "error",
start: number,
end: number,
message: string,
@ -24,6 +25,7 @@ export interface ErrorInfo {
}
export interface WarningInfo {
infoType: "warning",
start: number,
end: number,
message: string,