diff --git a/topics/basics/architectural_overview/uast.md b/topics/basics/architectural_overview/uast.md index b93ee06e3..facb2c117 100644 --- a/topics/basics/architectural_overview/uast.md +++ b/topics/basics/architectural_overview/uast.md @@ -1,9 +1,9 @@ - - -Handle different JVM languages syntax trees with a single implementation. + # UAST - Unified Abstract Syntax Tree +Handle different JVM languages syntax trees with a single implementation. + UAST (Unified Abstract Syntax Tree) is an abstraction layer on the [PSI](psi_elements.md) of different programming languages targeting the JVM (Java Virtual Machine). It provides a unified API for working with common language elements like classes and method declarations, literal values, and control flow operators. @@ -184,6 +184,8 @@ The latter is preferable as it offers better performance and more predictable re As a general rule, it's recommended to abstain from using `UastVisitor`: if you don't need to process many `UElement`s of different types and if the structure of elements is not very important, then it is better to walk the PSI-tree using `PsiElementVisitor` and [convert](#psi-to-uast-conversion) each `PsiElement` to its corresponding UAST explicitly via `UastContext.toUElement()`. +See also inspection Plugin DevKit | Code | 'UastHintedVisitorAdapter' hints problems (2024.2+). + ## UAST Performance Hints UAST is not a zero-cost abstraction: [some methods](https://youtrack.jetbrains.com/issue/KT-29856) could be unexpectedly expensive for some languages,