Skip to content

Commit

Permalink
fix meta scopes on declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
braver committed Feb 19, 2024
1 parent 9d54225 commit e7a3531
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Syntaxes/SCSS.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,14 @@ contexts:
scss-declaration:
- match: '(\$)([a-zA-Z0-9_-][\w-]*)(?=:)'
captures:
0: variable.declaration.scss
0: meta.declaration.identifier.scss variable.other.scss
1: punctuation.definition.variable.scss
push:
- include: terminator-pop
- match: ':'
scope: punctuation.separator.key-value.css
push:
- meta_scope: meta.declaration.value.scss
- include: comments
- include: terminator-pop
- include: values
Expand Down
26 changes: 15 additions & 11 deletions Tests/syntax_test_scss.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ title: Blogging Like a Hacker
//=============================================================================
.circle {
$size: 100px;
//^^^^^ variable.declaration.scss
//^^^^^ variable.other.scss
//^ punctuation.definition.variable.scss
// ^ punctuation.separator.key-value.css
// ^^^^^ meta.declaration.value.scss
// ^ - meta.declaration.value.scss
// ^^^^^ meta.number.integer.decimal.css
// ^^^ constant.numeric.value.css
// ^^ constant.numeric.suffix.css
Expand Down Expand Up @@ -327,11 +329,13 @@ $warn: #dfa612;
// https://sass-lang.com/documentation/variables/
//=============================================================================
$base-color: #c6538c;
// ^^^^^^^^ variable.declaration.scss
// ^ - variable.declaration.scss
// ^^^^^^^^ meta.declaration.identifier.scss variable.other.scss
// ^ - variable.other.scss
//<- punctuation.definition.variable.scss
$border-dark: rgba($base-color, 0.88);
// ^^^^^^^^^ variable.declaration.scss
// ^^^^^^^^^ meta.declaration.identifier.scss variable.other.scss
// ^^^^^^^^^^^^^^^^^^^^^^^ meta.declaration.value.scss
// ^ - meta.declaration.value.scss
// ^ - variable.other.scss
//<- punctuation.definition.variable.scss
// ^^^^^^^^^^^ variable.other.scss
Expand Down Expand Up @@ -435,7 +439,7 @@ $variable: first global value;
// ^^^^ keyword.control.with.scss
// ^ punctuation.section.group.begin.scss
$black: #222,
//^^^^^^ variable.declaration.scss
//^^^^^^ meta.declaration.identifier.scss variable.other.scss
// ^^^^ constant.other.color
// ^ punctuation.separator.sequence.css

Expand Down Expand Up @@ -648,7 +652,7 @@ nav ul {
// ^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.scss
// ^^^^^ constant.numeric
// ^ punctuation.separator.sequence.css
// ^^^^^^^ variable.declaration.scss
// ^^^^^^^ variable.other.scss
// ^ punctuation.separator.key-value.css
// ^^^ constant.numeric
// ^ punctuation.section.group.end.scss
Expand Down Expand Up @@ -690,13 +694,13 @@ nav ul {
@include syntax-colors(
$string: #080,
//^^^^^^^^^^^^^^ meta.function-call.arguments.scss
//^^^^^^^ variable.declaration.scss
//^^^^^^^ meta.declaration.identifier.scss variable.other.scss
// ^ punctuation.separator.key-value.css
// ^^^^ constant.other.color
// ^ punctuation.separator.sequence
$comment: #800,
//^^^^^^^^^^^^^^ meta.function-call.arguments.scss
//^^^^^^^^ variable.declaration.scss
//^^^^^^^^^^^^^^ meta.function-call.arguments.scss
//^^^^^^^^ meta.declaration.identifier.scss variable.other.scss
// ^ punctuation.separator.key-value.css
// ^^^^ constant.other.color
// ^ punctuation.separator.sequence
Expand Down Expand Up @@ -840,7 +844,7 @@ $primary-color: #036;
// ^^^^^^^^^^^^ variable.other.scss
// ^ punctuation.definition.variable.scss
// ^ punctuation.separator.sequence
// ^^^^^^^^^ variable.declaration.scss
// ^^^^^^^^^ variable.other.scss
// ^ punctuation.definition.variable.scss
// ^ punctuation.separator.key-value.css
// ^^^^ meta.number
Expand Down Expand Up @@ -1159,7 +1163,7 @@ $sizes: 40px, 50px, 80px;

// https://sass-lang.com/documentation/at-rules/control/each/#with-maps
$icons: ("eye": "\f112", "start": "\f12e", "stop": "\f12f");
// ^^^ variable.declaration.scss
// ^^^ meta.declaration.identifier.scss variable.other.scss
// ^ punctuation.separator.key-value.css
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.css meta.map.arguments.scss
// ^ punctuation.section.group.begin.scss
Expand Down

0 comments on commit e7a3531

Please sign in to comment.