hediet / vscode-drawio

This unofficial extension integrates Draw.io (also known as diagrams.net) into VS Code.
https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
GNU General Public License v3.0
9.02k stars 406 forks source link

How to open .svg and .png files in the extension please? #381

Closed hawkinsji closed 1 year ago

hawkinsji commented 1 year ago

Hi, Is there a way to force VSCode (or VSCodium) to open a Drawio SVG file in the plugin if the filename doesn't have the .drawio.svg suffix please?

hediet commented 1 year ago

chrome_DclLMtZDCY

hawkinsji commented 1 year ago

Hi @hediet , Thank you for posting this. I tried it and it didn't quite work. It seems that I also had to add workbench editor associations, like this.

"files.associations": {
    "*.svg": "drawio",
    "*.png": "drawio"
},
"workbench.editorAssociations": {
    "*.png": "hediet.vscode-drawio",
    "*.svg": "hediet.vscode-drawio-text"
}

I discovered the workbench associations piece from trying the Open With option on files with the different extensions, .drawio.svg .svg and so on. Cheers, Jim

hediet commented 1 year ago

Interesting, it worked for me, but maybe I had that already setup. The AI cannot be trusted ;) Still it is a good starting point.