I tried implementing completion for Java/JavaDoc comments.
ReferenceProvidersRegistry registry = ReferenceProvidersRegistry.getInstance(project);
registry.registerReferenceProvider(PsiComment.class, new MyReferenceProvider());
but it doesn't work (getReferencesByElement of MyReferenceProvider is not called when I press ctrl+space after xxx. withing the comment)
CompletionUtil.registerCompletionData(StdFileTypes.JAVA, new MyCompletionData());
doesn't work as well (completeReference of MyCompletionData is not called when I press ctrl+space after xxx. withing the comment. It is called outside the comment)
Any ideas how to implement it for java and javadoc comments?