samedi 5 mai 2012

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!

Aucun commentaire:

Enregistrer un commentaire