///
import type { DiagnosticTag, Range } from 'brighterscript';
import { DiagnosticSeverity } from 'brighterscript';
export declare class CompileErrorProcessor {
private logger;
status: CompileStatus;
startCompilingLine: number;
endCompilingLine: number;
compilingLines: string[];
compileErrorTimeoutMs: number;
private emitter;
compileErrorTimer: NodeJS.Timeout;
on(eventName: 'diagnostics', handler: (params: BSDebugDiagnostic[]) => void): any;
on(eventName: 'launch-status', handler: (message: string) => void): any;
private emit;
processUnhandledLines(responseText: string): void;
/**
* Checks a single log line for known launch phase signals and emits a `launch-status`
* event with a human-readable progress message when one is found.
*/
private checkForLaunchStatus;
sendErrors(): Promise;
getErrors(lines: string[]): BSDebugDiagnostic[];
/**
* Parse generic xml errors with no further context below
*/
parseGenericXmlError(line: string): BSDebugDiagnostic[];
/**
* Parse the standard syntax and compile error format
*/
private parseSyntaxAndCompileErrors;
/**
* Handles when an error lists the filename on the first line, then subsequent lines each have 1 error.
* Stops on the first line that doesn't have an error line. Like this:
* ```
* Found 3 parse errors in XML file Foo.xml
* --- Line 2: Unexpected data found inside a element (first 10 characters are "aaa")
* --- Line 3: Some unique error message
* --- Line 5: message with Line 4 inside it
*/
private processMultiLineErrors;
/**
* Parse errors that look like this:
* ```
* Error in XML component RedButton defined in file pkg:/components/RedButton.xml
* -- Extends type does not exist: "ColoredButton"
*/
private parseComponentDefinedInFileError;
/**
* Parse error messages that look like this:
* ```
* ------->No manifest. Invalid package.
* ```
*/
private parseMissingManifestError;
/**
* Exec the regexp, and if there's a match, trim every group
*/
private execAndTrim;
private buildMessage;
/**
* Given a text-based line number, convert it to a number and return a range.
* Defaults to line number 1 (1-based) if unable to parse.
* @returns a zero-based vscode `Range` object
*/
private getRange;
/**
* Trim all leading junk up to the `pkg:/` in this string
*/
sanitizeCompilePath(debuggerPath: string): string;
resetCompileErrorTimer(isRunning: any): any;
onCompileErrorTimer(): void;
private isStartingCompilingLine;
private isEndCompilingLine;
/**
* Look through the given responseText for a compiler error
* @param responseText
*/
private reportErrors;
destroy(): void;
}
export interface BSDebugDiagnostic {
/**
* The diagnostic's message. It usually appears in the user interface
*/
message: string;
/**
* The range at which the message applies
*/
range: Range;
/**
* The diagnostic's code, which usually appear in the user interface.
*/
code?: number | string;
/**
* An optional property to describe the error code.
* Requires the code field (above) to be present/not null.
*
* @since 3.16.0
*/
codeDescription?: {
/**
* An URI to open with more information about the diagnostic error.
*/
href: string;
};
/**
* A human-readable string describing the source of this
* diagnostic, e.g. 'typescript' or 'super lint'. It usually
* appears in the user interface.
*/
source?: string;
/**
* Path to the file in question. When emitted from a Roku device, this will be a full pkgPath (i.e. `pkg:/source/main.brs`).
* As it flows through the program, this may be modified to represent a source location (i.e. `C:/projects/app/source/main.brs`)
*/
path: string;
/**
* The name of the component library this diagnostic was emitted from. Should be undefined if diagnostic originated from the
* main app.
*/
componentLibraryName?: string;
/**
* The diagnostic's severity. Can be omitted. If omitted it is up to the
* client to interpret diagnostics as error, warning, info or hint.
*/
severity?: DiagnosticSeverity;
/**
* Additional metadata about the diagnostic.
*
* @since 3.15.0
*/
tags?: DiagnosticTag[];
/**
* An array of related diagnostic information, e.g. when symbol-names within
* a scope collide all definitions can be marked via this property.
*/
relatedInformation?: Array<{
/**
* The location of this related diagnostic information.
*/
location: {
uri: string;
range: Range;
};
/**
* The message of this related diagnostic information.
*/
message: string;
}>;
/**
* A data entry field that is preserved between a `textDocument/publishDiagnostics`
* notification and `textDocument/codeAction` request.
*
* @since 3.16.0
*/
data?: any;
}
export declare enum CompileStatus {
none = "none",
compiling = "compiling",
compileError = "compileError",
running = "running"
}