A PSI (Program Structure Interface) file represents a hierarchy of PSI elements (so-called PSI trees). A single PSI file (itself being a PSI element) may expose several PSI trees in specific programming languages (see File View Providers). A PSI element, in its turn, can have child PSI elements.
PSI elements and operations at the level of individual PSI elements are used to explore the source code's internal structure as it is interpreted by the IntelliJ Platform. For example, you can use PSI elements to perform code analysis, such as code inspections or intention actions.
The PsiElement
class is the common base class for PSI elements.
PSI classes for specific languages usually start with a language prefix, for example, JsonArray
.
The Java PSI API, developed many years ago when there was no plan to support other languages, uses the Psi
prefix, for example, PsiIdentifier
or PsiElementFactory
. Don't confuse Java with the core PSI API.
To use Java PSI API, add a dependency on the Java plugin.
How do I get a PSI element? What can I do with PSI elements?See PSI Cookbook and Modifying the PSI.
05 August 2025
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4