FakePsiElement (@NotNull PsiElement place, @NotNull PsiType varType) { return new FakePsiElement() { @Override public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @NotNull ResolveState state, PsiElement lastParent, @NotNull PsiElement place) { return processor.execute(new LightVariableBuilder<>("xxx", varType, place), ResolveState.initial()); } @Override public PsiElement getParent() { return place; } }; }