Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 1ad262b

Browse files
committed
Initial commit
0 parents  commit 1ad262b

File tree

7 files changed

+226
-0
lines changed

7 files changed

+226
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# JSON language support in Atom
2+
3+
Originally converted from the [JSON TextMate bundle](https://github.com/textmate/json.tmbundle)
4+
using [bundle2package](https://github.com/atom/bundle2package).
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"beforeRunningCommand": "nop",
3+
"command": "#!/bin/bash\nif ! /usr/bin/python -m json.tool; then\n\t. \"$TM_SUPPORT_PATH/lib/bash_init.sh\"\n\texit_show_tool_tip\nfi\n",
4+
"input": "selection",
5+
"inputFormat": "text",
6+
"keyEquivalent": "^H",
7+
"name": "Reformat Document / Selection",
8+
"outputCaret": "heuristic",
9+
"outputFormat": "text",
10+
"outputLocation": "replaceInput",
11+
"scope": "source.json",
12+
"version": 2
13+
}

info.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"contactEmailRot13": "[email protected]",
3+
"contactName": "James Edward Gray II",
4+
"description": "Syntax highlight for <a href=\"http://json.org/\">JavaScript Object Notation</a> files, often used as a lightweight serialization format.",
5+
"name": "JSON",
6+
"ordering": [
7+
"0C3868E4-F96B-4E55-B204-1DCB5A20748B",
8+
"4B74F2DE-E051-4E8D-9124-EBD90A2CDD2B"
9+
]
10+
}

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "language-json",
3+
"version": "0.0.0",
4+
"description": "JSON language support in Atom",
5+
"engines": {
6+
"atom": "*",
7+
"node": "*"
8+
},
9+
"homepage": "http://atom.github.io/language-json",
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/atom/language-json.git"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/atom/language-json/issues"
16+
}
17+
}

preferences/Folding.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "Folding",
3+
"scope": "source.json",
4+
"settings": {
5+
"foldingStartMarker": "(?x:\t\t # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [{\\[] # the start of an object or array\n (?! # but not followed by\n .* # whatever\n [}\\]] # and the close of an object or array\n ,? # an optional comma\n \\s* # some optional space\n $ # at the end of the line\n ) \n | # ...or...\n [{\\[] # the start of an object or array\n \\s* # some optional space\n $ # at the end of the line\n )",
6+
"foldingStopMarker": "(?x: # turn on extended mode\n\t ^ # a line beginning with\n\t \\s* # some optional space\n\t [}\\]] # and the close of an object or array\n\t )"
7+
}
8+
}

preferences/Miscellaneous.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "Miscellaneous",
3+
"scope": "source.json",
4+
"settings": {
5+
"decreaseIndentPattern": "^\\s*[}\\]],?\\s*$",
6+
"increaseIndentPattern": "^.*(\\{[^}]*|\\[[^\\]]*)$",
7+
"smartTypingPairs": [
8+
[
9+
"\"",
10+
"\""
11+
],
12+
[
13+
"(",
14+
")"
15+
],
16+
[
17+
"{",
18+
"}"
19+
],
20+
[
21+
"[",
22+
"]"
23+
]
24+
]
25+
}
26+
}

