visual-studio-codesvg

How to view SVG source code now, with latest January 2025 (version 1.97)


Refer to release notes: https://code.visualstudio.com/updates/v1_97#\_svg-image-preview-support. Now vscode is displaying visible image for svg files, Like this screenshot from release notes. vscode svg screenshot

However, how to view or even edit the source of svg? Like the previous version

I didn't find switch in preview tab, neither settings option.


Solution

  • You have to right-click the file to open the context menu and select Open with...

    VSCode file context menu

    Then choose the "Text Editor" option.

    VSCode open with options

    You can also associate a default editor for svg files, either through the option in the previous menu, or via a setting in your config:

    "workbench.editorAssociations": {
      "*.svg": "default"
    }