diff --git a/extensions/php/build/update-grammar.mjs b/extensions/php/build/update-grammar.mjs index 5fa17f218af..2a7ad082549 100644 --- a/extensions/php/build/update-grammar.mjs +++ b/extensions/php/build/update-grammar.mjs @@ -68,8 +68,8 @@ function fixBadRegex(grammar) { } } -vscodeGrammarUpdater.update('atom/language-php', 'grammars/php.cson', './syntaxes/php.tmLanguage.json', fixBadRegex); -vscodeGrammarUpdater.update('atom/language-php', 'grammars/html.cson', './syntaxes/html.tmLanguage.json', grammar => { +vscodeGrammarUpdater.update('KapitanOczywisty/language-php', 'grammars/php.cson', './syntaxes/php.tmLanguage.json', fixBadRegex); +vscodeGrammarUpdater.update('KapitanOczywisty/language-php', 'grammars/html.cson', './syntaxes/html.tmLanguage.json', grammar => { adaptInjectionScope(grammar); includeDerivativeHtml(grammar); }); diff --git a/extensions/php/syntaxes/html.tmLanguage.json b/extensions/php/syntaxes/html.tmLanguage.json index 4959a223a18..86defb99262 100644 --- a/extensions/php/syntaxes/html.tmLanguage.json +++ b/extensions/php/syntaxes/html.tmLanguage.json @@ -1,10 +1,10 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/atom/language-php/blob/master/grammars/html.cson", + "This file has been converted from https://github.com/KapitanOczywisty/language-php/blob/master/grammars/html.cson", "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/atom/language-php/commit/ff64523c94c014d68f5dec189b05557649c5872a", + "version": "https://github.com/KapitanOczywisty/language-php/commit/ff64523c94c014d68f5dec189b05557649c5872a", "name": "PHP", "scopeName": "text.html.php", "injections": { diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index 542b02023a7..96821c6770c 100644 --- a/extensions/php/syntaxes/php.tmLanguage.json +++ b/extensions/php/syntaxes/php.tmLanguage.json @@ -1,10 +1,10 @@ { "information_for_contributors": [ - "This file has been converted from https://github.com/atom/language-php/blob/master/grammars/php.cson", + "This file has been converted from https://github.com/KapitanOczywisty/language-php/blob/master/grammars/php.cson", "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/atom/language-php/commit/eb28b8aea1214dcbc732f3d9b9ed20c089c648bd", + "version": "https://github.com/KapitanOczywisty/language-php/commit/5e8f000cb5a20f44f7a7a89d07ad0774031c53f3", "scopeName": "source.php", "patterns": [ { @@ -320,10 +320,19 @@ ] }, { - "begin": "(?ix)\n(?:\n \\b(?:(abstract|final)\\s+)?(class)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\n |\\b(new)\\b\\s*(\\#\\[.*\\])?\\s*\\b(class)\\b # anonymous class\n)", + "begin": "(?ix)\n(?:\n \\b((?:(?:final|abstract|readonly)\\s+)*)(class)\\s+([a-z_\\x{7f}-\\x{10ffff}][a-z0-9_\\x{7f}-\\x{10ffff}]*)\n |\\b(new)\\b\\s*(\\#\\[.*\\])?\\s*(?:(readonly)\\s+)?\\b(class)\\b # anonymous class\n)", "beginCaptures": { "1": { - "name": "storage.modifier.${1:/downcase}.php" + "patterns": [ + { + "match": "final|abstract", + "name": "storage.modifier.${0:/downcase}.php" + }, + { + "match": "readonly", + "name": "storage.modifier.php" + } + ] }, "2": { "name": "storage.type.class.php" @@ -342,6 +351,9 @@ ] }, "6": { + "name": "storage.modifier.php" + }, + "7": { "name": "storage.type.class.php" } }, @@ -574,7 +586,7 @@ ] }, { - "match": "(?xi)\n(:)\\s*\n(\n (?:\\?\\s*)? [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ | # nullable type\n [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ (?: \\s*[|&]\\s* [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+ # union type\n)\n(?=\\s*(?:{|/[/*]|\\#|$))", + "match": "(?xi)\n(:)\\s*\n(\n # nullable type\n (?:\\?\\s*)? [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ |\n # union, intersection or DNF type\n (?: [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ | \\(\\s* [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+ \\s*\\) )\n (?: \\s*[|&]\\s*\n (?: [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ | \\(\\s* [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+ \\s*\\) )\n )+\n)\n(?=\\s*(?:{|/[/*]|\\#|$))", "captures": { "1": { "name": "keyword.operator.return-value.php" @@ -629,7 +641,7 @@ ] }, { - "match": "(?xi)\n(:)\\s*\n(\n (?:\\?\\s*)? [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ | # nullable type\n [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ (?: \\s*[|&]\\s* [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+ # union type\n)\n(?=\\s*(?:=>|/[/*]|\\#|$))", + "match": "(?xi)\n(:)\\s*\n(\n # nullable type\n (?:\\?\\s*)? [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ |\n # union, intersection or DNF type\n (?: [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ | \\(\\s* [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+ \\s*\\) )\n (?: \\s*[|&]\\s*\n (?: [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+ | \\(\\s* [a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+(?:\\s*&\\s*[a-z0-9_\\x{7f}-\\x{10ffff}\\\\]+)+ \\s*\\) )\n )+\n)\n(?=\\s*(?:=>|/[/*]|\\#|$))", "captures": { "1": { "name": "keyword.operator.return-value.php" @@ -667,7 +679,7 @@ } }, "contentName": "meta.function.parameters.php", - "end": "(?xi)\n(\\)) \\s* ( : \\s*\n (?:\\?\\s*)? (?!\\s) [a-z0-9_\\x{7f}-\\x{10ffff}\\\\\\s\\|&]+ (?