Brand New Annotations Support

Posted by Ondrej Brejla on Oracle Blogs See other posts from Oracle Blogs or by Ondrej Brejla
Published on Thu, 29 Mar 2012 08:51:26 -0500 Indexed on 2012/03/29 17:36 UTC
Read the original article Hit count: 354

Filed under:

Hi all! Today we would like to introduce you our brand new annotation support for NetBeans 7.2.

The first thing which is different is the look of annotations in code completion. As you can see, there is a new annotation icon and an annotation type. Because we have a lot of modules with their own annotations, we differ them in code completion window by their type. We support annotations for:

  • ApiGen (legacy PHPDoc annotations),
  • PHPUnit,
  • Doctrine 2 (ORM and ODM) and
  • Symfony 2.
Every annotation can be associated with some context. We recognize four of them:
  • function,
  • class/interface (type),
  • method and
  • field.

It means that you will get just proper annotations for your class field as well as your global function.

Brand New Annotations Support

Do you have your own annotations? Or do you simply miss some? There is nothing hard to add it in there. We have a simple UI for adding your custom annotations! It's in Tools -> Options -> PHP -> Annotations. Here you can simply add, edit or delete your annotations.

Brand New Annotations Support

When you try to create new one, all fields are prefilled by some default values. So you really don't have to remember "how to use that crazy freemarker syntax".

Brand New Annotations Support

If you are satisfied with your new annotation, you can see it in a code completion window among other annotations. As you can see it has its own "Custom" type.

Brand New Annotations Support

That's all for today and as usual, please test it and if you find something strange, don't hesitate to file a new issue (component php, subcomponent Editor). Thanks.

© Oracle Blogs or respective owner

Related posts about /Features