Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>VieteNew to Visual Studio Code? Get it now.
Viete

Viete

Preview

viete

|
111 installs
| (0) | Free
Build diagram from python function.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Diagram view for python code

Build mermaid flow chart diagram for any python function.

After installation clickable button "Show Diagram" appear before the each function header. Press it to get mermaid diagram in a separate tab.

High-level steps view

The extension makes comments a first level player. Each comment turns into an edge parallel to the diagram of the code section it refers to.

By default, a comment refers to the section of code below that goes before the next comment or the end of the block. To precisely specify the boundaries of the code that belongs to a comment, use a small syntax extension. Add a comment ##> after the last line of the code section.

Example

Here is an example of how the extension works

Example

Copy the code below to try itself

from typing import Union

def find_quadratic_roots(a: float, b: float, c: float) -> Union[None, tuple]:
    # Calculate the discriminant
    discriminant = b**2 - 4*a*c
    ##>

    if discriminant > 0:
        # Calculate the two roots of the quadratic equation
        x1 = (-b + discriminant**0.5) / (2*a)
        x2 = (-b - discriminant**0.5) / (2*a)
        return x1, x2
    elif discriminant == 0:
        # Calculate the single root of the quadratic equation
        x = -b / (2*a)
        return x,
    else:
        return None
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft