Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"scope": "meta.corner-style.sublime-color-scheme",
"completions": [
{ "trigger": "cut\toptions value", "contents": "cut" },
{ "trigger": "round\toptions value", "contents": "round" },
{ "trigger": "square\toptions value", "contents": "square" },
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{ "trigger": "caret\tglobals key", "contents": "caret" },
{ "trigger": "find_highlight\tglobals key", "contents": "find_highlight" },
{ "trigger": "find_highlight_foreground\tglobals key", "contents": "find_highlight_foreground" },
{ "trigger": "fold_marker\tglobals key", "contents": "fold_marker" },
{ "trigger": "foreground\tglobals key", "contents": "foreground" },
{ "trigger": "guide\tglobals key", "contents": "guide" },
{ "trigger": "gutter\tglobals key", "contents": "gutter" },
Expand All @@ -28,6 +29,9 @@
{ "trigger": "rulers\tglobals key", "contents": "rulers" },
{ "trigger": "selection\tglobals key", "contents": "selection" },
{ "trigger": "selection_border\tglobals key", "contents": "selection_border" },
{ "trigger": "selection_corner_radius\tglobals key", "contents": "selection_corner_radius" },
{ "trigger": "selection_corner_style\tglobals key", "contents": "selection_corner_style" },
{ "trigger": "selection_border_width\tglobals key", "contents": "selection_border_width" },
{ "trigger": "shadow\tglobals key", "contents": "shadow" },
{ "trigger": "shadow_width\tglobals key", "contents": "shadow_width" },
{ "trigger": "stack_guide\tglobals key", "contents": "stack_guide" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{ "trigger": "caret\tglobals key", "contents": "\"caret\": \"$1\"," },
{ "trigger": "find_highlight\tglobals key", "contents": "\"find_highlight\": \"$1\"," },
{ "trigger": "find_highlight_foreground\tglobals key", "contents": "\"find_highlight_foreground\": \"$1\"," },
{ "trigger": "fold_marker\tglobals key", "contents": "\"fold_marker\": \"$1\"," },
{ "trigger": "foreground\tglobals key", "contents": "\"foreground\": \"$1\"," },
{ "trigger": "guide\tglobals key", "contents": "\"guide\": \"$1\"," },
{ "trigger": "gutter\tglobals key", "contents": "\"gutter\": \"$1\"," },
Expand All @@ -28,6 +29,9 @@
{ "trigger": "rulers\tglobals key", "contents": "\"rulers\": \"$1\"," },
{ "trigger": "selection\tglobals key", "contents": "\"selection\": \"$1\"," },
{ "trigger": "selection_border\tglobals key", "contents": "\"selection_border\": \"$1\"," },
{ "trigger": "selection_corner_radius\tglobals key", "contents": "\"selection_corner_radius\": \"${1:2}\"," },
{ "trigger": "selection_corner_style\tglobals key", "contents": "\"selection_corner_style\": \"${1:round}\"," },
{ "trigger": "selection_border_width\tglobals key", "contents": "\"selection_border_width\": \"${1:1}\"," },
{ "trigger": "shadow\tglobals key", "contents": "\"shadow\": \"$1\"," },
{ "trigger": "shadow_width\tglobals key", "contents": "\"shadow_width\": \"$1\"," },
{ "trigger": "stack_guide\tglobals key", "contents": "\"stack_guide\": \"$1\"," },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Sublime Text Color Scheme (JSON)
file_extensions:
- sublime-color-scheme
- hidden-color-scheme
scope: source.json.sublime.color-scheme

contexts:
Expand Down Expand Up @@ -201,20 +202,27 @@ contexts:
- include: expect-key-rest

globals-mapping-key:
- match: (")(accent|shadow|invisibles|caret|line_highlight|foreground|background|selection|selection_border|inactive_selection|inactive_selection_foreground|highlight|find_highlight|find_highlight_foreground|stack_guide|active_guide|guide|misspelling|brackets_foreground|bracket_contents_foreground|tags_foreground|minimap_border|gutter|gutter_foreground|rulers)(")
- match: (")(accent|shadow|invisibles|caret|line_highlight|foreground|background|selection|selection_border|inactive_selection|inactive_selection_foreground|highlight|find_highlight|find_highlight_foreground|stack_guide|active_guide|guide|misspelling|brackets_foreground|bracket_contents_foreground|tags_foreground|minimap_border|gutter|gutter_foreground|rulers|fold_marker)(")
scope: meta.mapping.key.json meta.globals-key.sublime-color-scheme string.quoted.double.json
captures:
1: punctuation.definition.string.begin.json
2: entity.name.globals.sublime-color-scheme
3: punctuation.definition.string.end.json
set: [expect-color-string-value, expect-colon]
- match: (")(shadow_width|popup_css|phantom_css)(")
- match: (")(popup_css|phantom_css)(")
scope: meta.mapping.key.json meta.globals-key.sublime-color-scheme string.quoted.double.json
captures:
1: punctuation.definition.string.begin.json
2: entity.name.globals.sublime-color-scheme
3: punctuation.definition.string.end.json
set: [expect-string-value, expect-colon]
- match: (")(shadow_width|selection_corner_radius|selection_border_width)(")
scope: meta.mapping.key.json meta.globals-key.sublime-color-scheme string.quoted.double.json
captures:
1: punctuation.definition.string.begin.json
2: entity.name.globals.sublime-color-scheme
3: punctuation.definition.string.end.json
set: [expect-possible-number-in-string-value, expect-colon]
- match: (")(implicit_selection_foreground)(")
scope: meta.mapping.key.json meta.globals-key.sublime-color-scheme string.quoted.double.json
captures:
Expand All @@ -229,6 +237,13 @@ contexts:
2: entity.name.globals.sublime-color-scheme
3: punctuation.definition.string.end.json
set: [expect-underlinestyle-string-value, expect-colon]
- match: (")(selection_corner_style)(")
scope: meta.mapping.key.json meta.globals-key.sublime-color-scheme string.quoted.double.json
captures:
1: punctuation.definition.string.begin.json
2: entity.name.globals.sublime-color-scheme
3: punctuation.definition.string.end.json
set: [expect-cornerstyle-string-value, expect-colon]
- include: in-dictionary-globals-key
- include: expect-mapping-rest

Expand Down Expand Up @@ -432,3 +447,42 @@ contexts:
- include: string-escape
- match: \b(true|false)\b
scope: support.constant.boolean-string.color-scheme

expect-cornerstyle-string-value:
- match: (?=")
set: [mapping-value-meta, cornerstyle-string-pop]
- include: expect-string-rest

cornerstyle-string-pop:
- match: \"
scope: punctuation.definition.string.begin.json
set:
- meta_scope: meta.corner-style.sublime-color-scheme string.quoted.double.json
- match: '"'
scope: punctuation.definition.string.end.json
pop: true
- match: $\n?
scope: invalid.illegal.unclosed-string.json
pop: true
- include: string-escape
- match: \b(square|cut|round)\b
scope: support.constant.corner-style.color-scheme

expect-possible-number-in-string-value:
- match: (?=")
set: [mapping-value-meta, possible-number-in-string-pop]
- include: expect-string-rest

possible-number-in-string-pop:
- match: \"
scope: punctuation.definition.string.begin.json
set:
- meta_scope: string.quoted.double.json
- match: '"'
scope: punctuation.definition.string.end.json
pop: true
- match: $\n?
scope: invalid.illegal.unclosed-string.json
pop: true
- include: string-escape
- include: Sublime JSON.sublime-syntax#number
17 changes: 17 additions & 0 deletions Package/Sublime Text Color Scheme/syntax_test_colorscheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,23 @@
// ^ punctuation.separator.mapping.key-value.json
// ^^^^^^ meta.mapping.value.json string.quoted.double.json
// ^ punctuation.separator.mapping.pair.json
"selection_border_width": "1",
// ^^^^^^^^^^^^^^^^^^^^^^ entity.name.globals.sublime-color-scheme
// ^^^ meta.mapping.value.json string.quoted.double.json
// ^ constant.numeric.json
"selection_border": "#ffffff40",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is missing teas.

Copy link
Member

@FichteFoll FichteFoll Apr 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was obviously meant to be "tests".

I'll just add them myself, unless you beat me to it.

// ^^^^^^^^^^^^^^^^ meta.globals-key string.quoted.double entity.name.globals
// ^^^^^^^^^ constant.other.color.rgba-value
"selection_corner_style": "round",
// ^^^^^^^^^^^^^^^^^^^^^^ entity.name.globals.sublime-color-scheme
// ^^^^^ support.constant.corner-style.color-scheme
"selection_corner_radius": "4",
// ^^^^^^^^^^^^^^^^^^^^^^^ entity.name.globals.sublime-color-scheme
// ^^^ meta.mapping.value.json string.quoted.double.json
// ^ constant.numeric.json
"fold_marker": "#ffcc00",
// ^^^^^^^^^^^ entity.name.globals.sublime-color-scheme
// ^^^^^^^ constant.other.color.rgb-value.css
},
// ^ punctuation.section.mapping.end.json
// ^ punctuation.separator.mapping.pair.json
Expand Down