Skip to content

Commit c352eb6

Browse files
committed
Merge branch 'syntax/settings'
2 parents 9937ad3 + 48c6a17 commit c352eb6

18 files changed

+1170
-148
lines changed

Package/Main.sublime-menu

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,26 @@
4545
]
4646
}
4747
]
48+
},
49+
{ "id": "preferences",
50+
"children": [
51+
{ "caption": "Package Settings",
52+
"id": "package-settings",
53+
"children": [
54+
{ "caption": "PackageDev",
55+
// "id": "package_dev",
56+
"children": [
57+
{ "caption": "Settings",
58+
"command": "edit_settings",
59+
"args": {
60+
"base_file": "${packages}/PackageDev/Package/PackageDev.sublime-settings",
61+
"default": "{\n\t$0\n}\n"
62+
}
63+
}
64+
]
65+
}
66+
]
67+
}
68+
]
4869
}
4970
]
Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,64 @@
11
[
2-
{ "caption": "PackageDev: New Raw Snippet", "command": "new_raw_snippet" },
3-
{ "caption": "PackageDev: New Raw Snippet from Snippet", "command": "new_raw_snippet_from_snippet" },
4-
{ "caption": "PackageDev: Generate Snippet from Raw Snippet", "command": "generate_snippet_from_raw_snippet" },
2+
// General
3+
{ "caption": "Preferences: PackageDev Settings",
4+
"command": "edit_settings",
5+
"args": {
6+
"base_file": "${packages}/PackageDev/Package/PackageDev.sublime-settings",
7+
"default": "{\n\t$0\n}\n"
8+
}
9+
},
510

6-
{ "caption": "PackageDev: New Syntax Definition", "command": "new_syntax_def" }, // uses whatever the current standard is
7-
{ "caption": "PackageDev: New JSON Syntax Definition", "command": "new_syntax_def", "args": {"fmt": "json"} },
8-
{ "caption": "PackageDev: New PList Syntax Definition", "command": "new_syntax_def", "args": {"fmt": "plist"} },
9-
{ "caption": "PackageDev: New YAML Syntax Definition", "command": "new_syntax_def", "args": {"fmt": "yaml"} },
11+
// Snippets
12+
{ "caption": "PackageDev: New Raw Snippet",
13+
"command": "new_raw_snippet" },
14+
{ "caption": "PackageDev: New Raw Snippet from Snippet",
15+
"command": "new_raw_snippet_from_snippet" },
16+
{ "caption": "PackageDev: Generate Snippet from Raw Snippet",
17+
"command": "generate_snippet_from_raw_snippet" },
1018

11-
{ "caption": "PackageDev: Convert (YAML, JSON, PList) to…", "command": "convert_file" },
12-
{ "caption": "PackageDev: Convert to YAML and Rearrange Syntax Definition", "command": "convert_file", "args": {
13-
"target_format": "yaml",
14-
"ext": "YAML-tmLanguage",
15-
"open_new_file": true,
16-
"rearrange_yaml_syntax_def": true
17-
} },
18-
{ "caption": "PackageDev: Rearrange YAML Syntax Definition", "command": "rearrange_yaml_syntax_def" },
19+
// Syntax Definitions (create)
20+
{ "caption": "PackageDev: New Syntax Definition",
21+
"command": "new_syntax_def" }, // uses whatever the current standard is
22+
{ "caption": "PackageDev: New JSON Syntax Definition",
23+
"command": "new_syntax_def",
24+
"args": {"fmt": "json"}
25+
},
26+
{ "caption": "PackageDev: New PList Syntax Definition",
27+
"command": "new_syntax_def",
28+
"args": {"fmt": "plist"}
29+
},
30+
{ "caption": "PackageDev: New YAML Syntax Definition",
31+
"command": "new_syntax_def",
32+
"args": {"fmt": "yaml"}
33+
},
34+
// Syntax Definitions (covert)
35+
{ "caption": "PackageDev: Convert (YAML, JSON, PList) to…",
36+
"command": "convert_file"
37+
},
38+
{ "caption": "PackageDev: Convert to YAML and Rearrange Syntax Definition",
39+
"command": "convert_file",
40+
"args": {
41+
"target_format": "yaml",
42+
"ext": "YAML-tmLanguage",
43+
"open_new_file": true,
44+
"rearrange_yaml_syntax_def": true
45+
}
46+
},
47+
{ "caption": "PackageDev: Rearrange YAML Syntax Definition",
48+
"command": "rearrange_yaml_syntax_def"
49+
},
1950

20-
{ "caption": "PackageDev: New Settings File", "command": "new_settings" },
21-
22-
{ "caption": "PackageDev: New Completions File", "command": "new_completions" },
23-
24-
{ "caption": "PackageDev: New Commands File", "command": "new_commands_file" },
25-
26-
{ "caption": "PackageDev: New Build System", "command": "new_build_system2" }
51+
// Other
52+
{ "caption": "PackageDev: New Settings File",
53+
"command": "new_settings"
54+
},
55+
{ "caption": "PackageDev: New Completions File",
56+
"command": "new_completions"
57+
},
58+
{ "caption": "PackageDev: New Commands File",
59+
"command": "new_commands_file"
60+
},
61+
{ "caption": "PackageDev: New Build System",
62+
"command": "new_build_system2"
63+
}
2764
]
Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,54 @@
11
{
2-
// what add_region styles to use for the highlighting of the line/positions being tested
3-
// valid values are:
2+
// Define the minimum log level used for logging output on the console.
3+
// Valid values are: "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"
4+
"log_level": "WARNING",
5+
6+
// Underline unknown keys in Sublime Settings.
7+
"settings.linting": true,
8+
9+
// Whether or not to keep the scope suffix in the suggested test scopes
10+
// i.e. if the base scope is text.html.markdown
11+
// then suggest meta.example.markdown (true) vs meta.example (false).
12+
"syntax_test.suggest_scope_suffix": true,
13+
14+
// List of patterns for color schemes not to be displayed in completions.
15+
// Each color scheme containing one of the list's strings is hidden.
16+
"settings.exclude_color_scheme_patterns": [
17+
"/Color Scheme - Legacy",
18+
"/User/SublimeLinter",
19+
"/User/Sublimerge",
20+
"/User/GitSavvy",
21+
"/InactivePanes"
22+
],
23+
24+
// List of patterns for themes not to be displayed in completions.
25+
// Each theme containing one of the list's strings is hidden.
26+
"settings.exclude_theme_patterns": [],
27+
28+
29+
/// ADVANCED SETTINGS /////////////////////////////////////////////////////////////////////////
30+
31+
// Underline unknown keys in Sublime Settings.
32+
// What scope to use to draw the highlighting of unknown settings keys.
33+
"settings.highlight_scope": "markup.warning.unknown-key.sublime-settings",
34+
35+
// What add_region styles to use for highlighting of unknown settings keys.
36+
//
37+
// Valid values are:
438
// "DRAW_EMPTY", "HIDE_ON_MINIMAP", "DRAW_EMPTY_AS_OVERWRITE", "DRAW_NO_FILL",
539
// "DRAW_NO_OUTLINE", "DRAW_SOLID_UNDERLINE", "DRAW_STIPPLED_UNDERLINE",
640
// "DRAW_SQUIGGLY_UNDERLINE", "HIDDEN", "PERSISTENT"
7-
"syntax_test_highlight_styles": ["DRAW_NO_FILL"],
41+
"settings.highlight_styles": ["DRAW_SOLID_UNDERLINE", "DRAW_NO_FILL", "DRAW_NO_OUTLINE"],
842

9-
// what scope to use to draw the add_region highlighting
10-
// this affects what color it will be drawn as
11-
"syntax_test_highlight_scope": "text",
1243

13-
// whether or not to keep the scope suffix in the suggested test scopes
14-
// i.e. if the base scope is text.html.markdown
15-
// then suggest meta.example.markdown (true) vs meta.example (false)
16-
"syntax_test_suggest_scope_suffix": true,
44+
// What scope to use to draw the highlighting of the line/positions being tested.
45+
"syntax_test.highlight_scope": "markup.info.test.sublime-syntax",
46+
47+
// What add_region styles to use for highlighting of the line/positions being tested.
48+
//
49+
// Valid values are:
50+
// "DRAW_EMPTY", "HIDE_ON_MINIMAP", "DRAW_EMPTY_AS_OVERWRITE", "DRAW_NO_FILL",
51+
// "DRAW_NO_OUTLINE", "DRAW_SOLID_UNDERLINE", "DRAW_STIPPLED_UNDERLINE",
52+
// "DRAW_SQUIGGLY_UNDERLINE", "HIDDEN", "PERSISTENT"
53+
"syntax_test.highlight_styles": ["DRAW_NO_FILL"],
1754
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// A list of valid spell checker words added by the user.
3+
"added_words": [],
4+
5+
// A list of words ignored by spell checker.
6+
"ignored_words": [],
7+
8+
// UI scaling factor (hidden setting)
9+
// Common values are: "1.0", "1.25", "1.5", "1.75", "2.0"
10+
"dpi_scale": 1.0,
11+
12+
// Draw UI shadows (hidden setting)
13+
"draw_shadows": true,
14+
15+
// Check for updates on startup (hidden setting)
16+
// Only available to registered users.
17+
"update_check": true,
18+
}

