-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathSublime Text Settings.sublime-syntax
More file actions
82 lines (71 loc) · 2.52 KB
/
Sublime Text Settings.sublime-syntax
File metadata and controls
82 lines (71 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
%YAML 1.2
---
name: Sublime Text Settings (JSON)
file_extensions:
- sublime-settings
- sublime-settings-hints
scope: source.json.sublime.settings
contexts:
main:
- match: (?=\{)
push: [only-comments, main-mapping-pop]
- include: expect-mapping-rest
main-mapping-pop:
- match: \{
scope: punctuation.section.mapping.begin.json
set:
- meta_scope: meta.settings-mapping.sublime-settings meta.mapping.json
- match: \}
scope: punctuation.section.mapping.end.json
pop: true
- match: (?=")
push: [in-mapping-expect-comma, main-key]
- include: expect-key-rest
main-key:
- clear_scopes: 1
- match: '"'
scope: punctuation.definition.string.begin.json
set:
- clear_scopes: 1
- meta_scope: meta.mapping.key.json string.quoted.double.json
- meta_content_scope: entity.name.other.key.sublime-settings
# we need to set another context to not have meta_content_scope
# affect the closing quotation mark
- match: (?=")
set:
- clear_scopes: 1
- match: '"'
scope: meta.mapping.key.json string.quoted.double.json punctuation.definition.string.end.json
set: [expect-any-settings-value, expect-colon]
- include: inside-string
- match: '[\w]+(\.)(?![\d.]+\")'
scope: keyword.other.namespace.sublime-settings
captures:
1: punctuation.separator.namespace.sublime-settings
comments:
- include: Sublime JSON.sublime-syntax#comments
only-comments:
- include: Sublime JSON.sublime-syntax#only-comments
expect-colon:
- include: Sublime JSON.sublime-syntax#expect-colon
expect-any-settings-value:
- match: ''
set:
- meta_content_scope: meta.expect-value.sublime-settings
- include: comments
- match: (?=\S)
set: [settings-mapping-value-meta, Sublime JSON.sublime-syntax#expect-any-value]
- include: Sublime JSON.sublime-syntax#expect-any-value
settings-mapping-value-meta:
- clear_scopes: 1
- meta_scope: meta.setting-value.sublime-settings dummy # 'dummy' will be cleared
- match: ''
pop: true
expect-mapping-rest:
- include: Sublime JSON.sublime-syntax#expect-mapping-rest
expect-key-rest:
- include: Sublime JSON.sublime-syntax#expect-key-rest
inside-string:
- include: Sublime JSON.sublime-syntax#inside-string
in-mapping-expect-comma:
- include: Sublime JSON.sublime-syntax#in-mapping-expect-comma