From 5bc01a9c02252add86c018fa90703cda287d1338 Mon Sep 17 00:00:00 2001 From: InversionSpaces Date: Tue, 19 Dec 2023 17:01:34 +0100 Subject: [PATCH] feat(lsp-api): Fix interface definition [LNG-298] (#1027) * Fix interface definition * Fix comment --- .../language-server-npm/aqua-lsp-api.d.ts | 67 +++++++++++-------- 1 file changed, 40 insertions(+), 27 deletions(-) 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 bf705eee..d8dd6317 100644 --- a/language-server/language-server-npm/aqua-lsp-api.d.ts +++ b/language-server/language-server-npm/aqua-lsp-api.d.ts @@ -1,52 +1,65 @@ export interface TokenLocation { - name: string, - startLine: number, - startCol: number, - endLine: number, - endCol: number + name: string; + startLine: number; + startCol: number; + endLine: number; + endCol: number; } export interface TokenInfo { - location: TokenLocation, - type: string + location: TokenLocation; + type: string; } export interface TokenLink { - current: TokenLocation, - definition: TokenLocation + current: TokenLocation; + definition: TokenLocation; } export interface TokenImport { - current: TokenLocation, - path: string + current: TokenLocation; + path: string; } export interface ErrorInfo { - infoType: "error", - start: number, - end: number, - message: string, - location: string | null + infoType: "error"; + start: number; + end: number; + message: string; + location: string | null; } export interface WarningInfo { - infoType: "warning", - start: number, - end: number, - message: string, - location: string | null + infoType: "warning"; + start: number; + end: number; + message: string; + location: string | null; } export interface CompilationResult { - errors: ErrorInfo[], - warnings: WarningInfo[], - locations: TokenLink[], - importLocations: TokenImport[], - tokens: TokenInfo[] + errors: ErrorInfo[]; + warnings: WarningInfo[]; + locations: TokenLink[]; + importLocations: TokenImport[]; + tokens: TokenInfo[]; } +/* + * Imports configuration for the compiler. + * Structure: + * { + * "": { + * "": ["", ""], + * ... + * } + * ... + * } + */ +export type Imports = Record>; + export class Compiler { - compile(path: string, imports: string[]): Promise; + compile(path: string, imports: Imports): Promise; } export var AquaLSP: Compiler;