From e3592fad38699dd66a6243f6a0746b2da66787e1 Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Sat, 8 Dec 2018 22:17:49 +0100 Subject: [PATCH] support interpolated property names --- Syntaxes/LESS.sublime-syntax | 10 ++++++++++ Tests/syntax_test_less.less | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/Syntaxes/LESS.sublime-syntax b/Syntaxes/LESS.sublime-syntax index 6ab7963..c922cfb 100644 --- a/Syntaxes/LESS.sublime-syntax +++ b/Syntaxes/LESS.sublime-syntax @@ -633,6 +633,16 @@ contexts: 2: support.type.custom-property.name.css push: - include: property-value-wrapper + - match: '[a-zA-Z0-9_-]*((@)({)([a-zA-Z0-9_-][\w-]*)(}))[a-zA-Z0-9_-]*' + captures: + 0: meta.property-name.css support.type.property-name + 1: variable.other.less + 2: punctuation.definition.variable.less + 3: punctuation.definition.string.begin.less + 4: string.interpolated.less + 5: punctuation.definition.string.end.less + push: + - include: property-value-wrapper property-value-wrapper: - match: '(\s*)(;)' diff --git a/Tests/syntax_test_less.less b/Tests/syntax_test_less.less index 28b0b04..b0cab04 100755 --- a/Tests/syntax_test_less.less +++ b/Tests/syntax_test_less.less @@ -260,6 +260,17 @@ http://lesscss.org/features/#variables-feature-variable-interpolation // ^ punctuation.definition.string.begin.less // ^ string.interpolated.less // ^ punctuation.definition.string.end.less + @{property}: #0ee; +// ^^^^^^^^^^^ meta.property-name +// ^^^^^^^^^^^ variable.other + background-@{property}: #999; +// ^ - variable.other +// ^^^^^^^^^^^ variable.other +// ^^^^^^^^^^^^^^^^^^^^^^ meta.property-name + @{property}-color: #999; +// ^^^^^^^^^^^^^^^^^ meta.property-name +// ^^^^^^^^^^^ variable.other +// ^ - variable.other animation : progress-fade-in-animation .15s ease-in; // ^ meta.property-value.css // ^ string.unquoted.css