Skip to content

Refactoring

Mermaid Studio provides IDE-powered refactoring tools that help you safely rename nodes and navigate your diagrams.

To rename a node and automatically update all its references:

  1. Place your cursor on the node name
  2. Use one of these methods:
    • Press Shift+F6
    • Right-click and select Refactor -> Rename
  3. Type the new name
  4. Press Enter to apply

All references to that node throughout the diagram are updated automatically.

To see everywhere a node is referenced:

  1. Place your cursor on a node
  2. Press Alt+F7 (Windows/Linux) or Option+F7 (macOS)
  3. Or right-click and select Find Usages

The results appear in a tool window showing all locations where the node is used.

Click on any node reference while holding:

  • Ctrl (Windows/Linux)
  • Cmd (macOS)

This navigates directly to where the node is defined.

Refactoring works best in diagram types with named, reusable elements:

  • Flowcharts - Node IDs and subgraph names
  • ER Diagrams - Entity names
  • Requirements - Requirement and element IDs
  • C4 Diagrams - Component names
  • Block Diagrams - Block IDs

Other diagram types may have limited or no refactoring support depending on their syntax structure.