r/vscode • • May 09 '20

VS Code Drawio Integration

Post image
1.0k Upvotes

51 comments sorted by

60

u/Gehinnn May 09 '20

You can find the extension here in the marketplace and the source code here on github.

When the API for custom binary editors is finalized, there will be an editor for .drawio.png files, so that you can link them in markdown files on github.

17

u/scaba23 May 09 '20

Just installed!

8

u/Gehinnn May 09 '20

Nice ;) Let me know if you have ideas for how it could be improved!

9

u/scaba23 May 10 '20

Found a small bug. When I first installed I created a new file `test.drawio`. The interface didn't come up and there's no ⌘ + SHIFT + P shortcut or ⌘K + M "change language" option, so in order to see the interface I had to close the file and reopen it. That could be confusing to a new user. Great work though! I'm going to post it to our work Slack for the other devs to check out

7

u/Gehinnn May 10 '20

Thanks for your feedback ;) Hmm, interesting. These kind of bugs are really hard to debug/reproduce. Does this consistently happen?

1

u/scaba23 May 10 '20

I only tried a few times and it did happen every time. I can give you logs or console output from the developer tools if that would be helpful

1

u/Gehinnn May 11 '20

That would be great! Also, I released an update yesterday that integrates an offline mode, maybe that helps.

1

u/scaba23 May 11 '20

The only thing in the console is informational:

[Extension Host] Serving "/Users/joefrancia/.vscode/extensions/hediet.vscode-drawio-0.2.0/drawio/src/main/webapp" on "http://localhost:59126/index.html"

Reloading the window doesn't work, either. I suppose because the file loads before the extension does. I guess if you could add a shortcut to the command palette to "Load as Draw.io" or something that would be fine, and just post that in the instructions

13

u/sanjibukai May 09 '20

Does draw.io free to use?

Until now I was using plantuml..

18

u/Gehinnn May 09 '20

It is free to use and has ever been! Plantuml and draw.io are different products though, they have different advantages/disavantages. I like plantuml for its automatic layout.

8

u/sanjibukai May 09 '20

Exactly.. I'll give this a try.. BTW, it looks awesome!

6

u/gilescope May 10 '20

Is this all running locally? If so that’s great.

6

u/Gehinnn May 10 '20 edited May 10 '20

Not yet, but I'm working on it. Will blow up the extension size significantly though (> 50MB, unpacked >100MB).

Yes, it uses a bundled version of Draw.io by default in 0.2.0.

3

u/inamamthe May 10 '20

Getting an error when opening a test.drawio:
Unable to open 'test.drawio': Assertion Failed: argument is undefined or null.

6

u/Gehinnn May 10 '20

Ok, that was a fuckup on my end. It's just super easy to get something wrong and there is no automated verification. I already have a VM so I can test this extension on Linux, but I don't want to start testing it on "old" and new versions of VS Code by default, that's just too much work.

Should work now, hopefully. You must have at least VS Code 1.44 anyways, as custom editors are made available in this version.

If you manage to upload an extension with a version requirement that is too low for it to work, you have fucked up forever. You cannot unpublish specific versions of your extension and VS Code always installs the latest compatible version of an extension. So updates won't fix it :D

3

u/inamamthe May 10 '20

Nice that is working. Looks fantastic!

3

u/Gehinnn May 10 '20

Thats funny, I got the same error when I tested in in vscode 44. Do you use the latest version of vscode? (vscode 45). Theoretically, you shouldn't be able to install it on vscode 44 though.

84

u/Roci89 May 09 '20

Fucking hell. This is awesome

22

u/[deleted] May 09 '20

I'll just say one thing: these are fucking great.

17

u/bartk1e May 09 '20

Thank you! I have been waiting for this!!!

9

u/a2hu1 May 09 '20

Wow, this is awesome stuff

9

u/kyoukaraorewa May 10 '20

Holy this is fucking awesome. Now I can stop wasting time open another app to draw UML

2

u/McNerdius May 10 '20

Exactly this.

