From 8e65b2ec85fd0ada603a6ec7d5354ee04ad64f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 10 Jul 2024 15:34:12 +0200 Subject: [PATCH] uast.md: mention UastHintedVisitorAdapter inspection --- topics/basics/architectural_overview/uast.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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,