From d064ca9e982b08816b40644cb7e4d0737dc2e0ba Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 21 Jan 2019 18:20:30 -0800 Subject: [PATCH] Syntax: Fix lifetime for `self` in method. --- RustEnhanced.sublime-syntax | 1 + tests/syntax-rust/syntax_test_functions.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RustEnhanced.sublime-syntax b/RustEnhanced.sublime-syntax index f994d1da..e81d4ad1 100644 --- a/RustEnhanced.sublime-syntax +++ b/RustEnhanced.sublime-syntax @@ -324,6 +324,7 @@ contexts: scope: storage.modifier.rust - match: '@' scope: keyword.operator.rust + - include: lifetime - match: '\b{{identifier}}\b(?!\s*(?:::|\{|\[|\())' scope: variable.parameter.rust diff --git a/tests/syntax-rust/syntax_test_functions.rs b/tests/syntax-rust/syntax_test_functions.rs index e3421d1e..259ae88b 100644 --- a/tests/syntax-rust/syntax_test_functions.rs +++ b/tests/syntax-rust/syntax_test_functions.rs @@ -124,3 +124,9 @@ const extern "C" fn f() {} // ^^^ string.quoted.double // ^^ meta.function storage.type.function // ^ meta.function entity.name.function + +fn foo(&'a self) {} +// ^^^^^^^^ meta.function meta.function.parameters +// ^ keyword.operator +// ^^ storage.modifier.lifetime +// ^^^^ variable.parameter