From 6ac031e41066808b5d78a997ad3da2ad10173798 Mon Sep 17 00:00:00 2001 From: Kennith Leung Date: Tue, 15 Jan 2019 15:33:39 -0800 Subject: [PATCH 1/2] Add helpers added since Laravel 5.6 See https://github.com/laravel/framework/blob/5.7/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php#L23 --- blade.sublime-syntax | 6 +++--- test.blade.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/blade.sublime-syntax b/blade.sublime-syntax index 0ecbc81..0750d39 100644 --- a/blade.sublime-syntax +++ b/blade.sublime-syntax @@ -90,7 +90,7 @@ contexts: pop: true - include: 'scope:source.php' - - match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|choice|case|component|continue|debug|each|elsecan|elsecannot|elseif|embed|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\(\()' + - match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elseif|embed|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\(\()' captures: 0: punctuation.section.embedded.php 2: constant.other.inline-data.html @@ -102,7 +102,7 @@ contexts: pop: true - include: 'scope:source.php' - - match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|choice|case|component|continue|debug|each|elsecan|elsecannot|elseif|embed|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\()' + - match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elseif|embed|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|method|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\()' captures: 0: punctuation.section.embedded.php 2: constant.other.inline-data.html @@ -114,7 +114,7 @@ contexts: pop: true - include: 'scope:source.php' - - match: '(\s{0}|^)(\@)\b(acfend|after|append|auth|break|breakpoint|continue|default|else|empty|endswitch|endafter|endauth|endblock|endcan|endcannot|endcomponent|endembed|endempty|endfor|endforeach|endforelse|endguest|endif|endisset|endmacro|endmarkdown|endminify|endpartial|endpush|endsection|endsetup|endslot|endstory|endtask|endunless|endwhile|guest|markdown|overwrite|parent|setup|show|stop|verbatim|endverbatim|wpempty|wpend|wpquery)\b' + - match: '(\s{0}|^)(\@)\b(acfend|after|append|auth|break|breakpoint|continue|csrf|default|else|empty|endswitch|endafter|endauth|endblock|endcan|endcannot|endcomponent|endembed|endempty|endfor|endforeach|endforelse|endguest|endif|endisset|endmacro|endmarkdown|endminify|endpartial|endpush|endsection|endsetup|endslot|endstory|endtask|endunless|endwhile|guest|markdown|overwrite|parent|setup|show|stop|verbatim|endverbatim|wpempty|wpend|wpquery)\b' scope: custom.compiler.blade.php captures: 0: punctuation.section.embedded.php diff --git a/test.blade.php b/test.blade.php index c5aae58..287ff01 100644 --- a/test.blade.php +++ b/test.blade.php @@ -405,3 +405,9 @@ {{-- Complex conditional inline --}}

Text

+ +{{-- Helpers --}} +@csrf +@dd('Compile the "dd" statements into valid PHP.') +@dump('Compile the "dump" statements into valid PHP') +@method('post') \ No newline at end of file From b374cb4bdc65d812f3e230be15e70749b1b3a80e Mon Sep 17 00:00:00 2001 From: Kennith Leung Date: Tue, 15 Jan 2019 15:37:03 -0800 Subject: [PATCH 2/2] Add method --- blade.sublime-syntax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade.sublime-syntax b/blade.sublime-syntax index 0750d39..18426d5 100644 --- a/blade.sublime-syntax +++ b/blade.sublime-syntax @@ -90,7 +90,7 @@ contexts: pop: true - include: 'scope:source.php' - - match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elseif|embed|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\(\()' + - match: '(\s{0}|^)(\@)\b(acfrepeater|auth|block|break|can|cannot|choice|case|component|continue|dd|debug|dump|each|elsecan|elsecannot|elseif|embed|extends|for|foreach|forelse|guest|hasSection|hipchat|if|isset|include|includeIf|includeWhen|inject|lang|layout|macro|macrodef|method|minify|partial|php|push|render|section|servers|set|slack|slot|stack|story|switch|task|unless|unset|while|wpposts|yield)\b(?=(|\s*|)\(\()' captures: 0: punctuation.section.embedded.php 2: constant.other.inline-data.html