# vscode-drawio **Repository Path**: wbyshr/vscode-drawio ## Basic Information - **Project Name**: vscode-drawio - **Description**: vscode-drawio 是一个 VS Code 扩展,它可以在 VS Code 上集成图表工具 Draw.io - **Primary Language**: TypeScript - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/vscode-drawio - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 24 - **Created**: 2020-07-18 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Draw.io VS Code Integration [![](https://img.shields.io/static/v1?style=social&label=Sponsor&message=%E2%9D%A4&logo=GitHub&color&link=%3Curl%3E)](https://github.com/sponsors/hediet) [![](https://img.shields.io/static/v1?style=social&label=Donate&message=%E2%9D%A4&logo=Paypal&color&link=%3Curl%3E)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZP5F38L4C88UY&source=url) [![](https://img.shields.io/twitter/follow/hediet_dev.svg?style=social)](https://twitter.com/intent/follow?screen_name=hediet_dev) This unofficial extension integrates [Draw.io](https://app.diagrams.net/) into VS Code. ## Features - Edit `.drawio`, `.dio`, `.drawio.svg` or `.drawio.png` files in the Draw.io editor. - To create a new diagram, simply create an empty `*.drawio`, `*.drawio.svg` or `*.drawio.png` file and open it! - `.drawio.svg` are valid `.svg` files that can be embedded in Github readme files! No export needed. - `.drawio.png` are valid `.png` files! No export needed. You should use `.svg` though whenever possible - they look much better! - To convert between different formats, use the `Draw.io: Convert To...` command. - Uses an offline version of Draw.io by default. - You can select a theme. ## Demo ![](./docs/demo.gif) ## Editing .drawio.svg/.drawio.png Files You can directly edit and save `.drawio.svg` and `.drawio.png` files. These files are perfectly valid svg/png-images that contain an embedded Draw.io diagram. Whenever you edit such a file, the svg/png part of that file is kept up to date. The logo of this extension is such a `.drawio.png` file that has been created with the extension itself! ![](./docs/drawio-png.gif) If diffs are important for you, you should prefer `.drawio` and avoid `.drawio.png` diagrams. ## Code Link Feature In the status bar, you can enable or disable the code link feature. If it is enabled and you double click on a node whose label starts with `#`, you will perform a workspace search for a symbol matching the rest of the label. If you have a node labeled `#MyClass` and a class of name `MyClass`, you will jump to its source if you double click the node! **Pleaes note that you have to open at least one file of the project that contains the symbol.** Otherwise, VS Code will not consider this project when searching for symbols. This file itself does not have to contain the symbol though. Thanks to my latest github sponsors, this feature is open source and freely available now. _TIP_: If you open the draw.io editor to the right side (i.e. the second editor column) and navigate to a symbol, the diagram will stay visible. ![](./docs/demo-code-link.gif) ## Settings This extension contributes the following settings: ![](./docs/settings.png)
Available Draw.io Themes
## Associate `.svg` Files With This Editor By default, this extension only handles `*.drawio.svg` files. Add this to your VS Code `settings.json` file if you want to associate it with `.svg` files: ```json "workbench.editorAssociations": [ { "viewType": "hediet.vscode-drawio-text", "filenamePattern": "*.svg" } ] ``` You won't be able to edit arbitrary SVG files though - only those that have been created with Draw.io or this extension! ## Editing the Diagram and its XML Side by Side You can open the same `*.drawio` file with the Draw.io editor and as xml file. They are synchronized, so you can switch between them as you like it. This is super pratical if you want to use find/replace to rename text or other features of VS Code to speed up your diagram creation/edit process. Use the `File: Reopen With...` command to toggle between the text or the Draw.io editor. You can open multiple editors for the same file. ![](./docs/drawio-xml.gif) ## Contributors - Henning Dieterichs, [hediet](https://github.com/hediet) on Github (Main Contributor / Author) - Vincent Rouillé, [Speedy37](https://github.com/Speedy37) on Github ## See Also / Similar Extensions - [Draw.io](https://app.diagrams.net/) - This extension relies on the giant work of Draw.io. Their embedding feature enables this extension! This extension bundles a recent version of Draw.io. - [vscode-drawio](https://github.com/eightHundreds/vscode-drawio) by eightHundreds. ## Other Cool Extensions If you like this extension, you might like [my other extensions](https://marketplace.visualstudio.com/search?term=henning%20dieterichs&target=VSCode) too: - **[Real-Time Debugging](https://marketplace.visualstudio.com/items?itemName=hediet.realtime-debugging)**: This extension visualizes how your code is being executed. - **[Debug Visualizer](https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer)**: An extension for visualizing data structures while debugging. - **[Tasks Statusbar](https://marketplace.visualstudio.com/items?itemName=hediet.tasks-statusbar)**: This extension adds buttons to the status bar to quickly start and kill tasks.