# How to register a custom PsiClass into a project so that it can automatically prompt when entering code

**URL:** <https://platform.jetbrains.com/t/how-to-register-a-custom-psiclass-into-a-project-so-that-it-can-automatically-prompt-when-entering-code/3286>\
**Category:** IntelliJ Platform\
**Created:** [December 8, 2025, 3:28am UTC](https://platform.jetbrains.com/t/how-to-register-a-custom-psiclass-into-a-project-so-that-it-can-automatically-prompt-when-entering-code/3286 "2025-12-08T03:28:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hxl49508](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/hxl49508/32/1117_2.png) [@hxl49508](https://platform.jetbrains.com/u/hxl49508)\
**Post date:** [December 8, 2025, 3:28am UTC](https://platform.jetbrains.com/t/how-to-register-a-custom-psiclass-into-a-project-so-that-it-can-automatically-prompt-when-entering-code/3286/1 "2025-12-08T03:28:54Z")

</div>

My question and [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) Similar, But I couldn’t find the answer , Can anyone help me,

I will use the following code to create a Java code editor

```auto
  EditorFactory editorFactory = EditorFactory.getInstance();
        editor = editorFactory.createEditor(document, project, JavaFileType.INSTANCE, false);

```

I am writing custom code that requires the use of classes outside of the project. I want this editor to recognize additional PsiClasses. How should I register PsiClasses

---

<div class="post-metadata">

**Author:** ![robert.novotny](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/robert.novotny/32/2046_2.png) [@robert.novotny](https://platform.jetbrains.com/u/robert.novotny)\
**Post date:** [December 8, 2025, 9:11am UTC](https://platform.jetbrains.com/t/how-to-register-a-custom-psiclass-into-a-project-so-that-it-can-automatically-prompt-when-entering-code/3286/2 "2025-12-08T09:11:46Z")

</div>

If you need to open a Java source code (`.java`) that is outside of the project, use the [[`PsiFileFactory.createFileFromText()`](https://github.com/JetBrains/intellij-community/tree/idea/252.27397.103/platform/core-api/src/com/intellij/psi/PsiFileFactory.java). You can provide a `Language` parameter to indicate that this is a Java source.

---

<div class="post-metadata">

**Author:** ![hxl49508](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/hxl49508/32/1117_2.png) [@hxl49508](https://platform.jetbrains.com/u/hxl49508)\
**Post date:** [December 8, 2025, 9:14am UTC](https://platform.jetbrains.com/t/how-to-register-a-custom-psiclass-into-a-project-so-that-it-can-automatically-prompt-when-entering-code/3286/3 "2025-12-08T09:14:03Z")

</div>

This cannot solve my problem, my problem and [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) Same, but there’s no answer inside
