Using a different editor? Feel free to add instructions for your editor of choice.
Editor setup
Contribute
Add a template for creating components#
JetBrains IDEs#
- Navigate to File | Settings | Editor | Live Templates.
- Select Rust and click on the + icon to add a new Live Template.
- Give it a name and description of your preference.
- Paste the following snippet(s) into the Template Text section.
- 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
taga reasonable default value like "div", with double quotes.
$Name$Props {
}
#[
For struct components, you can use the following more complicated template.
$NAME$;
VS Code#
- Navigate to File > Preferences > User Snippets.
- Select Rust as the language.
- Add the following snippet in the snippet JSON file:
Support for the html! macro#
JetBrains IDEs#
Contribution Welcome!
VS Code#
The Rust-Yew extension#
This is a work in progress, and community maintained project! Please see details and direct related bug reports / issues / questions over to the extension's repository
The Rust-Yew extension is available on VSC Marketplace, providing syntax highlighting, renames, hover, and more.
Emmet support should work out of the box; if not, please fall back to editing the settings.json file:
"emmet.includeLanguages":
Neovim#
Lazyvim#
The below configuration works with LazyVim and the lazy.vim plugin. Create a file in
lua/plugins/nvim-lspconfig.lua(or update yourlspconfig) with:
return ,
},
},
}