MW

Improved PHP support in Kate

Not only KDevelop gets better and better PHP support — the Kate PHP syntax file also got a few new features and fixes over the last weeks. The good thing is of course that all users of KWrite, Kate, Quanta, KDevelop and other editors leveraging the Katepart benefit from these changes.

Improved HereDocs

screenshot of improved highlighting in PHP heredocs
screenshot of improved highlighting in PHP heredocs

I went over PHP related bugs on bugs.kde.org today and spotted one that was fairly easy to fix:

vim-like syntax highlighting support for heredocs in php.xml

With some magic (IncludeRules just rocks) I got it working fairly easy. You can see the results to the right.

Additionally I added code folding to heredocs, since often these strings include lots of text and hiding it often makes sense.

Better support for overlapping syntax regions

code folding with overlapping syntax regions
code folding with overlapping syntax regions

Another long standing bug ( accommodate overlapping syntax regions (especially for php)) got fixed by James Sleeman.

Finally PHP templates with code such as

    <?php if ( true ) : ?>
      <!-- some html stuff -->
    <?php elseif ( false ) { ?>
      <!-- some other html stuff -->
    <?php } ?>

can be folded properly. This kind of spaghetti code is used quite often in simple templates and having the posibility to fold it properly is a huge win in my opinion. Thanks to James Sleeman again!

Comments

Want to comment? Send me an email!

Comment by gp (not verified) (2009-08-27 00:00:00)

Great!

Great Work!

I hope in a official release…

giuseppe

Comment by Milian Wolff (2009-08-27 13:11:00)

You can get the most-recent language file right now, just go to “open/save” in the kate/kwrite settings and then to “Modes & Filetypes”. There you find a button “Download highlighting files” at the bottom.

Published on August 27, 2009.