Diagnostic Messages

There are a variety of ways to display Rust compiler messages. See Settings for more details about how to configure settings.

Inline Phantoms vs Output Panel

The show_errors_inline setting controls whether or not errors are shown inline with the code using Sublime's "phantoms". If it is true, it will also display an abbreviated message in the output panel. If it is false, messages will only be displayed in the output panel, using rustc's formatting.

show_errors_inline

ValueExample
trueinline true
falseinline false

Phantoms can be displayed inline with the code, or as a popup when the mouse hovers over an error (either the gutter icon or the error outline). The rust_phantom_style setting controls this behavior.

rust_phantom_style

ValueDescription
normalPhantoms are displayed inline.
popupPhantoms are displayed when the mouse hovers over an error.
nonePhantoms are not displayed.

popup phantom example

You can bind the rust_message_popup command to a keyboard shortcut to force a popup to open if there is a message under the cursor. Example:

{"keys": ["f8"], "command": "rust_message_popup", "context":
    [
        {"key": "selector", "operator":"equal", "operand": "source.rust"}
    ]
}

Phantom Themes

The style of the phantom messages is controlled with the rust_message_theme setting. Currently the following themes are available:

rust_message_theme

ValueExample
clearclear example
solidsolid example

Clear Theme Colors

The clear theme is designed to integrate with your chosen Color Scheme. You can customize the colors of the messages with the following settings.

SettingDefaultDescription
rust_syntax_error_color"var(--redish)"Color of error messages.
rust_syntax_warning_color"var(--yellowish)"Color of warning messages.
rust_syntax_note_color"var(--greenish)"Color of note messages.
rust_syntax_help_color"var(--bluish)"Color of help messages.

Region Highlighting

The span of code for a compiler message is by default highlighted with an outline.

rust_region_style

ValueExampleDescription
outlineoutlineRegions are highlighted with an outline.
solid_underlinesolid_underlineSolid underline.
stippled_underlinestippled_underlineStippled underline.
squiggly_underlinesquiggly_underlineSquiggly underline.
nonenoneRegions are not highlighted.

Gutter Images

The gutter (beside the line numbers) will include an icon indicating the level of the message. The styling of these icons is controlled with rust_gutter_style.

rust_gutter_style

ValueDescription
shapegutter shape
circlegutter circle
noneDo not display icons.

Other Settings

A few other settings are available for controlling messages:

SettingDefaultDescription
show_panel_on_buildtrueIf true, an output panel is displayed at the bottom of the window showing the compiler output.
rust_syntax_hide_warningsfalseIf true, will not display warning messages.
rust_message_status_barfalseIf true, will display the message under the cursor in the window status bar.
rust_message_status_bar_msg"Rust check runningThe message to display when the syntax check is running.
rust_message_status_bar_chars[".", "..", "...", ".."]The characters shown in the status bar while a check is running.
rust_message_status_bar_update_delay200How often (ms) should the status bar text be updated when syntax checking.