Is there a way to work backwards from methods possibly? I know that there is a stub index for public methods. Can I use this to get the javadoc for that stub?
If you are looking for Javadoc comments in Java code, then you can iterate over all of the source files looking for PsiDocComment elements. Then element.getText() should get you the entire comment. Just remember that all PsiDocComment elements are a tree themselves for several types of tokens that are parsed by IDEA.
If you want only the ones defined immediately before methods and/or classes, then once you obtain the appropriate element (from the index), look for a `PsiDocComment` element as an immediate child of the returned element.
@dgfried Yes, you can. (e.g. iterate all files in your project, find PsiFIle for the corresponding VirtualFile and query its PsiDocComments. Or process all methods from stub index). However, as I said, it may be unnecessarily slow because you would have to construct PSI for all members, even if they don't own javadoc. To text-search files for javadoc comment and then get the PSI for them only, seem to be a bit faster. But YMMV of course.
No.
Maybe, the quickest way would be to find all "/**" substrings in all files and then try to get the PSI from these positions.
Is there a way to work backwards from methods possibly? I know that there is a stub index for public methods. Can I use this to get the javadoc for that stub?
If you are looking for Javadoc comments in Java code, then you can iterate over all of the source files looking for PsiDocComment elements. Then element.getText() should get you the entire comment. Just remember that all PsiDocComment elements are a tree themselves for several types of tokens that are parsed by IDEA.
If you want only the ones defined immediately before methods and/or classes, then once you obtain the appropriate element (from the index), look for a `PsiDocComment` element as an immediate child of the returned element.
@dgfried Yes, you can. (e.g. iterate all files in your project, find PsiFIle for the corresponding VirtualFile and query its PsiDocComments. Or process all methods from stub index). However, as I said, it may be unnecessarily slow because you would have to construct PSI for all members, even if they don't own javadoc. To text-search files for javadoc comment and then get the PSI for them only, seem to be a bit faster. But YMMV of course.