Skip to content

Commit

Permalink
[JavaScript] Move JSON out of the JavaScript package
Browse files Browse the repository at this point in the history
As suggested in issue sublimehq#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.
  • Loading branch information
DeathAxe committed Feb 8, 2019
1 parent 54f0cf6 commit d7bf5d6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions JSON/Comments.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.json</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
<array>
<dict>
<key>name</key>
<string>TM_COMMENT_START</string>
<key>value</key>
<string>// </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>/*</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>*/</string>
</dict>
</array>
</dict>
</dict>
</plist>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion JavaScript/Comments.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.js, source.json</string>
<string>source.js</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
Expand Down

0 comments on commit d7bf5d6

Please sign in to comment.