PlantUML extension for Visual Studio Code on Windows only working with sequence diagrams

Claire Furney picture Claire Furney · Dec 19, 2018 · Viewed 12.7k times · Source

I installed the PlantUML extension (by jebbs) in Visual Studio Code for Windows and everything is working perfectly for sequence diagrams.

However when I try to render a class diagram I get the message:

Dot Executable: \opt\local\bin\dot
File does not exist
Cannot find Graphviz

Screencap of full error message:

Dot Executable does not exist error

When I try the example @startuml testdot @enduml code specified I get the following error:

The environment variable GRAPHVIZ_DOT has been set to /opt/local/bin/dot
Dot executable is \opt\local\bin\dot

Screencap of full error message:

GRAPHVIZ_DOT has been set error

Any ideas where this has been specified such that I can override it (assuming this is what the problem is)? It hasn't been added to the system or user environment variables that I can see.

Answer

Claire Furney picture Claire Furney · Dec 19, 2018

The GRAPHVIZ_DOT environment variable is specified in File > Preferences > Settings > Plantuml: Command Args. Click on the link to "Edit in settings.json".

Settings dialog

settings.json

Additionally the VSCode PlantUML extension doesn't appear to include the graphviz "dot.exe" executable, so this needs to be downloaded and installed (e.g. via chocolatey OR download and unzip from https://graphviz.gitlab.io/_pages/Download/Download_windows.html)

Following this, update the path and save.

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

Also see https://github.com/qjebbs/vscode-plantuml/issues/94