Skip to content

Commit deecd98

Browse files
authored
Merge pull request #93 from Gerrit0/comment-hats
fix: Hats in twoslash errors should be commented
2 parents 979c1b5 + 0186376 commit deecd98

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/twoslash.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ export class TwoslashModule extends Module {
105105
linkWithHats += ' '.repeat(spaceBefore);
106106
linkWithHats += '^'.repeat(e.length || 0);
107107
});
108-
resultLines.push(linkWithHats);
108+
109+
if (linkWithHats.length > 0) {
110+
resultLines.push('//' + linkWithHats.substr(2));
111+
}
112+
109113
resultLines.push(...errors);
110114
}
111115

0 commit comments

Comments
 (0)