From 922ab6db6251a58ac7761174a7208c9d62116a02 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 9 Jul 2019 10:47:13 +0200 Subject: [PATCH] Update grammar script to include option path for version Update C grammars to get macro fix --- build/npm/update-grammar.js | 8 +- extensions/cpp/build/update-grammars.js | 4 +- extensions/cpp/cgmanifest.json | 4 +- extensions/cpp/syntaxes/cpp.tmLanguage.json | 8 +- .../cpp/test/colorize-results/test_cpp.json | 73 +++++++++++-------- .../objective-c/build/update-grammars.js | 4 +- extensions/objective-c/cgmanifest.json | 2 +- 7 files changed, 59 insertions(+), 44 deletions(-) diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js index 522b2941218..5321b7b1dcd 100644 --- a/build/npm/update-grammar.js +++ b/build/npm/update-grammar.js @@ -82,7 +82,7 @@ function getCommitSha(repoId, repoPath) { }); } -exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'master') { +exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'master', packageJsonPathOverride = '') { var contentPath = 'https://raw.githubusercontent.com/' + repoId + `/${version}/` + repoPath; console.log('Reading from ' + contentPath); return download(contentPath).then(function (content) { @@ -128,7 +128,11 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas // Add commit sha to cgmanifest. if (currentCommitDate > commitDate) { - let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`; + let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/`; + if (packageJsonPathOverride) { + packageJsonPath += packageJsonPathOverride; + } + packageJsonPath += '/package.json'; for (let i = 0; i < cgmanifestRead.registrations.length; i++) { if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) { cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha; diff --git a/extensions/cpp/build/update-grammars.js b/extensions/cpp/build/update-grammars.js index 406b326156c..29761cdaf95 100644 --- a/extensions/cpp/build/update-grammars.js +++ b/extensions/cpp/build/update-grammars.js @@ -6,8 +6,8 @@ var updateGrammar = require('../../../build/npm/update-grammar'); -updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/c.tmLanguage.json', './syntaxes/c.tmLanguage.json'); -updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/cpp.tmLanguage.json', './syntaxes/cpp.tmLanguage.json'); +updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/c.tmLanguage.json', './syntaxes/c.tmLanguage.json', undefined, 'master', 'source/languages/cpp'); +updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/cpp.tmLanguage.json', './syntaxes/cpp.tmLanguage.json', undefined, 'master', 'source/languages/cpp'); // `source.c.platform` which is still included by other grammars updateGrammar.update('textmate/c.tmbundle', 'Syntaxes/Platform.tmLanguage', './syntaxes/platform.tmLanguage.json'); diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index 113cea950f6..6716fa1a223 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jeff-hykin/cpp-textmate-grammar", "repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar", - "commitHash": "cb9cb59b32d0cb9e2cbbca1a9cdb62769fc2ca8e" + "commitHash": "992c5ba8789288707f2a13778452d644677d9699" } }, "license": "MIT", - "version": "1.0.0", + "version": "1.12.18", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { diff --git a/extensions/cpp/syntaxes/cpp.tmLanguage.json b/extensions/cpp/syntaxes/cpp.tmLanguage.json index e43d8d45b61..f7495aee6e3 100644 --- a/extensions/cpp/syntaxes/cpp.tmLanguage.json +++ b/extensions/cpp/syntaxes/cpp.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/cb9cb59b32d0cb9e2cbbca1a9cdb62769fc2ca8e", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/992c5ba8789288707f2a13778452d644677d9699", "name": "C++", "scopeName": "source.cpp", "patterns": [ @@ -143,9 +143,6 @@ { "include": "#preprocessor_rule_conditional" }, - { - "include": "#macro_argument" - }, { "include": "#meta_preprocessor_macro" }, @@ -19409,6 +19406,9 @@ }, { "include": "#evaluation_context" + }, + { + "include": "#macro_argument" } ] } diff --git a/extensions/cpp/test/colorize-results/test_cpp.json b/extensions/cpp/test/colorize-results/test_cpp.json index 4f8817ed2a0..025f668b4c9 100644 --- a/extensions/cpp/test/colorize-results/test_cpp.json +++ b/extensions/cpp/test/colorize-results/test_cpp.json @@ -22,58 +22,69 @@ } }, { - "c": "#include", - "t": "source.cpp variable.other.macro.argument.cpp", + "c": "#", + "t": "source.cpp meta.preprocessor.include.cpp keyword.control.directive.include.cpp punctuation.definition.directive.cpp", "r": { - "dark_plus": "variable: #9CDCFE", - "light_plus": "variable: #001080", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "variable: #9CDCFE" + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" + } + }, + { + "c": "include", + "t": "source.cpp meta.preprocessor.include.cpp keyword.control.directive.include.cpp", + "r": { + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" } }, { "c": " ", - "t": "source.cpp", + "t": "source.cpp meta.preprocessor.include.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "meta.preprocessor: #569CD6", + "light_plus": "meta.preprocessor: #0000FF", + "dark_vs": "meta.preprocessor: #569CD6", + "light_vs": "meta.preprocessor: #0000FF", + "hc_black": "meta.preprocessor: #569CD6" } }, { "c": "<", - "t": "source.cpp keyword.operator.comparison.cpp", + "t": "source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp punctuation.definition.string.begin.cpp", "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" } }, { "c": "iostream", - "t": "source.cpp", + "t": "source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp", "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" } }, { "c": ">", - "t": "source.cpp keyword.operator.comparison.cpp", + "t": "source.cpp meta.preprocessor.include.cpp string.quoted.other.lt-gt.include.cpp punctuation.definition.string.end.cpp", "r": { - "dark_plus": "keyword.operator: #D4D4D4", - "light_plus": "keyword.operator: #000000", - "dark_vs": "keyword.operator: #D4D4D4", - "light_vs": "keyword.operator: #000000", - "hc_black": "keyword.operator: #D4D4D4" + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" } }, { diff --git a/extensions/objective-c/build/update-grammars.js b/extensions/objective-c/build/update-grammars.js index 52dd76e06a1..5518bbcb033 100644 --- a/extensions/objective-c/build/update-grammars.js +++ b/extensions/objective-c/build/update-grammars.js @@ -6,6 +6,6 @@ var updateGrammar = require('../../../build/npm/update-grammar'); -updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/objc.tmLanguage.json', './syntaxes/objective-c.tmLanguage.json'); -updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/objcpp.tmLanguage.json', './syntaxes/objective-c++.tmLanguage.json'); +updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/objc.tmLanguage.json', './syntaxes/objective-c.tmLanguage.json', undefined, 'master', 'source/languages/cpp'); +updateGrammar.update('jeff-hykin/cpp-textmate-grammar', '/syntaxes/objcpp.tmLanguage.json', './syntaxes/objective-c++.tmLanguage.json', undefined, 'master', 'source/languages/cpp'); diff --git a/extensions/objective-c/cgmanifest.json b/extensions/objective-c/cgmanifest.json index f7f15ff638a..f33f55aad69 100644 --- a/extensions/objective-c/cgmanifest.json +++ b/extensions/objective-c/cgmanifest.json @@ -10,7 +10,7 @@ } }, "license": "MIT", - "version": "1.0.0", + "version": "1.12.11", "description": "The files syntaxes/objective-c.tmLanguage.json and syntaxes/objective-c++.tmLanguage.json were derived from the language package https://github.com/jeff-hykin/cpp-textmate-grammar." } ],