There is a structure in PHP called "heredoc" http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc that is very usefull to avoid a lot of "echo"es functions in the code. Kate doesn't recognice the end of the structure. Could you fix it ? Thank you Reproducible: Always Steps to Reproduce: 1.Create a PHP file 2.Open it with Kate 3.Insert a "heredoc" structure Actual Results: Incorrect highlightning of the code. Expected Results: To recognize the end of the "heredoc" structure. Example: username=getUsername($ID); echo <<<'EOT' Some HTML code goes here Hello $username, welcome back! Some HTML code goes here EOT; variable2 = "Code continues"
Confirmed. Arch Linux 64-bit Kate 16.04.2 KDE Frameworks 5.23.0 Qt 5.7 xcb wm
Works for me with KF5 based master. Perhaps I pasted the text wrongly in the editor, if you still can reproduce, please attach a test file.
Works correctly if the closing identifier is at the beginning of the line but not otherwise. The PHP manual says "Prior to PHP 7.3.0, the closing identifier must begin in the first column of the line." The syntax highlighting algorithm needs to be updated to remove this requirement.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/317
(In reply to Christoph Cullmann from comment #2) > Works for me with KF5 based master. > Perhaps I pasted the text wrongly in the editor, if you still can reproduce, > please attach a test file. It seem(In reply to Ray from comment #3) > Works correctly if the closing identifier is at the beginning of the line > but not otherwise. > The PHP manual says "Prior to PHP 7.3.0, the closing identifier must begin > in the first column of the line." > The syntax highlighting algorithm needs to be updated to remove this > requirement. It seems working for my test example, while end of heredoc is aligned to left margin, as you wrote. Thank you
Fixed by https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/317 Will be fixed in KDE Gear 22.08.