mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 06:30:17 +00:00
feat(lsp-api): Fix interface definition [LNG-298] (#1027)
* Fix interface definition * Fix comment
This commit is contained in:
parent
33a2ca87e0
commit
5bc01a9c02
@ -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:
|
||||
* {
|
||||
* "<compiled-path-prefix-1>": {
|
||||
* "<import-path-prefix-1>": ["<import-path-1>", "<import-path-2>"],
|
||||
* ...
|
||||
* }
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
export type Imports = Record<string, Record<string, string[]>>;
|
||||
|
||||
export class Compiler {
|
||||
compile(path: string, imports: string[]): Promise<CompilationResult>;
|
||||
compile(path: string, imports: Imports): Promise<CompilationResult>;
|
||||
}
|
||||
|
||||
export var AquaLSP: Compiler;
|
||||
|
Loading…
Reference in New Issue
Block a user