Interface FaultTransformationRule

Represents a rule that defines how to find and transform a specific part of the code to introduce a fault.

interface FaultTransformationRule {
    id: string;
    queryText: string;
    getFaultTransformation(match: QueryMatch, options?: FaultTransformationOptions): null | CodeTransformation;
    getTransformableNodes(match: QueryMatch): SyntaxNode[];
}

Properties

id: string

A unique identifier for this rule.

queryText: string

The query text, in tree-sitter query syntax, used to find the code snippet that can be transformed.

Methods

  • Get the nodes that can be transformed, based on the matches of the query.

    Not every query match will be transformable, since the query may be optimized for performance and return more nodes than necessary, or the transformation may not be applicable to all matches.

    Parameters

    • match: QueryMatch

    Returns SyntaxNode[]