Package/Sublime Text Settings/Settings Development.sublime-completions

Lines changed: 0 additions & 13 deletions
This file was deleted.

Package/Sublime Text Settings/Sublime Settings.JSON-tmLanguage

Lines changed: 0 additions & 22 deletions
This file was deleted.

Package/Sublime Text Settings/Sublime Settings.sublime-settings

Lines changed: 0 additions & 3 deletions
This file was deleted.

Package/Sublime Text Settings/Sublime Settings.tmLanguage

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extensions":
3+
[
4+
"sublime-settings"
5+
],
6+
"auto_complete_selector": "meta.mapping - comment - meta.value",
7+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
%YAML 1.2
2+
---
3+
name: Sublime Text Settings (JSON)
4+
file_extensions:
5+
- sublime-settings
6+
- sublime-settings-hints
7+
scope: source.json.sublime.settings
8+
contexts:
9+
prototype:
10+
- include: JSON.sublime-syntax#comments
11+
12+
main:
13+
- match: '\{'
14+
scope: punctuation.section.mapping.begin.json
15+
push:
16+
- meta_scope: meta.mapping.json
17+
- match: '\}'
18+
scope: punctuation.section.mapping.end.json
19+
set:
20+
- match: \S
21+
scope: invalid.illegal.only-comments-allowed.sublime-settings
22+
- match: '"'
23+
scope: punctuation.definition.string.begin.json
24+
push: [post-key, inside-key]
25+
- match: \S
26+
scope: invalid.illegal.expected-key.json
27+
- match: \S
28+
scope: invalid.illegal.expected-mapping.sublime-settings
29+
30+
inside-key:
31+
- clear_scopes: 1
32+
- meta_scope: meta.mapping.key.json string.quoted.double.json
33+
- meta_content_scope: entity.name.other.key.sublime-settings
34+
- meta_include_prototype: false
35+
- match: '"'
36+
scope: punctuation.definition.string.end.json
37+
pop: true
38+
- include: JSON.sublime-syntax#inside-string
39+
- match: '[\w]+(\.)'
40+
scope: keyword.other.namespace.sublime-settings
41+
captures:
42+
1: punctuation.separator.namespace.sublime-settings
43+
44+
post-key:
45+
- match: ":"
46+
scope: punctuation.separator.mapping.key-value.json
47+
set: expect-value
48+
- match: \S
49+
scope: invalid.illegal.expected-key-value-separator.json
50+
51+
expect-value:
52+
- meta_content_scope: meta.expect-value.json
53+
- match: (?=\S)
54+
set:
55+
- clear_scopes: 1
56+
- meta_scope: meta.mapping.value.json
57+
- include: JSON.sublime-syntax#value
58+
- match: (?:[^\s,}/]|/(?!/\*))*
59+
scope: invalid.illegal.expected-value.json
60+
set: post-value
61+
62+
post-value:
63+
- match: ',|(?=\})'
64+
scope: punctuation.separator.mapping.pair.json
65+
pop: true
66+
# Match whitespace not followed by a character that's not
67+
# whitespace, a comma, a closing brace or a comment
68+
# as invalid.
69+
- match: \s(?=(?!//|/\*)[^\s,}])
70+
scope: invalid.illegal.expected-mapping-separator.json
71+
pop: true
72+
# otherwise just pop and consume nothing
73+
- match: (?=\S)
74+
pop: true

0 commit comments

Comments
 (0)