How to get PsiArrayType to PsiType

Skip to first unread message

dehao wang

Nov 15, 2021, 8:45:41 AM11/15/21
to lint-dev
I'm having trouble getting the PsiType from a PsiArrayType, as I want to make sure that the class object in the array of classes extends from specific interfaces.

e.g i have this
Class[] classes = {

new TestClass1().registerServices(classes); //classes = PsiArrayType

Is there a way to get my PsiType<Class> from PsiArrayType<Class[]> ?

Tor Norbye

Nov 24, 2021, 2:23:38 PM11/24/21
to lint-dev
Try PsiType.getDeepComponentType() (or if you just want the type of the array, PsiArrayType.getComponentType)

-- Tor

Reply all
Reply to author
0 new messages