syntaxes/JSON.json

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
{
2+
"fileTypes": [
3+
"json"
4+
],
5+
"keyEquivalent": "^~J",
6+
"name": "JSON",
7+
"patterns": [
8+
{
9+
"include": "#value"
10+
}
11+
],
12+
"repository": {
13+
"array": {
14+
"begin": "\\[",
15+
"beginCaptures": {
16+
"0": {
17+
"name": "punctuation.definition.array.begin.json"
18+
}
19+
},
20+
"end": "\\]",
21+
"endCaptures": {
22+
"0": {
23+
"name": "punctuation.definition.array.end.json"
24+
}
25+
},
26+
"name": "meta.structure.array.json",
27+
"patterns": [
28+
{
29+
"include": "#value"
30+
},
31+
{
32+
"match": ",",
33+
"name": "punctuation.separator.array.json"
34+
},
35+
{
36+
"match": "[^\\s\\]]",
37+
"name": "invalid.illegal.expected-array-separator.json"
38+
}
39+
]
40+
},
41+
"constant": {
42+
"match": "\\b(?:true|false|null)\\b",
43+
"name": "constant.language.json"
44+
},
45+
"number": {
46+
"comment": "handles integer and decimal numbers",
47+
"match": "(?x: # turn on extended mode\n\t\t\t -? # an optional minus\n\t\t\t (?:\n\t\t\t 0 # a zero\n\t\t\t | # ...or...\n\t\t\t [1-9] # a 1-9 character\n\t\t\t \\d* # followed by zero or more digits\n\t\t\t )\n\t\t\t (?:\n\t\t\t (?:\n\t\t\t \\. # a period\n\t\t\t \\d+ # followed by one or more digits\n\t\t\t )?\n\t\t\t (?:\n\t\t\t [eE] # an e character\n\t\t\t [+-]? # followed by an option +/-\n\t\t\t \\d+ # followed by one or more digits\n\t\t\t )? # make exponent optional\n\t\t\t )? # make decimal portion optional\n\t\t\t )",
48+
"name": "constant.numeric.json"
49+
},
50+
"object": {
51+
"begin": "\\{",
52+
"beginCaptures": {
53+
"0": {
54+
"name": "punctuation.definition.dictionary.begin.json"
55+
}
56+
},
57+
"comment": "a JSON object",
58+
"end": "\\}",
59+
"endCaptures": {
60+
"0": {
61+
"name": "punctuation.definition.dictionary.end.json"
62+
}
63+
},
64+
"name": "meta.structure.dictionary.json",
65+
"patterns": [
66+
{
67+
"comment": "the JSON object key",
68+
"include": "#string"
69+
},
70+
{
71+
"begin": ":",
72+
"beginCaptures": {
73+
"0": {
74+
"name": "punctuation.separator.dictionary.key-value.json"
75+
}
76+
},
77+
"end": "(,)|(?=\\})",
78+
"endCaptures": {
79+
"1": {
80+
"name": "punctuation.separator.dictionary.pair.json"
81+
}
82+
},
83+
"name": "meta.structure.dictionary.value.json",
84+
"patterns": [
85+
{
86+
"comment": "the JSON object value",
87+
"include": "#value"
88+
},
89+
{
90+
"match": "[^\\s,]",
91+
"name": "invalid.illegal.expected-dictionary-separator.json"
92+
}
93+
]
94+
},
95+
{
96+
"match": "[^\\s\\}]",
97+
"name": "invalid.illegal.expected-dictionary-separator.json"
98+
}
99+
]
100+
},
101+
"string": {
102+
"begin": "\"",
103+
"beginCaptures": {
104+
"0": {
105+
"name": "punctuation.definition.string.begin.json"
106+
}
107+
},
108+
"end": "\"",
109+
"endCaptures": {
110+
"0": {
111+
"name": "punctuation.definition.string.end.json"
112+
}
113+
},
114+
"name": "string.quoted.double.json",
115+
"patterns": [
116+
{
117+
"match": "(?x: # turn on extended mode\n \\\\ # a literal backslash\n (?: # ...followed by...\n [\"\\\\/bfnrt] # one of these characters\n | # ...or...\n u # a u\n [0-9a-fA-F]{4} # and four hex digits\n )\n )",
118+
"name": "constant.character.escape.json"
119+
},
120+
{
121+
"match": "\\\\.",
122+
"name": "invalid.illegal.unrecognized-string-escape.json"
123+
}
124+
]
125+
},
126+
"value": {
127+
"comment": "the 'value' diagram at http://json.org",
128+
"patterns": [
129+
{
130+
"include": "#constant"
131+
},
132+
{
133+
"include": "#number"
134+
},
135+
{
136+
"include": "#string"
137+
},
138+
{
139+
"include": "#array"
140+
},
141+
{
142+
"include": "#object"
143+
}
144+
]
145+
}
146+
},
147+
"scopeName": "source.json"
148+
}

0 commit comments

Comments
 (0)