Brand New Annotations Support
- by Ondrej Brejla
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.
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.
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".
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.
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.