Skip to content

Commit daae816

Browse files
fix formatting for generated markdown document
This commit has been edited 1 times
1 parent dfa064f commit daae816

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/provider/textDocumentProvider.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@ export const textDocumentContentProvider: TextDocumentContentProvider = {
2121
if (!item) {
2222
return `no diagnostic found for ${fsPath} with range ${JSON.stringify(range)}`;
2323
}
24-
return item.contents.map((content) => content.value).join('\n');
24+
const content = item.contents.map(
25+
(content) => content.value
26+
.replaceAll("```type\n", '```typescript\n'))
27+
.join('\n');
28+
/*
29+
Explanation
30+
At this point the user has seen the tooltip and needs to see the markdown preview
31+
The preview needed ```type to be formatted correctly to the user but this is no longer needed.
32+
The markdown preview needs ```typescript to be formatted correctly.
33+
*/
34+
return content;
2535
},
2636
};
2737

0 commit comments

Comments
 (0)