Skip to content

Commit d064ca9

Browse files
committed
Syntax: Fix lifetime for self in method.
1 parent d58fe85 commit d064ca9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

RustEnhanced.sublime-syntax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ contexts:
324324
scope: storage.modifier.rust
325325
- match: '@'
326326
scope: keyword.operator.rust
327+
- include: lifetime
327328
- match: '\b{{identifier}}\b(?!\s*(?:::|\{|\[|\())'
328329
scope: variable.parameter.rust
329330

tests/syntax-rust/syntax_test_functions.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,9 @@ const extern "C" fn f() {}
124124
// ^^^ string.quoted.double
125125
// ^^ meta.function storage.type.function
126126
// ^ meta.function entity.name.function
127+
128+
fn foo(&'a self) {}
129+
// ^^^^^^^^ meta.function meta.function.parameters
130+
// ^ keyword.operator
131+
// ^^ storage.modifier.lifetime
132+
// ^^^^ variable.parameter

0 commit comments

Comments
 (0)