diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-19 12:27:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-19 12:27:02 +0100 |
commit | 529ca7e5e0573e15b23cd0067a691bf1ffebae84 (patch) | |
tree | 0cc09513805718a7c31cadb1776ff4eb865caaef /crates/ide/src/syntax_highlighting/tags.rs | |
parent | c1cfd010096daa85f8acd6f1ea15d92097816e14 (diff) | |
parent | 3456e2eec7c1e18734f8fa41924a83b4c676dc00 (diff) |
Merge #5643
5643: Add new consuming modifier, apply consuming and mutable to methods r=matklad a=Nashenas88
This adds a new `consuming` semantic modifier for syntax highlighters.
This also emits `mutable` and `consuming` in two cases:
- When a method takes `&mut self`, then it now has `function.mutable` emitted.
- When a method takes `self`, and the type of `Self` is not `Copy`, then `function.consuming` is emitted.
CC @flodiebold
Co-authored-by: Paul Daniel Faria <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tags.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tags.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tags.rs b/crates/ide/src/syntax_highlighting/tags.rs index 49ec94bdc..c1b817f06 100644 --- a/crates/ide/src/syntax_highlighting/tags.rs +++ b/crates/ide/src/syntax_highlighting/tags.rs | |||
@@ -62,6 +62,7 @@ pub enum HighlightModifier { | |||
62 | Documentation, | 62 | Documentation, |
63 | Injected, | 63 | Injected, |
64 | Mutable, | 64 | Mutable, |
65 | Consuming, | ||
65 | Unsafe, | 66 | Unsafe, |
66 | } | 67 | } |
67 | 68 | ||
@@ -119,6 +120,7 @@ impl HighlightModifier { | |||
119 | HighlightModifier::Documentation, | 120 | HighlightModifier::Documentation, |
120 | HighlightModifier::Injected, | 121 | HighlightModifier::Injected, |
121 | HighlightModifier::Mutable, | 122 | HighlightModifier::Mutable, |
123 | HighlightModifier::Consuming, | ||
122 | HighlightModifier::Unsafe, | 124 | HighlightModifier::Unsafe, |
123 | ]; | 125 | ]; |
124 | 126 | ||
@@ -130,6 +132,7 @@ impl HighlightModifier { | |||
130 | HighlightModifier::Documentation => "documentation", | 132 | HighlightModifier::Documentation => "documentation", |
131 | HighlightModifier::Injected => "injected", | 133 | HighlightModifier::Injected => "injected", |
132 | HighlightModifier::Mutable => "mutable", | 134 | HighlightModifier::Mutable => "mutable", |
135 | HighlightModifier::Consuming => "consuming", | ||
133 | HighlightModifier::Unsafe => "unsafe", | 136 | HighlightModifier::Unsafe => "unsafe", |
134 | } | 137 | } |
135 | } | 138 | } |