Skip to content

Commit

Permalink
[jsx][tsx] Wrong type of comments for React code. Fixes microsoft#6461
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli committed Jan 7, 2017
1 parent db859bf commit d826ad6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
20 changes: 16 additions & 4 deletions extensions/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"extensions": [
".jsx"
],
"configuration": "./language-configuration.json"
"configuration": "./javascript-language-configuration.json"
},
{
"id": "javascript",
Expand All @@ -47,19 +47,31 @@
"mimetypes": [
"text/javascript"
],
"configuration": "./language-configuration.json"
"configuration": "./javascript-language-configuration.json"
},
{
"id": "jsx-tags",
"configuration": "./tags-language-configuration.json"
}
],
"grammars": [
{
"language": "javascriptreact",
"scopeName": "source.js",
"path": "./syntaxes/JavaScript.tmLanguage.json"
"path": "./syntaxes/JavaScript.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.js": "jsx-tags",
"meta.tag.without-attributes.js": "jsx-tags"
}
},
{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/JavaScript.tmLanguage.json"
"path": "./syntaxes/JavaScript.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.js": "jsx-tags",
"meta.tag.without-attributes.js": "jsx-tags"
}
},
{
"scopeName": "source.js.regexp",
Expand Down
27 changes: 27 additions & 0 deletions extensions/javascript/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": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"],
["'", "'"],
["\"", "\""]
]
}
6 changes: 5 additions & 1 deletion extensions/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@
{
"language": "typescriptreact",
"scopeName": "source.tsx",
"path": "./syntaxes/TypeScriptReact.tmLanguage.json"
"path": "./syntaxes/TypeScriptReact.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.tsx": "jsx-tags",
"meta.tag.without-attributes.tsx": "jsx-tags"
}
}
],
"configuration": {
Expand Down

0 comments on commit d826ad6

Please sign in to comment.