feat(compiler): Add warnings subsystem [fixes LNG117] (#906)

* ErrorsAlgebra -> ReportAlgebra

* Refactor ReportAlgebra

* Refactor

* Refactor AquaError

* Fixes

* Add warnings, refactor

* Refactor parser

* Move semantics

* Savepoint

* Refactor semantics and compiler

* Refactor types

* Refactor compiler

* Refactor compiler

* Refactor types

* Refactor retunr types

* Return warnings

* Add simple warning

* Refactor to ValidatedNec

* Refactor

* Add comment

* Propagate warnings to LspContext

* Propagate warnings to LSP

* Add warnings to js api

* Update LSP js api

* Use export declare

* Add comment

* Refactor span rendering

* Remove variable name warning

* Add warning on unused call results

* Add unit tests

* Remove println
This commit is contained in:
InversionSpaces
2023-09-25 15:00:43 +02:00
committed by GitHub
parent 1c708c8bb0
commit 27a781dd3f
51 changed files with 1642 additions and 1241 deletions

View File

@ -1,22 +1,23 @@
import { ServiceDef, FunctionCallDef } from "@fluencelabs/interfaces";
export class AquaFunction {
export declare class AquaFunction {
funcDef: FunctionCallDef;
script: string;
}
export class GeneratedSource {
export declare class GeneratedSource {
name: string;
tsSource?: string;
jsSource?: string;
tsTypes?: string;
}
class CompilationResult {
export declare class CompilationResult {
services: Record<string, ServiceDef>;
functions: Record<string, AquaFunction>;
functionCall?: AquaFunction;
errors: string[];
warnings: string[];
generatedSources: GeneratedSource[];
}