44 *--------------------------------------------------------------------------------------------*/
55'use strict' ;
66
7- var updateGrammar = require ( '../../../build/npm/update-grammar' ) ;
7+ const updateGrammar = require ( '../../../build/npm/update-grammar' ) ;
88
99function adaptInjectionScope ( grammar ) {
1010 // we're using the HTML grammar from https://github.com/textmate/html.tmbundle which has moved away from source.js.embedded.html
11- let oldInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:text.html.php meta.tag, L:source.js.embedded.html" ;
12- let newInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:text.html.php meta.tag, L:text.html. php source.js " ;
11+ const oldInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:(( text.html.php meta.tag) - (meta.embedded.block.php | meta.embedded.line.php)) , L:( source.js.embedded.html - (meta.embedded.block.php | meta.embedded.line.php)) " ;
12+ const newInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:(( text.html.php meta.tag) - (meta.embedded.block.php | meta.embedded.line.php)) , L:(source.js - (meta.embedded.block. php | meta.embedded.line.php)) " ;
1313
14- var injections = grammar . injections ;
15- var injection = injections [ oldInjectionKey ] ;
16- if ( ! injections ) {
17- throw new Error ( "Can not find PHP injection" ) ;
14+ const injections = grammar . injections ;
15+ const injection = injections [ oldInjectionKey ] ;
16+ if ( ! injection ) {
17+ throw new Error ( "Can not find PHP injection to patch " ) ;
1818 }
1919 delete injections [ oldInjectionKey ] ;
2020 injections [ newInjectionKey ] = injection ;
@@ -37,4 +37,3 @@ function fixBadRegex(grammar) {
3737
3838updateGrammar . update ( 'atom/language-php' , 'grammars/php.cson' , './syntaxes/php.tmLanguage.json' , fixBadRegex ) ;
3939updateGrammar . update ( 'atom/language-php' , 'grammars/html.cson' , './syntaxes/html.tmLanguage.json' , adaptInjectionScope ) ;
40-
0 commit comments