From d826ad6e4fd52d9997fd144531c952af13218146 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 4 Jan 2017 23:12:56 -0400 Subject: [PATCH] [jsx][tsx] Wrong type of comments for React code. Fixes #6461 --- ...=> javascript-language-configuration.json} | 0 extensions/javascript/package.json | 20 +++++++++++--- .../tags-language-configuration.json | 27 +++++++++++++++++++ extensions/typescript/package.json | 6 ++++- 4 files changed, 48 insertions(+), 5 deletions(-) rename extensions/javascript/{language-configuration.json => javascript-language-configuration.json} (100%) create mode 100644 extensions/javascript/tags-language-configuration.json diff --git a/extensions/javascript/language-configuration.json b/extensions/javascript/javascript-language-configuration.json similarity index 100% rename from extensions/javascript/language-configuration.json rename to extensions/javascript/javascript-language-configuration.json diff --git a/extensions/javascript/package.json b/extensions/javascript/package.json index b08729bbe12..8385c006d33 100644 --- a/extensions/javascript/package.json +++ b/extensions/javascript/package.json @@ -27,7 +27,7 @@ "extensions": [ ".jsx" ], - "configuration": "./language-configuration.json" + "configuration": "./javascript-language-configuration.json" }, { "id": "javascript", @@ -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", diff --git a/extensions/javascript/tags-language-configuration.json b/extensions/javascript/tags-language-configuration.json new file mode 100644 index 00000000000..fa04cf1756f --- /dev/null +++ b/extensions/javascript/tags-language-configuration.json @@ -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": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["<", ">"], + ["'", "'"], + ["\"", "\""] + ] +} \ No newline at end of file diff --git a/extensions/typescript/package.json b/extensions/typescript/package.json index 9f30f48b4f4..ae1c645c03e 100644 --- a/extensions/typescript/package.json +++ b/extensions/typescript/package.json @@ -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": {