我在 VS Code 中使用 TypeScript。我使用 JSDoc 来发表评论,因此 IntelliSense 通常将评论显示为工具提示。我使用 Markdown 来格式化这些评论,包括图像。大多数情况下它是有效的,但有一个问题。我只能看到来自 HTTP 服务器的图像。它不会显示来自本地文件系统的图像。
这就是我期望看到的。 这是我尝试访问本地文件时看到的内容。 这是这些图片背后的代码的简短版本。您可以在上下文中找到确切的代码,here。
class IntelliSenseTest {
/**
* `to` and `from` assume that we are moving around the shape counter-clockwise,
* i.e. the mathematically positive direction.
* ![explanation of dots](./kite-dart-dots.png)
*/
constructor(
) {}
}
export class Segment {
/**
* `to` and `from` assume that we are moving around the shape counter-clockwise,
* i.e. the mathematically positive direction.
* ![explanation of dots](https://raw.githubusercontent.com/TradeIdeasPhilip/penrose-tiling/master/docs/kite-dart-dots.png)
*/
constructor(
) {}
//..
}
第一个例子是破损的。第二个可以正确显示图像,但它使用了一种令人讨厌的解决方法。我希望能够将图像和源文件保存在同一目录中。我希望能够将它们包含在同一个提交中。这可能吗?注意:VS Code 能够在自己的窗口中显示此文件。 我可以直接链接到 README.md 中的本地文件。 我们正在查看完全相同的图像,我刚刚将我的项目推送到了 github。
您可以从这张图片或
github中看到,*.png
和
*.ts
文件位于同一目录中。
有人让这个功能发挥作用吗? 知道为什么它对我不起作用吗?