org.jetbrains.kotlin.psi¶
Types¶
BuilderByPattern¶
class BuilderByPattern<TElement>
A builder that assembles a createByPattern pattern step by step, appending fixed text, expressions, type references, names, and child ranges in order and tracking their placeholders automatically.
FakeImplicitSpreadValueArgumentForCallableReference¶
A synthetic spread ValueArgument used when modeling the implicit vararg spread of a callable reference.
FakePositionalValueArgumentForCallableReference¶
A synthetic positional ValueArgument used when modeling the arguments of a callable reference, where arguments have no corresponding source PSI.
IfNotParsed¶
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.METHOD])
annotation class IfNotParsed
Comes along with @Nullable to indicate null is only possible if parsing error present
KotlinCodeFragmentImportModificationListener¶
fun interface KotlinCodeFragmentImportModificationListener
A listener notified when the imports of a KtCodeFragment are modified.
KotlinDeclarationNavigationPolicy¶
interface KotlinDeclarationNavigationPolicy
A service that maps a KtDeclaration between its "original" and its "navigation" element.
KotlinReferenceProvidersService¶
open class KotlinReferenceProvidersService
A project service that collects the PsiReferences contributed to a PSI element by the registered reference providers.
KotlinStringLiteralTextEscaper¶
class KotlinStringLiteralTextEscaper(host: KtStringTemplateExpression) : LiteralTextEscaper<KtStringTemplateExpression>
A LiteralTextEscaper for Kotlin string literals, enabling language injection into them.
KtAnnotated¶
interface KtAnnotated : KtElement
Represents an element that owns annotations (the element may or may not be the parent for the annotations).
KtAnnotatedExpression¶
open class KtAnnotatedExpression : KtExpressionImpl, KtAnnotated, KtAnnotationsContainer
Represents an expression with annotations applied to it.
KtAnnotation¶
open class KtAnnotation : KtElementImplStub<KotlinPlaceHolderStub<KtAnnotation>>
Represents a bracketed group of annotation entries applied to the same use-site target, which avoids repeating the target for each entry.
KtAnnotationEntry¶
open class KtAnnotationEntry : KtElementImplStub<KotlinAnnotationEntryStub> , KtCallElement
Represents a single annotation applied to a declaration or expression.
KtAnnotationsContainer¶
interface KtAnnotationsContainer : KtElement
Represents an element that may contain annotations (the container is the parent for them).
KtAnnotationUseSiteTarget¶
Represents an annotation use-site target that specifies where the annotation should be applied.
KtAnonymousInitializer¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtAnonymousInitializer : KtDeclaration, KtStatementExpression
Represents an anonymous initializer: a piece of code that runs during initialization without introducing a named declaration.
KtArrayAccessExpression¶
Represents an indexed access expression using square brackets.
KtBackingField¶
Represents an explicit backing field declaration for a property.
KtBinaryExpression¶
Represents a binary expression with a left operand, operator, and right operand.
KtBinaryExpressionWithTypeRHS¶
Represents a type cast expression using as or as?.
KtBlockCodeFragment¶
class KtBlockCodeFragment(
viewProvider: FileViewProvider,
imports: String?,
context: PsiElement?
) : KtCodeFragment
A KtCodeFragment whose content is a block of statements, as opposed to a single expression.
KtBlockExpression¶
open class KtBlockExpression : LazyParseablePsiElement, KtElement, KtExpression, KtStatementExpression
Represents a block of statements enclosed in curly braces.
KtBlockStringTemplateEntry¶
Represents a block interpolation in a string template using ${expression}.
KtBreakExpression¶
open class KtBreakExpression : KtExpressionWithLabel, KtStatementExpression
Represents a break expression that terminates the enclosing loop.
KtCallableDeclaration¶
Represents a declaration with the structure of a callable: it may declare value parameters, an extension receiver, type parameters (with constraints), and a return type.
KtCallableReferenceExpression¶
Represents a callable reference expression using double colon syntax.
KtCallElement¶
interface KtCallElement : KtElement, KtResolvableCall
Represents an element with call syntax: a callee together with type arguments and value arguments.
KtCallExpression¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
open class KtCallExpression : KtExpressionImplStub<KotlinPlaceHolderStub<KtCallExpression>> , KtCallElement, KtReferenceExpression
Represents a function call expression, including the callee and arguments.
KtCatchClause¶
open class KtCatchClause : KtElementImpl
Represents a catch clause in a try expression.
KtClass¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
open class KtClass : KtClassOrObject
Represents a class or interface declaration.
KtClassBody¶
Represents the body of a class or object declaration enclosed in curly braces.
KtClassInitializer¶
Represents an init block in a class that executes during instance initialization.
KtClassLikeDeclaration¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtClassLikeDeclaration : KtNamedDeclaration
Represents a declaration that introduces a classifier referable by a ClassId, namely a class, interface, object, or type alias.
KtClassLiteralExpression¶
Represents a class literal expression that gets a class reference.
KtClassOrObject¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
abstract class KtClassOrObject : KtTypeParameterListOwnerStub<KotlinClassOrObjectStub<out KtClassOrObject>> , KtDeclarationContainer, KtNamedDeclaration, KtPureClassOrObject, KtClassLikeDeclaration
Represents a class, interface, object, or enum entry declaration.
KtCodeFragment¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
abstract class KtCodeFragment(
viewProvider: FileViewProvider,
imports: String?,
elementType: IElementType,
context: PsiElement?
) : KtFile, KtCodeFragmentBase
A synthetic, in-memory Kotlin file that holds a standalone snippet of code together with a context.
KtCodeFragmentBase¶
interface KtCodeFragmentBase : JavaCodeFragment
The Java-interop base for KtCodeFragment, adapting the platform's JavaCodeFragment contract to Kotlin.
KtCollectionLiteralExpression¶
Represents a collection literal expression.
KtCompanionBlock¶
Represents a companion block.
KtConstantExpression¶
Represents a constant literal expression such as numbers, booleans, or characters.
KtConstructor¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
abstract class KtConstructor<T : KtConstructor<T>> : KtDeclarationStub<KotlinConstructorStub<T>> , KtFunction
Represents a constructor of a class or object.
KtConstructorCalleeExpression¶
Represents the callee part in a constructor invocation, such as in annotations or super type calls.
KtConstructorDelegationCall¶
open class KtConstructorDelegationCall : KtElementImpl, KtCallElement
Represents a constructor delegation call to this() or super().
KtConstructorDelegationReferenceExpression¶
Represents the this or super reference in a constructor delegation call.
KtContainerNode¶
open class KtContainerNode : KtElementImpl
Represents an auxiliary container node that wraps other PSI elements without adding semantic meaning.
KtContainerNodeForControlStructureBody¶
A wrapper node that holds the body of a control structure, such as an if/else branch or a loop body.
KtContextParameterList¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
abstract class KtContextParameterList : KtElementImplStub<KotlinPlaceHolderStub<KtContextParameterList>>
The class representing a context parameter list in a declaration or functional type.
KtContextReceiver¶
Represents a single context receiver in a context receiver list.
KtContextReceiverList¶
Represents a list of context receivers declared on a function, property, or class.
KtContinueExpression¶
open class KtContinueExpression : KtExpressionWithLabel, KtStatementExpression
Represents a continue expression that skips to the next iteration of the enclosing loop.
KtContractEffect¶
Represents a single effect declaration inside a contract block.
KtContractEffectList¶
Represents the list of contract effects in a contract block.
KtDeclaration¶
interface KtDeclaration : KtExpression, KtModifierListOwner
Represents a Kotlin declaration: a construct that introduces a named or structural entity, such as a class, function, property, type alias, parameter, or type parameter.
KtDeclarationContainer¶
interface KtDeclarationContainer
Represents an element that contains a list of declarations, such as a file, a class or object body, or a script.
KtDeclarationImpl¶
abstract class KtDeclarationImpl : KtExpressionImpl, KtDeclaration
Base implementation of KtDeclaration backed directly by the AST tree.
KtDeclarationModifierList¶
open class KtDeclarationModifierList : KtModifierList
Represents a modifier list attached to a declaration.
KtDeclarationStub¶
abstract class KtDeclarationStub<T : StubElement<*>?> : KtModifierListOwnerStub<T> , KtDeclaration
Base implementation of KtDeclaration that may be backed either by the AST tree or by a stub.
KtDeclarationWithBody¶
interface KtDeclarationWithBody : KtDeclaration
Represents a declaration that can have a body, such as a function, a property accessor, or an anonymous initializer.
KtDeclarationWithInitializer¶
interface KtDeclarationWithInitializer : KtDeclaration
Represents a declaration that can have an expression after =, such as a property, a destructuring declaration, a named function, or a property accessor.
KtDeclarationWithReturnType¶
interface KtDeclarationWithReturnType : KtDeclaration
Represents a Kotlin declaration that semantically has a return type (ex.
KtDelegatedSuperTypeEntry¶
open class KtDelegatedSuperTypeEntry : KtSuperTypeListEntry
Represents an interface delegation in the super type list using the by keyword.
KtDestructuringDeclaration¶
Represents a destructuring declaration that unpacks an object into multiple variables.
KtDestructuringDeclarationEntry¶
open class KtDestructuringDeclarationEntry : KtNamedDeclarationNotStubbed, KtVariableDeclaration, KtResolvableCall
Represents a single entry in a destructuring declaration.
KtDotQualifiedExpression¶
Represents a dot-qualified expression for member/extension access.
KtDoubleColonExpression¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtDoubleColonExpression : KtExpression, KtResolvable
Represents an expression that uses the :: token, namely a callable reference or a class literal.
KtDoWhileExpression¶
open class KtDoWhileExpression : KtWhileExpressionBase
Represents a do-while loop that executes its body at least once before checking the condition.
KtDynamicType¶
open class KtDynamicType : KtElementImplStub<KotlinPlaceHolderStub<KtDynamicType>> , KtTypeElement
Represents the dynamic type used in Kotlin/JS for interoperability.
KtElement¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtElement : NavigatablePsiElement, KtPureElement
The root interface of the Kotlin PSI (Program Structure Interface) hierarchy.
KtElementImpl¶
open class KtElementImpl : ASTWrapperPsiElement, KtElement
Base implementation of KtElement backed directly by the AST tree.
KtElementImplStub¶
open class KtElementImplStub<T : StubElement<*>?> : StubBasedPsiElementBase<T> , KtElement, StubBasedPsiElement<T>
Base implementation of KtElement that may be backed either by the AST tree or by a stub.
KtEnumEntry¶
open class KtEnumEntry : KtClass, KtDeclarationWithReturnType
Represents an enum entry within an enum class.
KtEnumEntrySuperclassReferenceExpression¶
Represents a synthetic reference to the enum class constructor in an enum entry initializer.
KtErrorSafeQualifiedExpression¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtErrorSafeQualifiedExpression : KtQualifiedExpression
Represents an error-safe-call expression using the |. operator.
KtEscapeStringTemplateEntry¶
open class KtEscapeStringTemplateEntry : KtStringTemplateEntry
Represents an escape sequence in a string template.
KtExperimentalApi¶
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS])
@RequiresOptIn(message = "Experimental API with no compatibility guarantees")
annotation class KtExperimentalApi
Marks an API as experimental. The API is intended for user consumption, but it's not stable and might change at any moment, or even be removed, without a deprecation cycle.
KtExpression¶
interface KtExpression : KtElement
Represents a Kotlin expression: a piece of code that can be evaluated to a value, such as a literal, an operator application, a function call, or an if/when used as a value.
KtExpressionCodeFragment¶
class KtExpressionCodeFragment(
project: Project,
name: String,
text: CharSequence,
imports: String?,
context: PsiElement?
) : KtCodeFragment
A KtCodeFragment whose content is a single expression.
KtExpressionImpl¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
abstract class KtExpressionImpl : KtElementImpl, KtExpression
Base implementation of KtExpression backed directly by the AST tree.
KtExpressionImplStub¶
abstract class KtExpressionImplStub<T : StubElement<*>?> : KtElementImplStub<T> , KtExpression
Base implementation of KtExpression that may be backed either by the AST tree or by a stub.
KtExpressionWithLabel¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
open class KtExpressionWithLabel : KtExpressionImpl
Represents an expression that may contain a label qualifier. A KtLabeledExpression declares a label with label@, while labeled break/continue, qualified return, and qualified this/super expressions reference one with @label.
KtFile¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
open class KtFile(viewProvider: FileViewProvider, isCompiled: Boolean) : KtCommonFile, PsiClassOwner
The root of the PSI tree for a Kotlin source or script file.
KtFileAnnotationList¶
Represents a list of file-level annotations at the beginning of a Kotlin file.
KtFileClassProvider¶
interface KtFileClassProvider
A service that computes the Java light classes exposed by a KtFile (its file facade class and top-level class declarations).
KtFinallySection¶
open class KtFinallySection : KtElementImpl, KtStatementExpression
Represents a finally block in a try expression.
KtForExpression¶
open class KtForExpression : KtLoopExpression, KtResolvableCall
Represents a for loop.
KtFunction¶
interface KtFunction : KtDeclarationWithBody, KtCallableDeclaration
Represents a function: a named function, a function literal (lambda or anonymous function), or a constructor.
KtFunctionLiteral¶
open class KtFunctionLiteral : KtFunctionNotStubbed
Represents the body of a lambda expression, containing parameters and the function body.
KtFunctionNotStubbed¶
abstract class KtFunctionNotStubbed : KtTypeParameterListOwnerNotStubbed, KtFunction
Base implementation of KtFunction for functions that are never backed by a stub, such as function literals and anonymous functions.
KtFunctionType¶
open class KtFunctionType : KtElementImplStub<KotlinFunctionTypeStub> , KtTypeElement, KtResolvable
Represents a function type with parameters and return type.
KtFunctionTypeReceiver¶
Represents the receiver type in a function type with receiver.
KtIdeApi¶
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS])
@RequiresOptIn(message = "Internal API which is used only from the IntelliJ Kotlin plugin. Such an API should not be used in other places since it has no compatibility guarantees")
annotation class KtIdeApi
Marks an API as designed for and internal to the Kotlin IntelliJ plugin. The API is not intended for public user consumption and does not have any compatibility guarantees.
KtIfExpression¶
open class KtIfExpression : KtExpressionImpl
Represents an if expression with condition, then branch, and optional else branch.
KtImplementationDetail¶
@RequiresOptIn(message = "Internal API which should not be used outside the Kotlin PSI API implementation modules as it does not have any compatibility guarantees")
annotation class KtImplementationDetail
Marks an API as an implementation detail of the Kotlin PSI API. Such APIs are not intended to be used outside the implementation of the PSI API and have no compatibility guarantees.
KtImportAlias¶
class KtImportAlias : KtElementImplStub<KotlinImportAliasStub> , PsiNameIdentifierOwner
Represents an import alias that provides an alternative name for an imported declaration.
KtImportDirective¶
open class KtImportDirective : KtElementImplStub<KotlinImportDirectiveStub> , KtImportInfo
Represents a single import directive.
KtImportInfo¶
interface KtImportInfo
A representation-agnostic view of a single import statement.
KtImportList¶
open class KtImportList : KtElementImplStub<KotlinPlaceHolderStub<KtImportList>>
Represents the list of import directives in a Kotlin file.
KtInitializerList¶
open class KtInitializerList : KtElementImplStub<KotlinPlaceHolderStub<KtInitializerList>>
Represents the initializer list for an enum entry with constructor arguments.
KtInstanceExpressionWithLabel¶
abstract class KtInstanceExpressionWithLabel : KtExpressionWithLabel, KtResolvable
A common base class for this and super expressions, both of which refer to an instance receiver and may have an optional label qualifier.
KtIntersectionType¶
Represents an intersection type combining two types with {@code &}.
KtIsExpression¶
open class KtIsExpression : KtExpressionImpl, KtOperationExpression
Represents a type check expression using is or !is.
KtLabeledExpression¶
class KtLabeledExpression : KtExpressionWithLabel, PsiNameIdentifierOwner
Represents a labeled expression with a label prefix.
KtLabelReferenceExpression¶
Represents a reference to a label in a labeled expression, such as @main in return@main.
KtLambdaArgument¶
Represents a trailing lambda argument passed outside of parentheses.
KtLambdaExpression¶
open class KtLambdaExpression : LazyParseablePsiElement, KtExpression
Represents a lambda expression with optional parameters and a body.
KtLiteralStringTemplateEntry¶
open class KtLiteralStringTemplateEntry : KtStringTemplateEntry
Represents a literal text segment in a string template without any interpolation.
KtLoopExpression¶
abstract class KtLoopExpression : KtExpressionImpl, KtStatementExpression
Represents a loop expression: a for, while, or do-while loop.
KtModifierList¶
abstract class KtModifierList : KtElementImplStub<KotlinModifierListStub> , KtAnnotationsContainer
Represents the list of modifiers and annotations that precede a declaration or other KtModifierListOwner.
KtModifierListOwner¶
interface KtModifierListOwner : PsiElement, KtAnnotated
Represents an element that may own a KtModifierList, that is, a sequence of modifiers (such as public, inline, suspend) and annotations.
KtModifierListOwnerStub¶
open class KtModifierListOwnerStub<T : StubElement<*>?> : KtElementImplStub<T> , KtModifierListOwner
Base implementation of KtModifierListOwner that may be backed either by the AST tree or by a stub.
KtNamed¶
interface KtNamed
Represents an element that carries a Kotlin Name, such as a named declaration or a label.
KtNamedDeclaration¶
interface KtNamedDeclaration : KtDeclaration, PsiNameIdentifierOwner, KtStatementExpression, KtNamed
Represents a KtDeclaration that introduces a name, such as a class, function, property, or type alias.
KtNamedDeclarationStub¶
abstract class KtNamedDeclarationStub<T : KotlinStubWithFqName<*>?> : KtDeclarationStub<T> , KtNamedDeclaration
Base implementation of KtNamedDeclaration that may be backed either by the AST tree or by a stub.
KtNamedDeclarationUtil¶
class KtNamedDeclarationUtil
Static helpers for computing fully qualified names of KtNamedDeclarations from their PSI structure.
KtNamedFunction¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
open class KtNamedFunction : KtTypeParameterListOwnerStub<KotlinFunctionStub> , KtFunction, KtDeclarationWithInitializer
Represents a named function declaration.
KtNameReferenceExpression¶
Represents a simple name reference to a variable, function, or type.
KtNonPublicApi¶
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS])
@RequiresOptIn(message = "Internal API which is used in projects developed by JetBrains")
annotation class KtNonPublicApi
Marks an API as internal to projects developed by JetBrains. Such APIs are not intended for public user consumption and have less strict compatibility guarantees. For example, a change to the API might be implemented without a deprecation cycle.
KtNullableType¶
Represents a nullable type marked with a question mark.
KtObjectDeclaration¶
class KtObjectDeclaration : KtClassOrObject
Represents an object declaration, including companion objects and named objects.
KtObjectLiteralExpression¶
Represents an object literal expression that creates an anonymous object.
KtOperationExpression¶
interface KtOperationExpression : KtExpression
Represents an expression built around an operation sign, such as a unary, binary, or "is"/"as" expression.
KtOperationReferenceExpression¶
Represents an operator symbol in an expression.
KtPackageDirective¶
Represents a package directive that declares the package of a Kotlin file.
KtParameter¶
Represents a parameter declaration in various contexts.
KtParameterList¶
open class KtParameterList : KtElementImplStub<KotlinPlaceHolderStub<KtParameterList>>
Represents a list of parameters in various contexts.
KtParenthesizedExpression¶
Represents an expression enclosed in parentheses.
KtPlatformInterface¶
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.TYPEALIAS])
@RequiresOptIn(message = "An API intended for the Analysis API engine and its platform implementations. The API is neither stable nor intended for consumption by PSI users.")
annotation class KtPlatformInterface
Marks an API intended for the Analysis API engine and its platform implementations.
KtPostfixExpression¶
open class KtPostfixExpression : KtUnaryExpression
Represents a postfix unary expression where the operator follows the operand.
KtPrefixExpression¶
open class KtPrefixExpression : KtUnaryExpression
Represents a prefix unary expression where the operator precedes the operand.
KtPrimaryConstructor¶
Represents a primary constructor explicitly declared in a class header.
KtProjectionKind¶
enum class KtProjectionKind
The kind of variance projection applied to a type argument in a KtTypeProjection.
KtProperty¶
Represents a property declaration with an optional getter and setter.
KtPropertyAccessor¶
Represents a property getter or setter accessor.
KtPropertyDelegate¶
open class KtPropertyDelegate : KtElementImpl, KtResolvableCall
Represents a property delegate expression that provides the implementation for property accessors.
KtPsiFactory¶
class KtPsiFactory
A factory for creating Kotlin PSI elements programmatically, usually by parsing a snippet of source text.
KtPsiInconsistencyHandling¶
@RequiresOptIn
annotation class KtPsiInconsistencyHandling
Functions and classes annotated with KtPsiInconsistencyHandling are not intended for general-purpose use, but for working with possibly inconsistent PSI. The specific circumstances need to be described in the documentation of the annotated function/class.
KtPsiMutationService¶
interface KtPsiMutationService
Service responsible for Kotlin PSI mutation operations whose implementation is provided by the Kotlin plugin environment.
KtPsiUtil¶
open class KtPsiUtil
A collection of static helper methods for working with the Kotlin PSI.
KtPureClassOrObject¶
interface KtPureClassOrObject : KtPureElement, KtDeclarationContainer
A minimal interface that KtClassOrObject implements for the purpose of code-generation that does not need the full power of PSI.
KtPureElement¶
interface KtPureElement
A minimal interface that KtElement implements for the purpose of code-generation that does not need the full power of PSI.
KtQualifiedExpression¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtQualifiedExpression : KtExpression, KtResolvableCall
Represents a qualified expression, which accesses a member or extension on a receiver using the ., ?., or |. operator.
KtReferenceExpression¶
interface KtReferenceExpression : KtExpression, KtResolvable
Represents an expression that references a declaration and can therefore be resolved to it, such as a name reference, an array access, or a call expression.
KtReturnExpression¶
open class KtReturnExpression : KtExpressionWithLabel, KtStatementExpression, KtResolvable
Represents a return expression that returns a value from a function or lambda.
KtSafeQualifiedExpression¶
Represents a safe-call expression using the ?. operator.
KtScript¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
open class KtScript : KtNamedDeclarationStub<KotlinScriptStub> , KtDeclarationContainer
Represents a Kotlin script file containing top-level statements and declarations.
KtScriptInitializer¶
Represents an initializer expression in a script. Effectively, it is a wrapper for top-level expressions
KtSecondaryConstructor¶
Represents a secondary constructor declared in the class body.
KtSimpleNameExpression¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtSimpleNameExpression : KtReferenceExpression
Represents a simple name reference: an unqualified reference to a declaration by its name, or an operation sign that references a declaration (for example, the + of a binary expression).
KtSimpleNameExpressionImpl¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
abstract class KtSimpleNameExpressionImpl : KtExpressionImpl, KtSimpleNameExpression
Base implementation of KtSimpleNameExpression shared by its stub-based and AST-based variants.
KtSimpleNameStringTemplateEntry¶
Represents a simple variable interpolation in a string template using $name.
KtSpiExtensionPoint¶
@Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY])
@RequiresOptIn(message = "An API designed for implementation only. Direct usage has no compatibility guarantees.")
annotation class KtSpiExtensionPoint
Marks an API as a service provider interface extension point. Such APIs are designed to be implemented, not called directly. There are no compatibility guarantees for usage of these APIs, only for their implementation.
KtStatementExpression¶
interface KtStatementExpression
This is an interface to show that KtExpression is not actually an expression (in the sense that this expression can be placed after "val x = ").
KtStringInterpolationPrefix¶
Represents the multi-dollar interpolation prefix for string templates.
KtStringTemplateEntry¶
abstract class KtStringTemplateEntry : KtElementImplStub<KotlinPlaceHolderWithTextStub<out KtStringTemplateEntry>>
Represents a single entry of a KtStringTemplateExpression, that is, one segment of a string literal.
KtStringTemplateEntryWithExpression¶
abstract class KtStringTemplateEntryWithExpression : KtStringTemplateEntry
Represents a string template entry that interpolates an expression, using either the $name or the ${...} syntax.
KtStringTemplateExpression¶
open class KtStringTemplateExpression : KtExpressionImplStub<KotlinPlaceHolderStub<KtStringTemplateExpression>> , PsiLanguageInjectionHost, ContributedReferenceHost
Represents a string literal, including simple strings and string templates with interpolation.
KtStubbedPsiUtil¶
class KtStubbedPsiUtil
Static helpers for navigating the Kotlin PSI in a way that also works over stubs.
KtSuperExpression¶
Represents a super expression that refers to the superclass implementation.
KtSuperTypeCallEntry¶
open class KtSuperTypeCallEntry : KtSuperTypeListEntry, KtCallElement
Represents a superclass constructor call in the super type list.
KtSuperTypeEntry¶
open class KtSuperTypeEntry : KtSuperTypeListEntry
Represents an interface type in the super type list (without a constructor call).
KtSuperTypeList¶
open class KtSuperTypeList : KtElementImplStub<KotlinPlaceHolderStub<KtSuperTypeList>>
Represents the list of super types after the colon in a class header.
KtSuperTypeListEntry¶
open class KtSuperTypeListEntry : KtElementImplStub<KotlinPlaceHolderStub<out KtSuperTypeListEntry>> , KtResolvable
Represents a single entry in a super type list.
KtThisExpression¶
open class KtThisExpression : KtInstanceExpressionWithLabel
Represents a this expression that refers to the current receiver.
KtThrowExpression¶
open class KtThrowExpression : KtExpressionImpl, KtStatementExpression
Represents a throw expression that throws an exception.
KtTreeVisitor¶
open class KtTreeVisitor<D> : KtVisitor<Void, D>
A KtVisitor that recursively traverses the whole PSI subtree.
KtTreeVisitorVoid¶
open class KtTreeVisitorVoid : KtVisitorVoid
A KtVisitorVoid that recursively traverses the whole PSI subtree.
KtTryExpression¶
open class KtTryExpression : KtExpressionImpl
Represents a try expression with catch clauses and optional finally block.
KtTypeAlias¶
Represents a type alias declaration.
KtTypeArgumentList¶
Represents a list of type arguments in angle brackets.
KtTypeCodeFragment¶
class KtTypeCodeFragment(
project: Project,
name: String,
text: CharSequence,
context: PsiElement?
) : KtCodeFragment
A KtCodeFragment whose content is a type reference.
KtTypeConstraint¶
Represents a single type constraint in a where clause.
KtTypeConstraintList¶
Represents a where clause containing type constraints.
KtTypeElement¶
interface KtTypeElement : KtElement
Represents the actual type syntax inside a KtTypeReference, stripped of any leading annotations and modifiers.
KtTypeParameter¶
open class KtTypeParameter : KtNamedDeclarationStub<KotlinTypeParameterStub>
Represents a type parameter in a generic declaration.
KtTypeParameterList¶
Represents a list of type parameters in angle brackets.
KtTypeParameterListOwner¶
interface KtTypeParameterListOwner : KtNamedDeclaration
Represents a declaration that may declare type parameters, such as a class, function, or type alias.
KtTypeParameterListOwnerStub¶
abstract class KtTypeParameterListOwnerStub<T : KotlinStubWithFqName<*>?> : KtNamedDeclarationStub<T> , KtTypeParameterListOwner
Base implementation of KtTypeParameterListOwner that may be backed either by the AST tree or by a stub.
KtTypeProjection¶
open class KtTypeProjection : KtModifierListOwnerStub<KotlinTypeProjectionStub>
Represents a type projection in a type argument, including variance modifiers or star projection.
KtTypeReference¶
Represents a type reference.
KtUnaryExpression¶
abstract class KtUnaryExpression : KtExpressionImplStub<KotlinPlaceHolderStub<out KtUnaryExpression>> , KtOperationExpression, KtResolvableCall
Represents a unary expression with an operator and a single operand.
KtUnionType¶
@SubclassOptInRequired(markerClass = [KtImplementationDetail::class])
interface KtUnionType : KtTypeElement
Represents an union type combining two types with {@code |}.
KtUserType¶
open class KtUserType : KtElementImplStub<KotlinUserTypeStub> , KtTypeElement, KtResolvable
Represents a simple type, optionally with type arguments.
KtValueArgument¶
open class KtValueArgument : KtElementImplStub<KotlinValueArgumentStub<out KtValueArgument>> , ValueArgument
Represents a value argument in a function call.
KtValueArgumentList¶
Represents a parenthesized list of value arguments in a call.
KtValueArgumentName¶
Represents the name part of a named argument.
KtValVarKeywordOwner¶
interface KtValVarKeywordOwner : PsiElement
Represents an element that may be introduced by a val or var keyword, such as a property, a destructuring entry, or a constructor value parameter.
KtVariableDeclaration¶
Represents a variable declaration introduced by val or var: a property, a local variable, or an entry of a destructuring declaration.
KtVisitor¶
The base visitor over the Kotlin PSI, implementing the visitor pattern for KtElements.
KtVisitorVoid¶
open class KtVisitorVoid : KtVisitor<Void, Void>
A convenience KtVisitor for the common case of a visitor that returns nothing and needs no extra data.
KtVisitorVoidWithParameter¶
open class KtVisitorVoidWithParameter<P> : KtVisitor<Void, P>
A convenience KtVisitor for visitors that return nothing but still thread a data parameter through the traversal.
KtWhenCondition¶
abstract class KtWhenCondition : KtElementImpl
Represents a single condition of a KtWhenEntry in a when expression.
KtWhenConditionInRange¶
open class KtWhenConditionInRange : KtWhenCondition, KtResolvableCall
Represents a when condition that checks membership using in or !in.
KtWhenConditionIsPattern¶
open class KtWhenConditionIsPattern : KtWhenCondition
Represents a when condition that performs a type check using is or !is.
KtWhenConditionWithExpression¶
open class KtWhenConditionWithExpression : KtWhenCondition
Represents a when condition that matches against an expression value.
KtWhenEntry¶
open class KtWhenEntry : KtElementImpl
Represents a single branch in a when expression.
KtWhenEntryGuard¶
class KtWhenEntryGuard : KtElementImpl
Represents a guard condition in a when entry using the if keyword.
KtWhenExpression¶
open class KtWhenExpression : KtExpressionImpl
Represents a when expression with an optional subject and multiple branches.
KtWhileExpression¶
open class KtWhileExpression : KtWhileExpressionBase
Represents a while loop that executes its body while the condition is true.
KtWhileExpressionBase¶
abstract class KtWhileExpressionBase : KtLoopExpression
Represents a condition-driven loop: a while or do-while loop.
LambdaArgument¶
interface LambdaArgument : ValueArgument
A ValueArgument that is a trailing lambda passed outside the call parentheses, as in list.forEach { ... }.
UserDataProperty¶
class UserDataProperty<in R : UserDataHolder, T : Any>(val key: Key<T>)
A property delegate that reads and writes a value stored in a UserDataHolder under the given key.
ValueArgument¶
interface ValueArgument
Represents a single argument passed in a call, such as foo(1, message = "hi", *array).
ValueArgumentName¶
interface ValueArgumentName
The name of a named ValueArgument (the name in name = value).
Properties¶
Functions¶
buildByPattern¶
fun <TElement> buildByPattern(factory: (String, Array<out Any>) -> TElement, build: BuilderByPattern<TElement>.() -> Unit): TElement
Creates a BuilderByPattern, runs build on it, and produces the element via factory. Backs the KtPsiFactory.build* entry points.