Editor Setup

    Using a different editor? Feel free to add instructions for your editor of choice.

    1. Navigate to File | Settings | Editor | Live Templates.
    2. Select Rust and click on the + icon to add a new Live Template.
    3. Paste the following snippet(s) into the Template Text section.
    4. Change the applicability on the lower right, select Rust > Item > Module

    For function components, use the following template.

    • (Optional) Click on Edit Variable and give a reasonable default value like “div”, with double quotes.
    1. Navigate to File > Preferences > User Snippets.
    2. Add the following snippet in the snippet JSON file:

    Support for the Macro

    JetBrains added experimental support for proc-macro expansion in April 2021. This feature must be enabled before it can be used.

    This still won’t enable HTML autofill and formatting help, although it will enable variable resolution for component names and attributes inside the macro. Utilities like Rename, Go to Declaration, Find Usages will work inside the macro.

    Rust-Yew extension

    Rust-Yew extension is avaliable on VSC Marketplace, providing syntax highlight, renames, hover, and more.

    Emmet support should work out of the box, if not please fall back to edditing the file: