psi_elements.md: Clarify confusion between Java and core PSI API class names similarity

This commit is contained in:
Karol Lewandowski 2025-03-04 15:56:30 +01:00
parent 30fdaea17e
commit 57c0a8c5d1

View File

@ -1,4 +1,4 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# PSI Elements
@ -13,6 +13,13 @@ For example, you can use PSI elements to perform code analysis, such as [code in
The [`PsiElement`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiElement.java) class is the common base class for PSI elements.
> PSI classes for specific languages usually start with a language prefix, for example, [`JsonArray`](%gh-ic%/json/split/gen/com/intellij/json/psi/JsonArray.java).
>
> The Java PSI API, developed many years ago when there was no plan to support other languages, uses the `Psi` prefix, for example, [`PsiIdentifier`](%gh-ic%/java/java-psi-api/src/com/intellij/psi/PsiIdentifier.java) or [`PsiElementFactory`](%gh-ic%/java/java-psi-api/src/com/intellij/psi/PsiElementFactory.java).
> Don't confuse Java with the core PSI API.
>
> To use Java PSI API, [add a dependency](plugin_dependencies.md) on the Java plugin.
## How do I get a PSI element?
| Context | API |