Skip to content

Commit

Permalink
fix: Include messageDetails in VS Code links
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Mar 13, 2024
1 parent 9148254 commit da035fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/formatter/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class Text {
totalWarningCount += warningCount;
totalFatalErrorCount += fatalErrorCount;

// this.#writeln(chalk.inverse(filePath));
this.#writeln(chalk.inverse(path.resolve(process.cwd(), filePath)));

// Group messages by rule
Expand Down Expand Up @@ -77,13 +76,16 @@ export class Text {
if (messages) {
this.#writeln(chalk.bold(` ${chalk.dim("0:0")} ${ruleId} (${messages.length})`));
messages.forEach((msg) => {
const formattedLocation =
formatLocation(msg.line, msg.column, lineInfoLength, columnInfoLength);

const messageDetails = (showDetails && msg.messageDetails) ?
(`\n ${chalk.white.bold("Details:")}\n ` +
`${chalk.italic(msg.messageDetails.replaceAll("\n", "\n "))}`) :
(`\n ${formattedLocation} ${chalk.white.bold("Details:")} ` +
`${chalk.italic(msg.messageDetails.replaceAll("\n", `\n ${formattedLocation} `))}`) :
"";

this.#writeln(
` ${formatLocation(msg.line, msg.column, lineInfoLength, columnInfoLength)} ` +
` ${formattedLocation} ` +
`${formatSeverity(msg.severity)} ` +
`${msg.message}` +
`${messageDetails}`);
Expand Down

0 comments on commit da035fd

Please sign in to comment.