Nova

Extensions


Readme

🦀 Hello Rustaceans! 🦀

This extension provides deep integration with the Rust Language through the Rust Analyzer language server, syntax highlighting, error checking, and formatting on save.

Requirements

This extension assumes you have common Rust tools installed on your Mac:

  • Rust (the rustc compiler)
  • 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.

Usage

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.

Hover Info

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.

Configuration

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!

Clippy Warnings

Setting the Issues command to clippy will add extra lint warnings from Clippy to Issues. This extension defaults to only showing compiler warnings.

Entitlements

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!


Changelog

Version 2.0.2

Fixed

  • Method parsing no longer broken by async keyword
  • Generics now parsed in return types
  • Keywords parsed in generics and return types

Version 2.0.1

Improved

Syntax improvements:

  • Better parsing of impl blocks for highlighting and symbols
  • Highlight more escaped characters and format characters in strings
  • Fix hex literals with underscores and const functions

Version 2.0.0

The full version bump is mostly due to setting the minimum Nova version to 9, which contains many language server client fixes.

New

  • Preference for using Clippy for generating issues; can be configured per project.

Improved

  • Inspects the nearest Cargo.toml for the Rust edition to use with rustfmt so 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).

Fixed

  • Syntax no longer highlights 'impl' within words

Version 1.0.5

Fixed

  • Syntax fixes for structs, enums, and more – mostly from a user! Thanks @mirnovov!

Version 1.0.4

Fixed

  • Syntax fixes for impl and struct blocks

Version 1.0.3

Fixed

  • Runs rustfmt from the project directory so that it picks up the rustfmt.toml I recommended you have. Oops.
  • Those Rustfmt failure notifications were annoying, weren't they? Sorry about that.

Versions 1.0.1 & 1.0.2

Fixed

  • 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.

Version 1.0.0

🎉 Initial Release 🎉

  • Syntax definitions
  • Rust Analyzer integration
  • Error checking
  • Format on Save