# How to register a psi file created in memory into a project module?

**URL:** <https://platform.jetbrains.com/t/how-to-register-a-psi-file-created-in-memory-into-a-project-module/547>\
**Category:** IntelliJ Platform\
**Created:** [February 17, 2025, 6:58am UTC](https://platform.jetbrains.com/t/how-to-register-a-psi-file-created-in-memory-into-a-project-module/547 "2025-02-17T06:58:58Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![maxmedvedev](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/maxmedvedev/32/2954_2.png) [@maxmedvedev](https://platform.jetbrains.com/u/maxmedvedev)\
**Post date:** [February 21, 2025, 9:03am UTC](https://platform.jetbrains.com/t/how-to-register-a-psi-file-created-in-memory-into-a-project-module/547/8 "2025-02-21T09:03:17Z")

</div>

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 implement a custom virtual file system, and files stored in such a VFS will be indexed. But this is a rather complex and not well documented approach. See com.intellij.openapi.vfs.newvfs.NewVirtualFileSystem as a starting point.

---

_[View the full topic](https://platform.jetbrains.com/t/how-to-register-a-psi-file-created-in-memory-into-a-project-module/547)._
