Skip to content

Commit

Permalink
Fix #11. JSX comments should work
Browse files Browse the repository at this point in the history
  • Loading branch information
joshpeng committed Sep 2, 2017
1 parent c47ef75 commit 3d82236
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 103 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
v0.2.7
- Fixed [#11](https://github.com/joshpeng/Sublime-Babel-VSCode/pull/11). JSX embedding comments should now work.

v0.2.6
- Fixed [#21](https://github.com/joshpeng/Sublime-Babel-VSCode/issues/21). Color highlighting within arrow functions were inconsistent
- Fixed [#20](https://github.com/joshpeng/Sublime-Babel-VSCode/issues/20). Support auto-indent of embedded HTML elements
Expand Down
56 changes: 26 additions & 30 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "//",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": [ "/*", "*/" ]
},
// symbols used as brackets
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["`", "`"]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["`", "`"]
]
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
{ "open": "/**", "close": " */", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["'", "'"],
["\"", "\""],
["`", "`"]
]
}
162 changes: 89 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,91 @@
{
"name": "sublime-babel-vscode",
"displayName": "Sublime Babel",
"description": "Sublime Text's babel-sublime grammar in VS Code.",
"version": "0.2.6",
"publisher": "joshpeng",
"engines": {
"vscode": "^1.5.0"
},
"categories": [
"Languages"
],
"repository": {
"type": "git",
"url": "https://github.com/joshpeng/Sublime-Babel-VSCode"
},
"icon": "images/Babel.png",
"galleryBanner": {
"color": "#f5da55",
"theme": "light"
},
"license": "MIT",
"contributes": {
"languages": [
{
"id": "javascript",
"aliases": [
"JavaScript (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
},
{
"id": "javascriptreact",
"aliases": [
"JavaScript React (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json",
"embeddedLanguages": {
"meta.tag.jsx": "jsx-tags"
}
},
{
"language": "javascriptreact",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json",
"embeddedLanguages": {
"meta.tag.jsx": "jsx-tags"
}
},
{
"scopeName": "source.regexp.js",
"path": "./syntaxes/regex.json"
}
]
}
"name": "sublime-babel-vscode",
"displayName": "Sublime Babel",
"description": "Sublime Text's babel-sublime grammar in VS Code.",
"version": "0.2.7",
"publisher": "joshpeng",
"engines": {
"vscode": "^1.5.0"
},
"categories": [
"Languages"
],
"repository": {
"type": "git",
"url": "https://github.com/joshpeng/Sublime-Babel-VSCode"
},
"icon": "images/Babel.png",
"galleryBanner": {
"color": "#f5da55",
"theme": "light"
},
"license": "MIT",
"contributes": {
"languages": [
{
"id": "javascript",
"aliases": [
"JavaScript (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
},
{
"id": "javascriptreact",
"aliases": [
"JavaScript React (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
},
{
"id": "jsx-tags",
"aliases": [],
"configuration": "./tags-language-configuration.json"
}
],
"grammars": [
{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json",
"embeddedLanguages": {
"meta.jsx.js": "jsx-tags",
"meta.tag.jsx": "jsx-tags",
"meta.tag.js": "jsx-tags",
"meta.tag.without-attributes.js": "jsx-tags"
}
},
{
"language": "javascriptreact",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json",
"embeddedLanguages": {
"meta.jsx.js": "jsx-tags",
"meta.tag.jsx": "jsx-tags",
"meta.tag.js": "jsx-tags",
"meta.tag.without-attributes.js": "jsx-tags"
}
},
{
"scopeName": "source.regexp.js",
"path": "./syntaxes/regex.json"
}
]
},
"__metadata": {
"id": "b864db6b-8147-4ff8-b05a-f7c906c91f02",
"publisherId": "5301c829-08a8-4505-a5a0-c623ee1041cb",
"publisherDisplayName": "Josh Peng"
}
}
27 changes: 27 additions & 0 deletions tags-language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"comments": {
"blockComment": [ "{/*", "*/}" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "/**", "close": " */", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"],
["'", "'"],
["\"", "\""]
]
}

0 comments on commit 3d82236

Please sign in to comment.