diff --git a/core/cli/package.json b/core/cli/package.json index 2568fea..f4b98a8 100644 --- a/core/cli/package.json +++ b/core/cli/package.json @@ -9,7 +9,7 @@ "ioc", "inversion of control" ], - "version": "0.0.39", + "version": "0.0.40", "license": "MIT", "author": { "name": "Dan Kadera", diff --git a/core/cli/src/checker.ts b/core/cli/src/checker.ts index d496fe9..1f7e610 100644 --- a/core/cli/src/checker.ts +++ b/core/cli/src/checker.ts @@ -76,7 +76,7 @@ export class Checker { for (const diagnostic of output.getPreEmitDiagnostics()) { this.logger.log( this.getDiagnosticCategoryLogLevel(diagnostic.getCategory()), - this.formatDiagnostic(diagnostic.getLineNumber(), diagnostic.getMessageText()), + this.formatDiagnostic(diagnostic.getMessageText(), diagnostic.getLineNumber()), ); } } @@ -89,13 +89,19 @@ export class Checker { } } - private formatDiagnostic(line?: number, ...messages: (DiagnosticMessageChain | string)[]): string { + private formatDiagnostic(message: DiagnosticMessageChain | string, line?: number): string { + return line !== undefined + ? `line ${line} in compiled container: ${this.formatDiagnosticMessage(message)}` + : `in compiled container: ${this.formatDiagnosticMessage(message)}`; + } + + private formatDiagnosticMessage(...messages: (DiagnosticMessageChain | string)[]): string { return messages.map((message) => { if (typeof message === 'string') { - return line !== undefined ? `L${line}: ${message}` : message; + return message; } - return this.formatDiagnostic(line, message.getMessageText(), ...message.getNext() ?? []); + return this.formatDiagnosticMessage(message.getMessageText(), ...message.getNext() ?? []); }).join('\n'); } } diff --git a/package-lock.json b/package-lock.json index fc1e436..5190e14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ }, "core/cli": { "name": "dicc-cli", - "version": "0.0.39", + "version": "0.0.40", "license": "MIT", "dependencies": { "@debugr/console": "^3.0.0-rc.10",