diff --git a/language-server/language-server-api/.js/src/main/scala/aqua/lsp/AquaLSP.scala b/language-server/language-server-api/.js/src/main/scala/aqua/lsp/AquaLSP.scala index 84cea97e..2c1453e5 100644 --- a/language-server/language-server-api/.js/src/main/scala/aqua/lsp/AquaLSP.scala +++ b/language-server/language-server-api/.js/src/main/scala/aqua/lsp/AquaLSP.scala @@ -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 { diff --git a/language-server/language-server-npm/aqua-lsp-api.d.ts b/language-server/language-server-npm/aqua-lsp-api.d.ts index 0f9c0e7c..c59ec827 100644 --- a/language-server/language-server-npm/aqua-lsp-api.d.ts +++ b/language-server/language-server-npm/aqua-lsp-api.d.ts @@ -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,