FYI: I have added a very rudimentary support for annotation processors (completions and messages) to the Extended Java
Editor module here:
more about the annotation processors support is here:
I am also attaching a patch for the NetBeans' ServiceProviderProcessor, that proposes types for the "service" attribute.
Jesse, would you mind if I would apply the patch? Thanks.
Go ahead but
[JG01] What is the purpose of the first two if-clauses? Seems to me that if these are ever true, there is a bug in the
[JG02] Shouldn't TypeCompletion.getValue return fqn + ".class"?
[JG01] Some of the conditions in the first two ifs may be validly true, according to the API - "annotated" (element) may
be null (is "userText" is non-null), "annotation" may be validly null too (if "annotated" is not null). Some of the
conditions are to make the method robust - they might be true if the user changes his/hers code enough (e.g. changing
the @Target of the annotation to METHOD). processingEnv == null would probably mean a container bug.
[JG02] Pelmel is currently not able to handle fqn + ".class" properly, but I am going to fix that so we can return fqn +
".class" if preferred (Pelmel should do the correct thing in both cases after the fix).
Recently, an initial support for running annotation processors inside Java editor has been implemented for j2se projects. (see changeset: http://hg.netbeans.org/main/rev/d59a1df3507f).
In order to use the code completion hints supplied by annotation processors in JavaCompletionProvider, I would like to propose a small extension to the java.source API (diff is attached).