Skip to content

Commit f55441f

Browse files
committed
Document reference highlighting mod
1 parent 294cfd6 commit f55441f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

crates/ide/src/syntax_highlighting.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ pub struct HlRange {
138138
// injected:: Emitted for doc-string injected highlighting like rust source blocks in documentation.
139139
// intraDocLink:: Emitted for intra doc links in doc-strings.
140140
// library:: Emitted for items that are defined outside of the current crate.
141+
// mutable:: Emitted for mutable locals and statics as well as functions taking `&mut self`.
141142
// public:: Emitted for items that are from the current crate and are `pub`.
142-
// mutable:: Emitted for mutable locals and statics.
143+
// reference: Emitted for locals behind a reference and functions taking `self` by reference.
143144
// static:: Emitted for "static" functions, also known as functions that do not take a `self` param, as well as statics and consts.
144145
// trait:: Emitted for associated trait items.
145146
// unsafe:: Emitted for unsafe operations, like unsafe function calls, as well as the `unsafe` token.

crates/ide/src/syntax_highlighting/tags.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ pub enum HlTag {
4545
pub enum HlMod {
4646
/// Used for items in traits and impls.
4747
Associated = 0,
48+
/// Used with keywords like `async` and `await`.
49+
Async,
4850
/// Used to differentiate individual elements within attributes.
4951
Attribute,
5052
/// Callable item or value.
@@ -62,20 +64,18 @@ pub enum HlMod {
6264
Injected,
6365
/// Used for intra doc links in doc injection.
6466
IntraDocLink,
67+
/// Used for items from other crates.
68+
Library,
6569
/// Mutable binding.
6670
Mutable,
71+
/// Used for public items.
72+
Public,
6773
/// Immutable reference.
6874
Reference,
6975
/// Used for associated functions.
7076
Static,
7177
/// Used for items in traits and trait impls.
7278
Trait,
73-
/// Used with keywords like `async` and `await`.
74-
Async,
75-
/// Used for items from other crates.
76-
Library,
77-
/// Used for public items.
78-
Public,
7979
// Keep this last!
8080
/// Used for unsafe functions, unsafe traits, mutable statics, union accesses and unsafe operations.
8181
Unsafe,

0 commit comments

Comments
 (0)