Skip to content

Commit 247ffbe

Browse files
ehussJayflux
authored andcommitted
Update message formatting. (#201)
* Remove pprint debug which can cause hangs in large macro expansions. * Add "in this macro invocation" note for macro call sites. * Show note and help messages in a separate color. * Make "in this macro invocation" message at "help" level. * Add cross-links between messages if they are far apart. This also fixes the primary message showing out-of-order. * Better support for messages with macro expansion. Handle macros defined outside of the current crate, and display a message alerting about the macro. * Fix thread deadlock in test. * Prevent multiple note links to the same location from appearing. * Add gutter icons to messages. * Fix erroneous comments. * Don't repeat message level for subsequent messages. * Display messages flush-left. This should make it easier to read so that message does not scroll off to the right too far. * Update test messages for new format (and newer rustc). * Add tests for macro expansion within a crate. * Add test for error messages that cross modules. * Add test for macro expansion with attribute. * Remove nbsp formatting in messages. * Include message level on sub-messages in other files. * Fix rust_gutter_style set to 'none'.
1 parent 73e9713 commit 247ffbe

40 files changed

+678
-183
lines changed

RustEnhanced.sublime-settings

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
// If true, will not display warning messages.
1414
"rust_syntax_hide_warnings": false,
1515

16-
// Color of error messages.
17-
"rust_syntax_error_color": "#F00",
18-
19-
// Color of warning messages.
20-
"rust_syntax_warning_color":"#FF0",
16+
// Color of messages.
17+
// These use CSS colors. See
18+
// https://www.sublimetext.com/docs/3/minihtml.html for more detail.
19+
"rust_syntax_error_color": "var(--redish)",
20+
"rust_syntax_warning_color": "var(--yellowish)",
21+
"rust_syntax_note_color": "var(--greenish)",
22+
"rust_syntax_help_color": "var(--bluish)",
2123

2224
// Specify environment variables to add when running Cargo.
2325
// "rust_env": {"PATH": "$PATH:$HOME/.cargo/bin"}
@@ -36,6 +38,12 @@
3638
// "none" - No outlining.
3739
"rust_region_style": "outline",
3840

41+
// For errors/warnings, what kind of icon to use in the gutter.
42+
// "shape" - Shape-based icons.
43+
// "circle" - Simple circle icons.
44+
// "none" - Do not place icons in the gutter.
45+
"rust_gutter_style": "shape",
46+
3947
// If your cargo project has several build targets, it's possible to specify mapping of
4048
// source code filenames to the target names to enable syntax checking.
4149
// "projects": {

docs/build.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ General settings (see [Settings](../README.md#settings)) for how messages are di
4949
| Setting | Default | Description |
5050
| :------ | :------ | :---------- |
5151
| `rust_syntax_hide_warnings` | `false` | If true, will not display warning messages. |
52-
| `rust_syntax_error_color` | `"#F00"` | Color of error messages. |
53-
| `rust_syntax_warning_color` | `"#FF0"` | Color of warning messages. |
52+
| `rust_syntax_error_color` | `"var(--redish)"` | Color of error messages. |
53+
| `rust_syntax_warning_color` | `"var(--yellowish)"` | Color of warning messages. |
54+
| `rust_syntax_note_color` | `"var(--greenish)"` | Color of note messages. |
55+
| `rust_syntax_help_color` | `"var(--bluish)"` | Color of help messages. |
5456
| `rust_phantom_style` | `"normal"` | How to display inline messages. Either `normal` or `none`. |
5557
| `rust_region_style` | `"outline"` | How to highlight messages. Either `outline` or `none`. |
58+
| `rust_gutter_style` | `"shape"` | Type of icon to show in the gutter. Either `shape`, `circle`, or `none`. |
5659

5760
It also supports Sublime's build settings:
5861

images/gutter/circle-error.png

776 Bytes
Loading

images/gutter/[email protected]

1.21 KB
Loading

images/gutter/circle-help.png

788 Bytes
Loading

images/gutter/[email protected]

1.23 KB
Loading

images/gutter/circle-note.png

704 Bytes
Loading

images/gutter/[email protected]

1.01 KB
Loading

images/gutter/circle-warning.png

727 Bytes
Loading

images/gutter/[email protected]

1.11 KB
Loading

images/gutter/shape-error.png

338 Bytes
Loading

images/gutter/[email protected]

484 Bytes
Loading

images/gutter/shape-help.png

501 Bytes
Loading

images/gutter/[email protected]

1 KB
Loading

images/gutter/shape-note.png

312 Bytes
Loading

images/gutter/[email protected]

840 Bytes
Loading

images/gutter/shape-warning.png

359 Bytes
Loading

images/gutter/[email protected]

793 Bytes
Loading

0 commit comments

Comments
 (0)