Skip to content

Commit

Permalink
[JSON] fix scopes: curly braces, square brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
jrappen committed Oct 24, 2021
1 parent 969abe8 commit ecd520b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions JSON/JSON (Basic).sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ contexts:

sequence:
- match: \[
scope: punctuation.section.sequence.begin.json
scope: punctuation.definition.sequence.begin.json
push: inside-sequence

inside-sequence:
- meta_scope: meta.sequence.json
- match: \]
scope: punctuation.section.sequence.end.json
scope: punctuation.definition.sequence.end.json
pop: 1
- include: any
- match: ','
Expand All @@ -140,13 +140,13 @@ contexts:

mapping:
- match: \{
scope: punctuation.section.mapping.begin.json
scope: punctuation.definition.mapping.begin.json
push: inside-mapping

inside-mapping:
- meta_scope: meta.mapping.json
- match: \}
scope: punctuation.section.mapping.end.json
scope: punctuation.definition.mapping.end.json
pop: 1
- match: '"'
scope: punctuation.definition.string.begin.json
Expand Down
4 changes: 2 additions & 2 deletions JSON/tests/syntax/syntax_test_jsonc.invalids.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

"d": { "d": },
// ^ meta.mapping.value meta.mapping invalid.illegal.expected-mapping-value
// ^ meta.mapping.value meta.mapping punctuation.section.mapping.end
// ^ meta.mapping.value meta.mapping punctuation.definition.mapping.end

"e": { "e":
},
// ^ invalid.illegal.expected-mapping-value
// ^ punctuation.section.mapping.end
// ^ punctuation.definition.mapping.end

[],
// ^^^ invalid.illegal.expected-mapping-key
Expand Down
12 changes: 6 additions & 6 deletions JSON/tests/syntax/syntax_test_jsonc.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// <- source.json.jsonc

{
// <- meta.mapping punctuation.section.mapping.begin
// <- meta.mapping punctuation.definition.mapping.begin

"dict": { "key": "value" }
// ^^^^^^^^^^^^^^^^^^ meta.mapping.value meta.mapping - meta.mapping meta.mapping meta.mapping
// ^ punctuation.section.mapping.begin
// ^ punctuation.section.mapping.end
// ^ punctuation.definition.mapping.begin
// ^ punctuation.definition.mapping.end
// ^^ meta.mapping.value meta.mapping
// ^^^^^ meta.mapping.key string.quoted.double
// ^^ meta.mapping.value meta.mapping
Expand All @@ -22,9 +22,9 @@

"array": [ /**/ ],
// ^^^^^^^^ meta.mapping.value meta.sequence
// ^ punctuation.section.sequence.begin
// ^ punctuation.definition.sequence.begin
// ^^^^ comment.block
// ^ punctuation.section.sequence.end
// ^ punctuation.definition.sequence.end

"dict": {"foo"/*comment*/:/*comment*/"bar"/*comment*/},
// ^^^^^^^^^^^ comment.block
Expand All @@ -43,7 +43,7 @@
// ^ - invalid
// ^^^^^^^^^^^^^ comment.block
},
//^ punctuation.section.mapping.end
//^ punctuation.definition.mapping.end
// ^ punctuation.separator.mapping.pair

"string": "string",
Expand Down

0 comments on commit ecd520b

Please sign in to comment.