Skip to main content

Inherits from

SymbolGroup, Editable

Attributes

extended

extended_source

file

filepath

function_calls

next_named_sibling

next_sibling

parent

parent_class

parent_function

parent_statement

source

symbols

variable_usages

Methods

ancestors

Find all ancestors of the node of the given type. Does not return itself

edit

Edit the source for this Collection instance.

find

Search for substrings in the given symbols that match strings_to_match.

find_string_literals

Search for string literals matching given strings in the SymbolGroup.

flag

Adds a visual flag comment to the end of this Editable’s source text.

get_variable_usages

Returns Editables for all TreeSitter nodes corresponding to instances of variable usage

index

Return the index of the first occurrence of value.

insert

Adds value to the container that this node represents

insert_after

Inserts source code after this node in the codebase.

insert_before

Inserts source code before this symbol group.

is_child_of

Checks if this node is a descendant of the given editable instance in the AST.

is_wrapped_in

Check if this node is contained another node of the given class

parent_of_type

Find the first ancestor of the node of the given type. Does not return itself

parent_of_types

Find the first ancestor of the node of the given type. Does not return itself

reduce_condition

Reduces an editable to the following condition

remove

Removes an element from a Collection.

replace

Replaces all instances of a string with a new string in all symbols within the group. Searches for regex matches in the codebase.