diff --git a/LESS.sublime-syntax b/LESS.sublime-syntax index 822dc10..074096b 100644 --- a/LESS.sublime-syntax +++ b/LESS.sublime-syntax @@ -173,28 +173,39 @@ contexts: - include: pseudo-elements - include: pseudo-classes - include: selector - - match: '\[' - scope: punctuation.definition.entity.css - push: - - meta_scope: meta.attribute-selector.css - - include: qualified-name - - match: '({{ident}})' - scope: entity.other.attribute-name.css - - match: '\s*([~*|^$]?=)\s*' - captures: - 1: keyword.operator.attribute-selector.css - push: - - match: '[^\s\]\[''"]' - scope: string.unquoted.css - - include: literal-string - - match: '(?=(\s|\]))' - pop: true - - match: '(?:\s+([iI]))?' # case insensitive flag - captures: - 1: keyword.other.css - - match: '\]' - scope: punctuation.definition.entity.css - pop: true + - match: '(?=\[)' + push: + - meta_scope: meta.selector.css + - match: \s*(?=$) + pop: true + - match: '(?=[{)])' + pop: true + - match: '\[' + scope: punctuation.definition.entity.css + push: + - meta_scope: meta.attribute-selector.css + - include: qualified-name + - match: '({{ident}})' + scope: entity.other.attribute-name.css + - match: '\s*([~*|^$]?=)\s*' + captures: + 1: keyword.operator.attribute-selector.css + push: + - match: '[^\s\]\[''"]' + scope: string.unquoted.css + - include: literal-string + - match: '(?=(\s|\]))' + pop: true + - match: '(?:\s+([iI]))?' # case insensitive flag + captures: + 1: keyword.other.css + - match: '\]' + scope: punctuation.definition.entity.css + pop: true + - include: less-interpolation + - include: pseudo-elements + - include: pseudo-classes + - include: selector - include: less-operators diff --git a/syntax_test_less.less b/syntax_test_less.less index 5284286..e92dd7d 100755 --- a/syntax_test_less.less +++ b/syntax_test_less.less @@ -11,6 +11,19 @@ background-color: pink; // ^^^^^^^^^^^^^^^ meta.property-name.css // ^^^^^ meta.property-value.css + &-bemish { } +//^ keyword.operator.ampersand.less +// ^^^^^^^ entity.other.attribute-name.css +// ^^^^^^^^ meta.selector.css + [data-type="text"]:hover, +//^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector +// ^^^^^^ entity.other.pseudo-class.css +// ^ punctuation.definition.entity.css +// ^ punctuation.separator.css + [data-type="text"]:active {} +//^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector +// ^^^^^^^ entity.other.pseudo-class.css +// ^ punctuation.definition.entity.css #id@{interopol} background: bla