- Rust language support for Nova featuring Rust Analyzer, syntax definitions, and format on save.
- 3638 Installs
This extension is allowed to:
- Read & Write Files
- Launch Subprocesses
- Send Network Requests
🦀 Hello Rustaceans! 🦀
This extension assumes you have common Rust tools installed on your Mac:
- Rust (the
- Cargo for managing projects
- Rustfmt for formatting documents
- Clippy for extra code linting (optional)
The best way to install these requirements and keep them updated is by using the rustup tool. Copy the command at that link into a terminal and run it. Rustup also allows you to switch between Rust versions (e.g., stable or nightly). In-depth documentation on how to use it can be found here.
Note Rust Analyzer expects your workspace to contain a
rust-project.jsonto describe your dependencies. This extension won't launch if these files are missing.
Syntax highlighting, completion assistance from Rust Analyzer, and error checking happen automatically when you open a Rust project. You can find errors and warnings in Nova's Issues sidebar and the editor gutter (checks currently happen after each save). When enabled (see "Configuration" below), your documents can be automatically formatted using Rustfmt whenever you save them.
View descriptions or type info by hovering your mouse cursor over identifiers.
Jump to Definition
Right click an identifier and select Jump to Definition from the menu to be taken to the file location where the selected symbol is defined.
With your cursor over the symbol to rename, press F2 or select the Rename Symbol command from the right-click menu or from the Command Palette. Enter a new name for the symbol.
To configure global preferences, open Extensions → Extension Library... then select Rust's Preferences tab.
You can also configure preferences on a per-project basis in Project → Project Settings...
Save on Format
Checking this checkbox will run
rustfmt on a Rust document when you save it. A
rustfmt.toml configuration file in you project is highly encouraged!
Setting the Issues command to
clippy will add extra lint warnings from Clippy to Issues. This extension defaults to only showing compiler warnings.
Here's why this extension uses the following entitlements:
- Read/Write File System Access - needed to update the Rust Analyzer binary, as well as to let this server do its thing.
- Network Access - used to check for updates for Rust Analyzer, and download updates if available.
- Processes - used to run the language server, update the language server, check for errors, and format documents.
Help Me Help You
🃏 Cards on the table 🃏 I'm still new to Rust and there may be a lot that I missed or got wrong. Does some syntax highlighting look wonky? Something not working as expected? Is it missing a feature you need? If you see something, say something! Mash that Bug Reports link for this extension and create an Issue to let me know. Thanks for being a user!
- Fixes activation error when new preferences are empty
- Task template for Cargo commands
- Extension and workspace preferences for adding environment variables. Values are shared with the Cargo task template AND Rust Analyzer.
- Rust Analyzer restarts when there are changes to
- Comments and strings are now spell-checked (thank you @illegalhex!)
- Rename Symbol command - can be triggered with F2 key like VS Code
- Restart Rust Analyzer command - for when RA seems wonky
- Activates extension for
- Method parsing no longer broken by
- Generics now parsed in return types
- Keywords parsed in generics and return types
- Better parsing of
implblocks for highlighting and symbols
- Highlight more escaped characters and format characters in strings
- Fix hex literals with underscores and
The full version bump is mostly due to setting the minimum Nova version to 9, which contains many language server client fixes.
- Preference for using Clippy for generating issues; can be configured per project.
- Inspects the nearest Cargo.toml for the Rust edition to use with
rustfmtso a rustfmt.toml isn't required to avoid format-on-save errors caused by editions.
- Nova language server client is now reliable enough to use Rust Analyzer for generating issues instead of my custom provider (breaking change and reason for version bump).
- Syntax no longer highlights 'impl' within words
- Syntax fixes for structs, enums, and more – mostly from a user! Thanks @mirnovov!
- Syntax fixes for impl and struct blocks
rustfmtfrom the project directory so that it picks up the
rustfmt.tomlI recommended you have. Oops.
- Those Rustfmt failure notifications were annoying, weren't they? Sorry about that.
Versions 1.0.1 & 1.0.2
- Fixes issue where binary isn't renamed if language server isn't running. Sorry for the rapid updates, folks. I can't test this feature in development.
- Better checking that Rust Analyzer binary was downloaded.
🎉 Initial Release 🎉
- Syntax definitions
- Rust Analyzer integration
- Error checking
- Format on Save