Saturday, January 23, 2010

KDevelop/Quanta4 Css Language Support

I'm currently working on a important part of Quanta4, Css Language support. The only thing supported for now is code completion for standalone css files:

But that is the most useful feature a Web IDE can have.

Still on my todo list is:
  • validation (should be easy with the existing parser)
  • Outline navigation (should be not that hard either)
  • Support <style> tags and inline styles in html files
A few notes on how I implemented the plugin:
  • I reused WebKit's flex lexer
  • then wrote a parser using kdevelop-pg-qt based on WebKits bison grammar. A major difference is that it successfully parses incomplete Css - as it is during writing in the editor.
  • The code completion parses the file on invocation and goes through the Ast (resulting from the parser) to find the correct type to show.
  • Then, using an XML file borrowed from Aptana's code assist, the shown completion items are determined.

How to test (feedback is very welcome!)
  • install kdevelop
  • install trunk/playground/devtools/kdevelop4-extra-plugins/css
Ruan recently recently announced on kdevelop-devel that he will work on html/xml language support. There is hope for Quanta4!

Gdb Qt pretty printers updated

I just commited an update to the Gdb Qt pretty printers, they work now for Qt 4.6. (I didn't test 4.5, but most won't work anymore I guess)

The printers need to poke around in private members, that's why they depend on a specific Qt version.

They are still located in the kdevelop git, instructions on how to enable them see here. (the svn url changed as kdevelop is now in extragear)

Unfortunately my merge request for Qt that would add them directly to Qt got rejected, so it is a bit difficult to support multiple Qt versions - for now 4.6 only is supported. Perhaps in future more people will discover this feature in Gdb and they will get added... You know where to find them.