-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JavaScript] Move JSON out of the JavaScript package (#1805)
Note from wbond: initial work on splitting JSON happened in 9c44e60, this ties up some loose ends. 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.
- Loading branch information
Showing
4 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>name</key> | ||
<string>JavaScript Indent</string> | ||
<key>scope</key> | ||
<string>source.json</string> | ||
<key>settings</key> | ||
<dict> | ||
<key>decreaseIndentPattern</key> | ||
<string>(?x) | ||
# When an object is closed, but not opened | ||
( | ||
^ | ||
( | ||
# Consume strings | ||
"(?:[^"\\]|\\.)*" | ||
| | ||
# Consume all chars that don't start a string, comment or | ||
# open an object on this line | ||
[^"/{\n] | ||
)* | ||
\}.*$ | ||
) | ||
| | ||
# When an array is closed by itself on a line (interacts with indentSquareBrackets) | ||
( | ||
^(.*\*/)?\s*\].*$ | ||
) | ||
</string> | ||
<key>increaseIndentPattern</key> | ||
<string>(?x) | ||
# When an object is opened, but not closed | ||
( | ||
^.*\{ | ||
( | ||
# Consume strings | ||
"(?:[^"\\]|\\.)*" | ||
| | ||
# Consume all chars that don't start a string, comment or | ||
# end the object that was opened on this line | ||
[^"/}] | ||
)* | ||
# Stop matching at the end of the line, or once we hit a comment | ||
($|/[/*]) | ||
) | ||
| | ||
# When an array is opened, but not closed | ||
( | ||
^.*\[ | ||
( | ||
# Consume strings | ||
"(?:[^"\\]|\\.)*" | ||
| | ||
# Consume all chars that don't start a string, comment or | ||
# end the array that was opened on this line | ||
[^"/\]] | ||
)* | ||
# Stop matching at the end of the line, or once we hit a comment | ||
($|/[/*]) | ||
) | ||
</string> | ||
<key>indentSquareBrackets</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters