Package-level declarations

Types

Link copied to clipboard
interface FileInfo

Information about a file to be transformed.

Link copied to clipboard

The main entry point for the ktcodeshift API.

Link copied to clipboard
data class NodeCollection<T : Node>(val nodePaths: List<NodePath<T>>, val rootNode: Node.KotlinFile)

A collection of nodes filtered under the root node.

Link copied to clipboard
class NodeContext(path: NodePath<*>)

Context for a node.

Link copied to clipboard

Properties

Link copied to clipboard
val Node.WithModifiers.annotations: List<Node.Modifier.AnnotationSet.Annotation>

Get list of annotations for this node.

Link copied to clipboard
val Node.Declaration.ClassDeclaration.isDataClass: Boolean

Returns true if this node is a data class.

Link copied to clipboard
val Node.WithModifiers.keywordModifiers: List<Node.Modifier.KeywordModifier>

Get list of keyword modifiers for this node.

Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T : Node> Node.KotlinFile.find(): NodeCollection<T>
fun <T : Node> Node.KotlinFile.find(javaClass: Class<T>): NodeCollection<T>
fun <T : Node> Node.KotlinFile.find(kClass: KClass<T>): NodeCollection<T>

Returns NodeCollection of all nodes of type T under this node.

Link copied to clipboard
fun Node.toSource(): String

Converts the given node to source code.

Link copied to clipboard

Defines the transform function. This function will be called for each target file.