# Using PsiShortNamesCache will not automatically import packages after entering the class name and pressing enter

**URL:** <https://platform.jetbrains.com/t/using-psishortnamescache-will-not-automatically-import-packages-after-entering-the-class-name-and-pressing-enter/3297>\
**Category:** IntelliJ Platform\
**Created:** [December 9, 2025, 3:13am UTC](https://platform.jetbrains.com/t/using-psishortnamescache-will-not-automatically-import-packages-after-entering-the-class-name-and-pressing-enter/3297 "2025-12-09T03:13:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![yuriy.artamonov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yuriy.artamonov/32/48_2.png) [@yuriy.artamonov](https://platform.jetbrains.com/u/yuriy.artamonov)\
**Post date:** [December 9, 2025, 8:46am UTC](https://platform.jetbrains.com/t/using-psishortnamescache-will-not-automatically-import-packages-after-entering-the-class-name-and-pressing-enter/3297/2 "2025-12-09T08:46:25Z")

</div>

Can only say that `PsiShortNamesCache` is not API to implement resolve of PsiClass, it is only used as an actual cache for performance reasons.

The right direction would be

> [@How to register a psi file created in memory into a project module?](https://platform.jetbrains.com/t/how-to-register-a-psi-file-created-in-memory-into-a-project-module/547/8):
>
> Consider providing an implementing of extension point of com.intellij.jvm.elementProvider (com.intellij.lang.jvm.facade.JvmElementProvider interface). This is the entry point for all synthetic declarations visible to Java files. In this case you won’t need to register synthetic files in the project model, and it will be enough to generate instances of PsiClass on the fly (or cache them in a storage of your choice). Can IntelliJ IDEA index a VirtualFile in memory? That’s possible, you can i…

---

_[View the full topic](https://platform.jetbrains.com/t/using-psishortnamescache-will-not-automatically-import-packages-after-entering-the-class-name-and-pressing-enter/3297)._
