mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 12:42:34 +03:00
php: Add syntax highlighting inside heredoc strings (#18368)
PHP heredoc strings make it easy to define string literals over multiple lines: ```php $someString = <<<EOT multiline text EOT; ``` That `EOT` identifier can be anything else, and it is actually being used in Sublime Text and VS Code to inject syntax highlighting for another language in said string, depending on the identifier. For instance, if the identifier is SQL, SQL syntax highlighting will be applied to the contents of the string. Likewise if the identifier is CSS or JS. ```php $someString = <<<SQL SELECT * FROM my_table SQL; ``` This PR changes the PHP extension so that it supports that feature too. Release Notes: - php: Added syntax highlighting inside heredoc strings
This commit is contained in:
parent
5b40debb5f
commit
898d48a574
@ -5,3 +5,5 @@
|
||||
((comment) @content
|
||||
(#match? @content "^/\\*\\*[^*]")
|
||||
(#set! "language" "phpdoc"))
|
||||
|
||||
((heredoc_body) (heredoc_end) @language) @content
|
||||
|
Loading…
Reference in New Issue
Block a user