【问题标题】:PlantUML extension for Visual Studio Code on Windows only working with sequence diagramsWindows 上 Visual Studio Code 的 PlantUML 扩展仅适用于序列图
【发布时间】:2018-12-19 17:20:40
【问题描述】:

我在适用于 Windows 的 Visual Studio Code 中安装了 PlantUML extension (by jebbs),对于 sequence 图表,一切都运行良好。

但是,当我尝试渲染 class 图表时,我收到以下消息:

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

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

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

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

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

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

【问题讨论】:

    标签: windows visual-studio-code plantuml


    【解决方案1】:

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

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

    之后,更新路径并保存。

    {
        "plantuml.commandArgs": [
            "-DGRAPHVIZ_DOT=D:\\Tools\\graphviz-2.38\\release\\bin\\dot.exe",
        ]
    }
    

    另见https://github.com/qjebbs/vscode-plantuml/issues/94

    【讨论】:

      【解决方案2】:

      这就是我设法修复 graphviz dot: null 问题的方法:

      From VSC: Goto EXTENSIONS: MARKETPLACE(可以在左侧找到选项)

      选择您已安装的 graphviz 扩展程序,例如@ext:tintinweb.graphviz-interactive-preview

      点击设置

      Graphviz-interactive-preview: Render Lock  (Uncheck this one)
      Graphviz-interactive-preview: Render Lock Additional Timeout: -1
      

      如果 VSC 在 Windows 上,则创建一个变量,指向安装了 graphviz 的 dot.exe 的位置。

      【讨论】:

        【解决方案3】:

        PlantUML 的先决条件是 Java 和 Graphviz (https://plantuml.com/starting)

        您需要这些东西来运行 PlantUML:Java Graphviz(如果您 只需要序列图和活动(beta)图)

        ,在Windows机器上,我们可以下载并解压Graphviz,然后放到用户路径中。

        【讨论】:

          猜你喜欢
          • 2017-07-01
          • 2023-02-21
          • 2021-11-22
          • 2022-06-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-11-22
          相关资源
          最近更新 更多