From d7bf5d660c32e9b61ee64902607d63ded124094c Mon Sep 17 00:00:00 2001 From: DeathAxe Date: Sat, 8 Dec 2018 16:37:47 +0100 Subject: [PATCH] [JavaScript] Move JSON out of the JavaScript package As suggested in issue #1771 this commit moves the JSON syntax into a dedicated package in order to be able to disable either JavaScript or JSON independently. This commit does not yet create the suggested compatibility redirection within the JavaScript package. The decision about it is left to the core devs right now 1. as it would cause a duplicated syntax file 2. a quick search within packagecontrol.io did not reveal any packages depending on the builtin JavaScript/JSON.sublime-syntax 3. the location of the sublime-syntax file should not be too important if it is imported via `scope:source.json` or its name `JSON.sublime-syntax` only. Conflicts would be caused only if it was imported via `Packages/JavaScript/JSON.sublime-syntax` which is easy to fix. --- JSON/Comments.tmPreferences | 33 +++++++++++++++++++ .../Indentation Rules.tmPreferences | 0 {JavaScript => JSON}/JSON.sublime-syntax | 0 .../tests => JSON}/syntax_test_json.json | 2 +- JavaScript/Comments.tmPreferences | 2 +- 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 JSON/Comments.tmPreferences rename JavaScript/JSON Indent.tmPreferences => JSON/Indentation Rules.tmPreferences (100%) rename {JavaScript => JSON}/JSON.sublime-syntax (100%) rename {JavaScript/tests => JSON}/syntax_test_json.json (97%) diff --git a/JSON/Comments.tmPreferences b/JSON/Comments.tmPreferences new file mode 100644 index 0000000000..dd46f14e7a --- /dev/null +++ b/JSON/Comments.tmPreferences @@ -0,0 +1,33 @@ + + + + name + Comments + scope + source.json + settings + + shellVariables + + + name + TM_COMMENT_START + value + // + + + name + TM_COMMENT_START_2 + value + /* + + + name + TM_COMMENT_END_2 + value + */ + + + + + diff --git a/JavaScript/JSON Indent.tmPreferences b/JSON/Indentation Rules.tmPreferences similarity index 100% rename from JavaScript/JSON Indent.tmPreferences rename to JSON/Indentation Rules.tmPreferences diff --git a/JavaScript/JSON.sublime-syntax b/JSON/JSON.sublime-syntax similarity index 100% rename from JavaScript/JSON.sublime-syntax rename to JSON/JSON.sublime-syntax diff --git a/JavaScript/tests/syntax_test_json.json b/JSON/syntax_test_json.json similarity index 97% rename from JavaScript/tests/syntax_test_json.json rename to JSON/syntax_test_json.json index 2ce4180c77..715100b10e 100644 --- a/JavaScript/tests/syntax_test_json.json +++ b/JSON/syntax_test_json.json @@ -1,4 +1,4 @@ -// SYNTAX TEST "Packages/JavaScript/JSON.sublime-syntax" +// SYNTAX TEST "Packages/JSON/JSON.sublime-syntax" { // <- meta.mapping.json punctuation.section.mapping.begin.json diff --git a/JavaScript/Comments.tmPreferences b/JavaScript/Comments.tmPreferences index f16fa66e31..d24c0f708c 100644 --- a/JavaScript/Comments.tmPreferences +++ b/JavaScript/Comments.tmPreferences @@ -4,7 +4,7 @@ name Comments scope - source.js, source.json + source.js settings shellVariables