An extension for Visual Studio Code to preview of go command: go mod graph
.
The author is not a front-end engineer. This extension should be considered as a prototype, so experience may not be good. Hope some engineers can provide some optimizations.
go
command is in $PATH
Go Module
ongraphviz
and make sure dot
command is in $PATH
go mod graph
is functionally normal without some downloading processYou can install this extension from the Visual Studio Marketplace.
go mod graph
go mod why [mod]
Action | Gesture |
---|---|
Zoom in | Mouse wheel up / + |
Zoom out | Mouse wheel down / - |
Toggle 100% zoom | Mouse double click / Space |
Pan | Mouse drag / Left / Right / Up / Down / A / D / W / S |
Zoom to 100% | 0 |
Move to center | X |
There are three zooming modes: Fixed, Fit and Auto Fit.
To export the generated graph, click the “Export” button on the top right corner.
Configuration | Type | Description |
---|---|---|
graphvizPreview.dotPath |
string | null |
null means to use the “dot” program in your PATH environment variable, or a string value to indicate the “dot” program you want to use. |
graphvizPreview.engine |
"dot" | null |
The layout engine to use. null means to use the “dot” layout engine. Currently, only the “dot” engine is supported. |
Make sure the extension can find the “dot” program. You can set graphvizPreview.dotPath
option to the path of the dot
executable, or make sure the directory containing the dot program is in your PATH
environment variable.
To set the graphvizPreview.dotPath
option, go to File → Preference → Settings.