From d8e625df2d8718ecdd6395832e992de1ba1b4973 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Fri, 11 Aug 2023 14:33:30 +0300 Subject: [PATCH] fix(php): heredocs injections & highlights --- queries/php/highlights.scm | 8 ++++++++ queries/php/injections.scm | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/queries/php/highlights.scm b/queries/php/highlights.scm index 6b84b9405..6f061bb34 100644 --- a/queries/php/highlights.scm +++ b/queries/php/highlights.scm @@ -138,6 +138,13 @@ ] @string (escape_sequence) @string.escape +[ + (heredoc_start) + (heredoc_end) +] @label + +(nowdoc "'" @label) + (boolean) @boolean (null) @constant.builtin (integer) @number @@ -271,6 +278,7 @@ "&" "<<" ">>" + "<<<" "->" "?->" diff --git a/queries/php/injections.scm b/queries/php/injections.scm index e5782b7f8..78ae25ea4 100644 --- a/queries/php/injections.scm +++ b/queries/php/injections.scm @@ -15,6 +15,18 @@ (heredoc_end) @injection.language (#downcase! @injection.language)) +((heredoc + (heredoc_body) @injection.content + (heredoc_end) @injection.language + (#set! injection.include-children) + (#downcase! @injection.language))) + +((nowdoc + (nowdoc_body) @injection.content + (heredoc_end) @injection.language + (#set! injection.include-children) + (#downcase! @injection.language))) + ;; regex ((function_call_expression