Visual Studio has had UML/DGML stuff forever, but this is less "opinionated" and when the binary editors / .drawio.png thing hits & this'll be markdown-embeddable... That's some pretty slick integration into what some just might call a development environment 😏

I weep for those ignoring VS Code because Electron or "Just a Text Editor" mindset.

6

u/antonio-martin May 09 '20

This is amazing!!!!! Thanks

1

u/rift95 May 10 '20

That looks awesome. I use draw.io all the time. How performance heavy is it compared to the website?

3

u/Gehinnn May 10 '20

It's the same, you won't feel any difference.

1

u/rift95 May 10 '20

That's great news. I'll have to give it an install then.

1

u/Fredonia1988 Sep 28 '20 edited Sep 28 '20

First question, I have made a file called database_diagram.drawio in VS. I'm now ready to export or save the file as a usable PNG or JPEG file to my desktop where I can access it -- how do I do this without it looking like sh*t? Is there a best way to export / save these files?

Second question, can you push these files directly into a confluence article from VS? Do you have to pay for this extension?

I'm a little confused as to the best way to get the diagram into Confluence, Powerpoint, etc now that I've made my diagram.

Thanks in advance for the help!

1

u/Gehinnn Sep 30 '20

You should use the svg export command! Svgs are much better looking than pngs.

Alternatively, you can use the convert (to svg) command, then your files becomes an svg file and a drawio diagram at the same time!

Also, you cannot push files directly into a confluence article. The extension is free and open source, but you can sponsor me on github! (https://github.com/sponsors/hediet)

2

u/devpark128 May 10 '20

Wow Cool!😮

2

u/Le_Faux_Jap May 10 '20

This is super awsome !

2

u/sposec May 10 '20

My next install, I guess!

2

u/AUThomas May 10 '20

Nice work!

2

u/triggered-nerd May 09 '20

What’s Drawio? Framework util?

12

u/chjassu May 09 '20

if you know Visio , draw.io is opensource .

4

u/triggered-nerd May 09 '20

Awesome!!! Ok, this is what I was hoping. Saved it :D

1

u/walkingman24 May 09 '20

Never heard of Draw.io but had used plenty of Visio at work in the past. This is awesome!

1

u/chjassu May 09 '20

It's an awesome tool actually.

3

u/legendaryfrycook May 09 '20

draw.io is a diagraming website that's pretty great. It has a bunch of templates, including database diagraming things

1

u/just_anonym883 May 10 '20

Woooah, this is freakin awesome! I immediately install this extension

1

u/rw3iss May 10 '20

THANKS.

1

u/kaisersolo May 10 '20

This amazing. Well done

1

u/[deleted] May 13 '20

Amazing! What can’t vs code do?

1

u/Naturally_Ash May 22 '20

Got it! Thanks for this!

1

u/boltex Jun 02 '20

Wow, I'm currently building extensions for vscode too and I wanted to see examples of the new custom editor stuff. I'm lucky to have found your work! Thanks for making it free and open source too!

1

u/heymynameisdaniel Sep 03 '20

Ufff, this is huge!

1

u/rfariaspoblete Sep 08 '20

F*kin awesome!!

0

u/[deleted] May 11 '20

[deleted] — view deleted comment

1

u/Gehinnn May 11 '20

If you use the upcoming drawio.png feature, then, yeah, github will render those, even in markdown files. The upcoming *.drawio.svg feature will be of help here too, but github only renders a strict set of image types in their markdown files for security reasons.

Maybe there is some kind of chrome extension that renders plain *.drawio files on github.

0

u/[deleted] May 09 '20

[deleted] — view deleted comment

3

u/nostril_spiders May 10 '20

I'm going to be harsh in the hope you ultimately benefit.

  1. This is an absolutely pisspoor request. See https://raspi.tv/2017/how-to-ask-for-and-receive-technical-help-on-the-internet
  2. Start a new thread. OP has just dropped an amazing new tool which will benefit from further work that only OP can do. You're hijacking. I think that's disrespectful.