Skip to content

Commit

Permalink
Merge #179: "keyfiles" and "cancel" build sys keys
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Feb 11, 2018
2 parents fa94b3a + 46d97fd commit 29ad5dd
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"completions": [
{ "trigger": "selector\tmain key", "contents": "selector" },
{ "trigger": "variants\tmain key", "contents": "variants" },
{ "trigger": "keyfiles\tmain key", "contents": "keyfiles" },
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"completions": [
{ "trigger": "selector\tmain key", "contents": "\"selector\": \"$1\",$0" },
{ "trigger": "variants\tmain key", "contents": "\"variants\": [\n\t$0\n]," },
{ "trigger": "keyfiles\tmain key", "contents": "\"keyfiles\": [\"$0\"]," },
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ contexts:
2: keyword.other.main.sublime-build
3: punctuation.definition.string.end.json
set: [expect-variants-sequence-value, expect-colon]
- match: (")(keyfiles)(")
scope: meta.mapping.key.json meta.main-key.sublime-build string.quoted.double.json
captures:
1: punctuation.definition.string.begin.json
2: keyword.other.main.sublime-build
3: punctuation.definition.string.end.json
set: [expect-keyfiles-sequence-value, expect-colon]
- include: target-key
- include: exec-args-key
- include: platform-key
Expand Down Expand Up @@ -86,7 +93,7 @@ contexts:
1: punctuation.definition.string.begin.json
2: keyword.other.main.sublime-build
3: punctuation.definition.string.end.json
set: [expect-command-name-value, expect-colon]
set: [expect-command-name-or-dict-value, expect-colon]

exec-args-key:
- match: (")(cmd)(")
Expand Down Expand Up @@ -375,6 +382,23 @@ contexts:
pop: true
- include: string-escape

expect-keyfiles-sequence-value:
- match: (?=\[)
set: [mapping-value-meta, keyfiles-sequence-pop]
- include: expect-sequence-rest

keyfiles-sequence-pop:
- match: \[
scope: punctuation.section.sequence.begin.json
set:
- meta_scope: meta.sequence.json meta.keyfiles.collection.sublime-build
- include: comments
- match: \]
scope: punctuation.section.sequence.end.json
pop: true
- match: (?=\S)
push: [in-sequence-expect-comma, Sublime JSON.sublime-syntax#expect-string]

comments:
- include: Sublime JSON.sublime-syntax#comments

Expand Down Expand Up @@ -423,6 +447,10 @@ contexts:
expect-command-name-value:
- include: Sublime JSON.sublime-syntax#expect-command-name-value

expect-command-name-or-dict-value:
- include: Sublime JSON.sublime-syntax#command-name-pop
- include: expect-mapping-value

mapping-value-meta:
- clear_scopes: 1
- meta_scope: meta.mapping.value.json
Expand Down
18 changes: 17 additions & 1 deletion Package/Sublime Text Build System/syntax_test_build_system.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
// ^^^^^^ string.unquoted.scope-segment.scope-selector
// ^ punctuation.separator.scope-segments.scope-selector
// ^^^^^^ string.unquoted.scope-segment.scope-selector
"keyfiles": ["Make"],
// ^^^^^^^^^^ meta.mapping.key.json meta.main-key.sublime-build string.quoted.double.json
// ^^^^^^^^ keyword.other.main.sublime-build
// ^ punctuation.separator.mapping.key-value.json
// ^^^^^^^^ meta.keyfiles.collection.sublime-build
// ^ punctuation.section.sequence.begin.json
// ^^^^^^ string.quoted.double.json
// ^ punctuation.section.sequence.end.json
// ^ meta.mapping.json meta.expect-comma.sublime punctuation.separator.mapping.pair.json - meta.keyfiles

"other_key": "value",
// ^^^^^^^^^^^ meta.mapping.key.json meta.main-key.sublime-build string.quoted.double.json
Expand Down Expand Up @@ -162,7 +171,14 @@
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ source.regexp.embedded.json-string
},
},
]
],

"cancel": "cancel_build",
// ^^^^^^ keyword.other.main.sublime-build
// ^^^^^^^^^^^^ support.constant.command-name.sublime
"cancel": {"kill": true},
// ^^^^^^ meta.mapping.key.json string.quoted.double.json
// ^^^^ constant.language.boolean.json
}

,[]//fgfg
Expand Down

0 comments on commit 29ad5dd

Please sign in to comment.