Is there an easy way to get class/field/method using specific annotations? Follow
I have an annotation: @DeepLock(name = '')
I want to find all class/field/methods using it, and get the name value inside the annotation.
Please sign in to leave a comment.
Like the code above, I need to get class FatherController and method speakWhat()
You should find the annotation PsiClass and pass it to the search method. Example:
You don't need this annotation to be a part of your project. It should be accessible in the project using the plugin.
Edit: Please do not delete posts after sending them 😉
Thank you very much!❤️❤️❤️
I've complety solved the problem!
I met another problem that the searching result lost some results:
I have two class(One is FatherController).
Another is TestController:
However, I use the code below:
The output is missing some results, where the annotation for TestController is totally missed.
Total deepLock number: 2
Plus: I copy a same class (rename TestController to SonController). While TestController cannot be found, SonController can. How?
It's unclear what the reason is.
Is the class that is not found in the project scope? Maybe indexes are broken/not up-to-date (try to clear them with File | Invalidate Caches... and see if the class is found after IDE restart)?