ctrl+shift+p filters: :st2 :st3 :win :osx :linux

Rust Enhanced

by rust-lang ST3

The official Sublime Text 3 package for the Rust Programming Language


  • 2.24.0
  • github.​com
  • github.​com
  • 2 months ago
  • 30 minutes ago
  • 9 years ago


  • Total 84K
  • Win 28K
  • Mac 28K
  • Linux 28K
Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14
Windows 1 8 9 11 9 6 6 5 5 11 4 4 7 9 3 9 11 14 6 9 7 15 8 10 12 10 8 14 10 12 9 11 8 12 11 6 13 9 9 14 12 11 14 16 10 10
Mac 4 5 9 11 8 4 5 12 9 7 6 7 9 9 9 9 6 7 6 4 7 12 3 5 8 9 6 8 8 10 7 10 8 11 3 5 6 5 10 13 9 5 7 13 9 16
Linux 2 13 14 8 9 11 12 7 10 13 10 8 10 14 10 9 10 14 8 11 18 9 10 13 10 12 16 15 12 10 8 9 11 10 17 11 14 11 14 7 15 12 8 9 5 16



Rust Enhanced


This is a Sublime Text 3 package which supports Rust starting with version 1.0, it makes no attempt at supporting earlier incompatible versions.

This package used to be called 'Rust', but as of version 3, Sublime now comes with Rust built-in. The built-in version on Sublime is actually just a snapshot of this package with some fixes from quite some time ago. This package is still active and will continue to update and release, so if you want up to date features, and extra tools (such as syntax checking or building) we recommend using this package. Installing Rust Enhanced will automatically disable the built-in “Rust” package. If you receive any error, verify that “Rust Enhanced” is enabled, and that the current view's syntax is set to “Rust Enhanced”. There is currently no plan to push upstream changes back into the Sublime Core Packages repo, and extra features will stay here.

For syntax highlighting for Cargo files. Its recommended installing this with the TOML package.

Running Tests with Rust Enhanced Highlighting errors and warnings with Rust Enhanced


Install the Package Control package if you haven't got it yet. Package Control is the best way to install packages for Sublime Text. See http://wbond.net/sublime_packages/package_control/installation for instructions.

Open the palette (control+shift+P or command+shift+P) in Sublime Text and select Package Control: Install Package and then select Rust Enhanced from the list. That's it. If you can't see Rust Enhanced its most likely because you're using Sublime Text 2.


Go To Definition

Cargo Build

Rust Enhanced has a custom build system tailored for running Cargo. It will display errors and warnings in line using Sublime's phantoms (see Messages for settings to control how messages are displayed). It also supports a variety of configuration options to control how Cargo is run.


See the build docs for more information.

Cargo tests with highlighting

Thanks to urschrei we have Highlighting for: - passed test - failed test - failed test source line (clickable) - total number of passed tests - total number of failed tests > 0 - total number of ignored tests > 0 - total number of measured tests > 0



Syntax Checking

Rust Enhanced will automatically perform syntax checking each time you save a file. Errors and warnings are displayed in line the same way as the build system. This relies on Cargo and Rust (>= 1.8.0) being installed and on your system path. Plus Sublime Text >= 3118.

Settings for controlling the on-save syntax checking:

Setting Default Description
rust_syntax_checking true Enable the on-save syntax checking.
rust_syntax_checking_method "check" The method used for checking your code (see below).
rust_syntax_checking_include_tests true Enable checking of test code within #[cfg(test)] sections.
rust_syntax_hide_warnings false Don't show warnings when syntax checking

The available checking methods are:

Method Description
check Uses cargo check (requires at least Rust 1.16).
clippy Uses cargo clippy. This requires Clippy to be installed. This also may be a little slower since it must check every target in your package.

This will use the same configuration options as the “Check” and “Clippy” build variants (for example, extra environment variables, or checking with different features). See the build docs for more information.

Projects with multiple build targets are supported too (–lib, –bin, –example, etc.). If a cargo project has several build targets, it will attempt to automatically detect the correct target. In some rare cases, you may need to manually specify which target a file belongs to. This can be done by adding a “projects” setting in Rust.sublime-settings with the following format:

"projects": {
       // One entry per project. Keys are project names.
       "my_cool_stuff": {
           // Path to the project root dir without trailing /src.
           "root": "/path/to/my/cool/stuff/project",

           // Targets will be used to replace {target} part in the command.
           // If no one target matches an, empty string will be used.
           "targets": {
               "bin/foo.rs": "--bin foo",  // format is "source_code_filename -> target_name"
               "bin/bar.rs": "--bin bar",
               "_default": "--lib"         // or "--bin main"

Language Servers

Language servers can provide Rust-specific diagnostics, helpers, and navigation. There are two language server implementations for Rust:

RLS is being replaced by rust-analyzer, but may provide better support at this time depending on your needs.

To use one of the language servers, you need to install the Sublime LSP plugin. With both the plugin and one of the above servers installed, you should be able to follow the LSP docs for how to configure the server. Generally this involves running either the LSP: Enable Language Server Globally or LSP: Enable Language Server in Project and then selecting either rls or rust-analyzer. Depending on the size of your project, it may take some time for it to process and index.

Note that as well as error checking, code-completion, and renaming, RLS can run rustfmt on your code: right-click, and select LSP > Format Document or Format Selection in a Rust source file.

Context Menu

The Sublime context menu includes a Rust entry with a variety of commands. See context menu docs for more information.


To customize the settings, use the command from the Sublime menu:

Preferences > Package Settings > Rust Enhanced > Settings - User

Additionally, you can customize settings per-project by adding settings to your .sublime-project file under the "settings" key.


Development is quite simple, just check out this project to your Sublime Text 3 packages folder, and switch to using this one. Syntax definitions are defined in the RustEnhanced.sublime-syntax file.


Created 2012 by Daniel Patterson, as a near complete from scratch rewrite of a package by Felix Martini.

This project is currently maintained by Jason Williams


This package is licensed under the MIT License.