tintinweb / vscode-interactive-graphviz

Interactive Graphviz Dot Preview for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=tintinweb.graphviz-interactive-preview
GNU General Public License v3.0
143 stars 22 forks source link

Support reading graph from URI #119

Closed mforkel closed 1 year ago

mforkel commented 1 year ago

I use Graphviz Interactive Preview to display a dot graph that is created "on the fly" in my VSCode extension. The graph is the output of quilt graph.

After your switch to URI identifying (#113), I thought I could do

vscode.commands.executeCommand('graphviz-interactive-preview.preview.beside', { uri: graphUri, title: title });

with graphUri pointing to a text file that contains the graph. But passing the graph with content: graph is still required.

I guess preview.beside is more geared towards interactively displaying a graph while it is being edited. Would you consider adding a command that does not require content and displays the graph in a file specifed by a URI?

bigbug commented 1 year ago

Sounds like a good option. 👍

bigbug commented 1 year ago

I just had a quick look at this and created PR #121 for this. However, I'm currently unable to test or even compile the code. If you want, you can have a look at this and see whether this fits your needs. Another possibility for you can be the implementation of a VirtualDocument.

mforkel commented 1 year ago

Thanks for that! I tried to test your PR, but can't manage to build a local package because of a problem with ESLint in the link (and package) scripts:

ESLint couldn't find the config "airbnb-base" to extend from. Please check that the name of the config is correct.

The config "airbnb-base" was referenced from the config file in "/home/malte/dev/vscode-interactive-graphviz/.eslintrc.js".

Obviously not a problem with your PR, but missing knowledge on my side. eslint-config-airbnb-base and eslint are both installed and run locally. Could you give me with a hint?

bigbug commented 1 year ago

Typically this should work with running npm install and then npm run watch within the folder of the repository. Afterwards you can run the debug configuration in VSCode.

However, I also included you a VSIX you can try: graphviz-interactive-preview-0.3.2.vsix.zip .