Creating a fake local variable in a method

Hi, I’ve never made an idea plugin before, but I am comfortable programming with java and kotlin. I am trying to create an idea plugin to mimic the javac transforms happening in GitHub - Auties00/Reified: Reified in Java 11 and upwards · GitHub , but I figured a good place to start would be adding a fake local variable to a scope / method. I asked A.I. what the best method to use for this would be, and it suggested com.intellij.psi.augment.PsiAugmentProvider, but it seems like that only works for fields / methods. Any help would be appreciated :slight_smile:.

I am using IntelliJ IDEA 2025.3.3 currently, but planning to update to latest soon.

Hi, PsiAugmentProvider doesn’t provide the ability to change PSI and add local variables. What kind of IDE functionality are you trying to provide? Maybe changing the PSI is not needed.