Windows上适用于Visual Studio Code的PlantUML扩展名仅适用于序列图

Cla*_*ney 5 windows plantuml visual-studio-code

我已经在Windows的Visual Studio Code中安装了PlantUML扩展(由jebbs开发),并且对于序列图来说一切都工作正常。

但是,当我尝试呈现一个图时,我得到消息:

点可执行文件:\ opt \ local \ bin \ dot
文件不存在
找不到Graphviz

完整错误消息的屏幕截图:

点可执行文件不存在错误

当我尝试@startuml testdot @enduml指定的示例代码时,出现以下错误:

环境变量GRAPHVIZ_DOT已设置为/ opt / local / bin / dot。
点可执行文件为\ opt \ local \ bin \ dot

完整错误消息的屏幕截图:

GRAPHVIZ_DOT已设置错误

有什么想法可以指定它,以便我可以覆盖它(假设这是问题所在)?我尚未看到它尚未添加到系统或用户环境变量中的信息。

Cla*_*ney 8

GRAPHVIZ_DOT环境变量在文件>首选项>设置> Plantuml:命令参数中指定。单击链接到“在settings.json中编辑”。

设置对话框

settings.json

另外,VSCode PlantUML扩展似乎未包含graphviz“ dot.exe”可执行文件,因此需要下载并安装(例如,通过Chocolatey或从https://graphviz.gitlab.io/_pages/Download解压缩)/Download_windows.html

然后,更新路径并保存。

{
    "plantuml.commandArgs": [
        "-DGRAPHVIZ_DOT=D:\\Tools\\graphviz-2.38\\release\\bin\\dot.exe",
    ]
}
Run Code Online (Sandbox Code Playgroud)

另请参阅https://github.com/qjebbs/vscode-plantuml/issues/94