diff --git a/docs/api-reference/core/Argument.mdx b/docs/api-reference/core/Argument.mdx index cb44cc09c..8a293a313 100644 --- a/docs/api-reference/core/Argument.mdx +++ b/docs/api-reference/core/Argument.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_keyword Converts an unnamed argument to a named argument by adding a keyword. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Argument ] } description=""/> @@ -225,7 +225,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -233,7 +233,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -346,7 +346,7 @@ 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 - + Editable | None } description=""/> @@ -354,7 +354,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -362,7 +362,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Typeable](/api-reference/core/Typeable), [Symbol](/api-reference/core/Symbol), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -147,7 +147,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -172,7 +172,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Assignment ] } description=""/> @@ -261,7 +261,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -269,7 +269,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -388,7 +388,7 @@ Check if this node is contained another node of the given class ### local_usages Retrieves all usages of the assigned variable within its code block scope. - + list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> @@ -396,7 +396,7 @@ Retrieves all usages of the assigned variable within its code block scope. ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -433,7 +433,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an assignment expression by reducing it based on a boolean condition and updating all the usages. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_type_annotation Adds or updates a type annotation for the current assignment. - + set_value Sets the value of an assignment expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -128,7 +128,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ AssignmentStatement ] } description=""/> @@ -225,7 +225,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -338,7 +338,7 @@ 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 - + Editable | None } description=""/> @@ -346,7 +346,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -354,7 +354,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Usable](/api-reference/core/Usable), [AssignmentStatement](/api-reference/core/AssignmentStatement), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -148,7 +148,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Attribute ] } description=""/> @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -253,7 +253,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -366,7 +366,7 @@ 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 - + Editable | None } description=""/> @@ -374,7 +374,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -382,7 +382,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of a node's assignment. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ AwaitExpression ] } description=""/> @@ -188,7 +188,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ 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 - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -395,7 +395,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -105,7 +105,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -113,7 +113,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ BinaryExpression ] } description=""/> @@ -202,7 +202,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -315,7 +315,7 @@ 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 - + Editable | None } description=""/> @@ -323,7 +323,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a binary expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -121,7 +121,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -152,7 +152,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ BlockStatement ] } description=""/> @@ -241,7 +241,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -354,7 +354,7 @@ 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 - + Editable | None } description=""/> @@ -362,7 +362,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -370,7 +370,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -90,7 +90,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Boolean ] } description=""/> @@ -187,7 +187,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -300,7 +300,7 @@ 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 - + Editable | None } description=""/> @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -316,7 +316,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -115,7 +115,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -123,7 +123,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Callable ] } description=""/> @@ -212,7 +212,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -220,7 +220,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -384,7 +384,7 @@ 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 - + Editable | None } description=""/> @@ -392,7 +392,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -400,7 +400,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -161,7 +161,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ CatchStatement ] } description=""/> @@ -250,7 +250,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -363,7 +363,7 @@ 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 - + Editable | None } description=""/> @@ -371,7 +371,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -379,7 +379,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ChainedAttribute ] } description=""/> @@ -200,7 +200,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -313,7 +313,7 @@ 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 - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Symbol](/api-reference/core/Symbol), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -176,7 +176,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_attribute Adds an attribute to a class from another class. - + add_attribute_from_source Adds an attribute to a class from raw source code, placing it in a specific location - + add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_source Add a block of source code to the bottom of a class definition. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -281,7 +281,7 @@ Find all ancestors of the node of the given type. Does not return itself ### attributes Retrieves all attributes from this Class including those from its superclasses up to a - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Class ] } description=""/> @@ -393,7 +393,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns a specific attribute by name. - + get_method Returns a specific method by name from the class or any of its superclasses. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -435,7 +435,7 @@ Returns the name node of the object. ### get_nested_class Returns a nested class by name from the current class. - + get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_parent_class Returns the parent class node with the specified name. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_subclass_of Checks if the class inherits from a specified parent class. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -662,7 +662,7 @@ Check if this node is contained another node of the given class ### methods Retrieves all methods that exist on this Class, including methods from superclasses, with - + move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -728,7 +728,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -736,7 +736,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + subclasses Returns all classes which subclass this class. - + superclasses Returns a list of all classes that this class extends, up to max_depth. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -137,7 +137,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -145,7 +145,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ CodeBlock ] } description=""/> @@ -234,7 +234,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_assignments Returns a list of assignments with the specified variable name. - + get_attributes Returns attributes from the code block, with the option to include or exclude private - + get_comment Gets the first comment statement containing a specific text string. - + get_local_var_assignment Returns the first code statement that assigns a local variable with the specified name. - + get_local_var_assignments Returns all instances of local variable assignments that match the specified variable - + get_statements Returns all statements of a given type up to the specified block level. - + get_variable_usages Returns all instances of variable usages in a code block. - + indent Adjusts the indentation level of the entire code block. - + insert_before Inserts new source code at the top of the code block. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -413,7 +413,7 @@ 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 - + Editable | None } description=""/> @@ -421,7 +421,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -429,7 +429,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_variable_usages Renames all instances of variable usages in the code block. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + unwrap Extracts a code block from its parent wrapper container by removing the wrapping - + None } description=""/> @@ -565,7 +565,7 @@ Extracts a code block from its parent wrapper container by removing the wrapping ### wrap Wraps a code block with a statement and indents it. - + + ## Attributes @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ai Generates a response from the AI based on the provided prompt, target, and context. - + checkout Checks out a git branch or commit and syncs the codebase graph to the new state. - + commit Commits all staged changes to the codebase graph and synchronizes the graph with the filesystem if specified. - + create_directory Creates a directory at the specified path. - + create_file Creates a new file in the codebase with specified content. - + files A list property that returns all files in the codebase. - + list[ SourceFile ] | list[ File ] } description="A sorted list of source files in the codebase."/> @@ -244,7 +244,7 @@ A list property that returns all files in the codebase. ### find_by_span Finds editable objects that overlap with the given source code span. - + get_class Returns a class that matches the given name. - + get_directory Returns Directory by `dir_path`, or full path to the directory from codebase root. - + get_file Retrieves a file from the codebase by its filepath. - + get_function Retrieves a function from the codebase by its name. - + get_relative_path Calculates a relative path from one file to another, removing the extension from the target file. - + get_symbol Returns a Symbol by name from the codebase. - + get_symbols Retrieves all symbols in the codebase that match the given symbol name. - + git_commit Commits all staged changes to the codebase and git. - + has_directory Returns a boolean indicating if a directory exists in the codebase. - + has_file Determines if a file exists in the codebase. - + has_symbol Returns whether a symbol exists in the codebase. - + reset Resets the codebase by - + None } description=""/> @@ -510,7 +510,7 @@ Resets the codebase by ### set_ai_key Sets the OpenAI key for the current Codebase instance. - + None } description=""/> @@ -518,7 +518,7 @@ Sets the OpenAI key for the current Codebase instance. ### set_session_options Sets the Session options for the current codebase. - + None } description=""/> @@ -526,7 +526,7 @@ Sets the Session options for the current codebase. ### should_fix Returns True if the flag should be fixed based on the current mode and active group. - + visualize Visualizes a NetworkX graph or Plotly figure. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -108,7 +108,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + edit_text Replace the text of a comment with new text. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Comment ] } description=""/> @@ -222,7 +222,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -335,7 +335,7 @@ 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 - + Editable | None } description=""/> @@ -343,7 +343,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -351,7 +351,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + edit_text Replace the text content of a comment group with new text. - + 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. - + CodeFlag[ CommentGroup ] } description=""/> @@ -213,7 +213,7 @@ 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 - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -326,7 +326,7 @@ 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 - + Editable | None } description=""/> @@ -334,7 +334,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -342,7 +342,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [BinaryExpression](/api-reference/core/BinaryExpression), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -108,7 +108,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ComparisonExpression ] } description=""/> @@ -205,7 +205,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -318,7 +318,7 @@ 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 - + Editable | None } description=""/> @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a binary expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Decorator ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -204,7 +204,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ 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 - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Dict ] } description=""/> @@ -192,7 +192,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ 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 - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_file Add a file to the directory. - + None } description=""/> @@ -83,7 +83,7 @@ Add a file to the directory. ### add_subdirectory Add a subdirectory to the directory. - + None } description=""/> @@ -91,7 +91,7 @@ Add a subdirectory to the directory. ### get_class Get a class by name in the directory and its subdirectories. - + Class | None } description=""/> @@ -99,7 +99,7 @@ Get a class by name in the directory and its subdirectories. ### get_file Get a file by its name relative to the directory. - + File | None } description=""/> @@ -107,7 +107,7 @@ Get a file by its name relative to the directory. ### get_function Get a function by name in the directory and its subdirectories. - + Function | None } description=""/> @@ -115,7 +115,7 @@ Get a function by name in the directory and its subdirectories. ### get_global_var Get a global variable by name in the directory and its subdirectories. - + Assignment | None } description=""/> @@ -123,7 +123,7 @@ Get a global variable by name in the directory and its subdirectories. ### get_import_statement Get an import statement by name in the directory and its subdirectories. - + ImportStatement | None } description=""/> @@ -131,7 +131,7 @@ Get an import statement by name in the directory and its subdirectories. ### get_subdirectory Get a subdirectory by its path relative to the directory. - + Directory | None } description=""/> @@ -139,7 +139,7 @@ Get a subdirectory by its path relative to the directory. ### get_symbol Get a symbol by name in the directory and its subdirectories. - + Symbol | None } description=""/> @@ -147,7 +147,7 @@ Get a symbol by name in the directory and its subdirectories. ### remove_file Remove a file from the directory. - + None } description=""/> @@ -155,7 +155,7 @@ Remove a file from the directory. ### remove_file_by_path Remove a file from the directory by its path. - + None } description=""/> @@ -163,7 +163,7 @@ Remove a file from the directory by its path. ### remove_subdirectory Remove a subdirectory from the directory. - + None } description=""/> @@ -171,7 +171,7 @@ Remove a subdirectory from the directory. ### remove_subdirectory_by_path Remove a subdirectory from the directory by its path. - + None } description=""/> @@ -179,7 +179,7 @@ Remove a subdirectory from the directory by its path. ### rename Rename the directory. - + None } description=""/> @@ -187,7 +187,7 @@ Rename the directory. ### update_filepath Update the filepath of the directory. - + None } description=""/> diff --git a/docs/api-reference/core/Editable.mdx b/docs/api-reference/core/Editable.mdx index 6ac78ed8c..d66e52a02 100644 --- a/docs/api-reference/core/Editable.mdx +++ b/docs/api-reference/core/Editable.mdx @@ -15,7 +15,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes @@ -85,7 +85,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -93,7 +93,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Editable ] } description=""/> @@ -182,7 +182,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -295,7 +295,7 @@ 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 - + Editable | None } description=""/> @@ -303,7 +303,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -311,7 +311,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -128,7 +128,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Export ] } description=""/> @@ -225,7 +225,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Returns the import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -268,7 +268,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased Determines if the Export object is aliased. - + bool } description="True if the exported symbol has a different name than the name it is exported as, False otherwise."/> @@ -381,7 +381,7 @@ Determines if the Export object is aliased. ### is_module_export Determines if the export is a module-level export. - + bool } description="True if the export is a module-level export, False otherwise."/> @@ -389,7 +389,7 @@ Determines if the export is a module-level export. ### is_named_export Determines if the export is named or default. - + bool } description="True if the export is named, False if it is default."/> @@ -397,7 +397,7 @@ Determines if the export is named or default. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -405,7 +405,7 @@ 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 - + Editable | None } description=""/> @@ -413,7 +413,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -421,7 +421,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -117,7 +117,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -125,7 +125,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExportStatement ] } description=""/> @@ -214,7 +214,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -327,7 +327,7 @@ 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 - + Editable | None } description=""/> @@ -335,7 +335,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -343,7 +343,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -117,7 +117,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -125,7 +125,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Exportable ] } description=""/> @@ -214,7 +214,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Returns the import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -257,7 +257,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -370,7 +370,7 @@ 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 - + Editable | None } description=""/> @@ -378,7 +378,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -386,7 +386,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Expression ] } description=""/> @@ -184,7 +184,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ 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 - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + 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. - + CodeFlag[ ExpressionGroup ] } description=""/> @@ -196,7 +196,7 @@ 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 - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ 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 - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression) @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -131,7 +131,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExpressionStatement ] } description=""/> @@ -220,7 +220,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -333,7 +333,7 @@ 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 - + Editable | None } description=""/> @@ -341,7 +341,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -349,7 +349,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -427,7 +427,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Callable](/api-reference/core/Callable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -117,7 +117,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -125,7 +125,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExternalModule ] } description=""/> @@ -214,7 +214,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_import Creates an ExternalModule instance from an Import instance. - + get_import_string Returns the import string used to import this module. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -274,7 +274,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -438,7 +438,7 @@ 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 - + Editable | None } description=""/> @@ -446,7 +446,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -454,7 +454,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Editable](/api-reference/core/Editable) @@ -125,7 +125,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -133,7 +133,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ File ] } description=""/> @@ -222,7 +222,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -335,7 +335,7 @@ 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 - + Editable | None } description=""/> @@ -343,7 +343,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parse Parses the file representation into the graph. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -376,7 +376,7 @@ Removes the file from the file system and graph. ### rename Renames the file to the specified name, preserving the file extension. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + update_filepath Updates the file path and inbound imports of a file. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [BlockStatement](/api-reference/core/BlockStatement), [Expression](/api-reference/core/Expression), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable) @@ -134,7 +134,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -165,7 +165,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ForLoopStatement ] } description=""/> @@ -254,7 +254,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -367,7 +367,7 @@ 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 - + Editable | None } description=""/> @@ -375,7 +375,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -383,7 +383,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Callable](/api-reference/core/Callable), [Symbol](/api-reference/core/Symbol), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -198,7 +198,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_statements Adds statements to the end of a function body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -263,7 +263,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Modifies the function to be asynchronous. - + None } description=""/> @@ -271,7 +271,7 @@ Modifies the function to be asynchronous. ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Function ] } description=""/> @@ -360,7 +360,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -368,7 +368,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -538,7 +538,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -575,7 +575,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### prepend_statements Prepends the provided code to the beginning of the function body. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -600,7 +600,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_local_variable Renames a local variable and all its usages within a function body. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_return_type Sets the return type annotation for the function. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -128,7 +128,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Converts the function call to an async function call by wrapping it with 'await'. - + None } description=""/> @@ -144,7 +144,7 @@ Converts the function call to an async function call by wrapping it with 'await' ### convert_args_to_kwargs Converts positional arguments in a function call to keyword arguments. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ FunctionCall ] } description=""/> @@ -250,7 +250,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_usage Creates a FunctionCall object from an Editable instance that represents a function call. - + get_arg_by_index Returns the Argument with the given index from the function call's argument list. - + get_arg_by_parameter_name Returns an argument by its parameter name. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -315,7 +315,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -428,7 +428,7 @@ 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 - + Editable | None } description=""/> @@ -436,7 +436,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -444,7 +444,7 @@ Reduces an editable to the following condition ### remove Removes a node and optionally its related extended nodes. - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_kwarg Set a keyword argument in a function call. - + set_name Sets the name of a code element. - + + ### Inherits from [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ GenericType ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -204,7 +204,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ 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 - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ HasBlock ] } description=""/> @@ -223,7 +223,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -336,7 +336,7 @@ 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 - + Editable | None } description=""/> @@ -344,7 +344,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -352,7 +352,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ## Attributes @@ -29,7 +29,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -37,7 +37,7 @@ Returns the name node of the object. ### rename Sets the name of an object and updates all its usages. - + set_name Sets the name of a code element. - + + ## Attributes @@ -25,7 +25,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### set_value Sets the value of the node's value Expression. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -145,7 +145,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -153,7 +153,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + elif_statements Returns all elif blocks within the if block. - + list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> @@ -196,7 +196,7 @@ Returns all elif blocks within the if block. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ IfBlockStatement ] } description=""/> @@ -250,7 +250,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -363,7 +363,7 @@ 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 - + Editable | None } description=""/> @@ -371,7 +371,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a conditional block by reducing its condition to a boolean value. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -169,7 +169,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -177,7 +177,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Import ] } description=""/> @@ -266,7 +266,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -274,7 +274,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased_import Returns True if this import is aliased. - + bool } description="True if the import has an alias different from its original name, False otherwise."/> @@ -387,7 +387,7 @@ Returns True if this import is aliased. ### is_module_import Returns True if this import is importing an entire module/file. - + bool } description="True if this import represents a module/file import, False if it represents a symbol import."/> @@ -395,7 +395,7 @@ Returns True if this import is importing an entire module/file. ### is_reexport Returns true if the Import object is also an Export object. - + bool } description="True if the import is re-exported, False otherwise."/> @@ -403,7 +403,7 @@ Returns true if the Import object is also an Export object. ### is_symbol_import Returns True if this import is importing a symbol rather than a module. - + bool } description="True if this import is a symbol import, False if it is a module import."/> @@ -411,7 +411,7 @@ Returns True if this import is importing a symbol rather than a module. ### is_wildcard_import Returns True if the import symbol is a wildcard import. - + bool } description="True if this is a wildcard import, False otherwise."/> @@ -419,7 +419,7 @@ Returns True if the import symbol is a wildcard import. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -427,7 +427,7 @@ 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 - + Editable | None } description=""/> @@ -435,7 +435,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -443,7 +443,7 @@ Reduces an editable to the following condition ### remove Remove this import from the import statement. - + rename Renames the import symbol and updates all its usages throughout the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_import_module Sets the module of an import. - + set_import_symbol_alias Sets alias or name of an import at the declaration level. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -121,7 +121,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ImportStatement ] } description=""/> @@ -210,7 +210,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -323,7 +323,7 @@ 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 - + Editable | None } description=""/> @@ -331,7 +331,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -339,7 +339,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -102,7 +102,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -110,7 +110,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Importable ] } description=""/> @@ -199,7 +199,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -207,7 +207,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -320,7 +320,7 @@ 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 - + Editable | None } description=""/> @@ -328,7 +328,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -336,7 +336,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [SymbolGroup](/api-reference/core/SymbolGroup) @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -110,7 +110,7 @@ Edit the source for this Collection instance. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ List ] } description=""/> @@ -164,7 +164,7 @@ 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. - + int } description=""/> @@ -195,7 +195,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -203,7 +203,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ 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 - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -309,7 +309,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes diff --git a/docs/api-reference/core/MultiExpression.mdx b/docs/api-reference/core/MultiExpression.mdx index eda546db7..a1759a847 100644 --- a/docs/api-reference/core/MultiExpression.mdx +++ b/docs/api-reference/core/MultiExpression.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -100,7 +100,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ MultiExpression ] } description=""/> @@ -189,7 +189,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -302,7 +302,7 @@ 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 - + Editable | None } description=""/> @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -318,7 +318,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -115,7 +115,7 @@ 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. - + CodeFlag[ MultiLineCollection ] } description=""/> @@ -169,7 +169,7 @@ 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. - + int } description=""/> @@ -200,7 +200,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -208,7 +208,7 @@ 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_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -298,7 +298,7 @@ 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 - + Editable | None } description=""/> @@ -306,7 +306,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -314,7 +314,7 @@ 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. - + search Searches for regex matches in the codebase. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Name ] } description=""/> @@ -188,7 +188,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ 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 - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ NamedType ] } description=""/> @@ -192,7 +192,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -200,7 +200,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -313,7 +313,7 @@ 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 - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ NoneType ] } description=""/> @@ -184,7 +184,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ 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 - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -90,7 +90,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Number ] } description=""/> @@ -187,7 +187,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -300,7 +300,7 @@ 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 - + Editable | None } description=""/> @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -316,7 +316,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Editable](/api-reference/core/Editable) @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -104,7 +104,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Pair ] } description=""/> @@ -193,7 +193,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -306,7 +306,7 @@ 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 - + Editable | None } description=""/> @@ -314,7 +314,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -322,7 +322,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Typeable](/api-reference/core/Typeable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -127,7 +127,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -135,7 +135,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Parameter ] } description=""/> @@ -224,7 +224,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -232,7 +232,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -345,7 +345,7 @@ 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 - + Editable | None } description=""/> @@ -353,7 +353,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -361,7 +361,7 @@ Reduces an editable to the following condition ### remove Removes the parameter from the function definition and all its call sites. - + rename Renames a parameter in a function definition and updates all related references. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_type_annotation Sets the type annotation for this parameter. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Unwrappable](/api-reference/core/Unwrappable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ParenthesizedExpression ] } description=""/> @@ -194,7 +194,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -307,7 +307,7 @@ 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 - + Editable | None } description=""/> @@ -315,7 +315,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -416,7 +416,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Replaces the content of a placeholder node with new source code. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/core/PlaceholderType.mdx b/docs/api-reference/core/PlaceholderType.mdx index 6fa488a91..5d9a5bcf5 100644 --- a/docs/api-reference/core/PlaceholderType.mdx +++ b/docs/api-reference/core/PlaceholderType.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PlaceholderType ] } description=""/> @@ -184,7 +184,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ 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 - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -114,7 +114,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -122,7 +122,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ RaiseStatement ] } description=""/> @@ -211,7 +211,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -324,7 +324,7 @@ 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 - + Editable | None } description=""/> @@ -332,7 +332,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -340,7 +340,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -117,7 +117,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -125,7 +125,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ReturnStatement ] } description=""/> @@ -214,7 +214,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -327,7 +327,7 @@ 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 - + Editable | None } description=""/> @@ -335,7 +335,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -343,7 +343,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Usable](/api-reference/core/Usable), [HasBlock](/api-reference/core/HasBlock), [File](/api-reference/core/File), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [HasName](/api-reference/core/HasName) @@ -190,7 +190,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + add_import_from_import_string Adds import to the file from a string representation of an import statement. - + add_symbol_from_source Adds a symbol to a file from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -255,7 +255,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_by_byte_range Finds all editable objects that overlap with the given byte range in the file. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SourceFile ] } description=""/> @@ -361,7 +361,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Returns a specific Class by full name. Returns None if not found. - + get_function Returns a specific Function by name. - + get_global_var Returns a specific global var by name. Returns None if not found. - + get_import Returns the import with matching alias. Returns None if not found. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -437,7 +437,7 @@ Returns the name node of the object. ### get_symbol Gets a symbol by its name from the file. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + has_import Returns True if the file has an import with the given alias. - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -584,7 +584,7 @@ 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 - + Editable | None } description=""/> @@ -592,7 +592,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -600,7 +600,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -608,7 +608,7 @@ Removes the file from the file system and graph. ### replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + set_name Sets the name of a code element. - + symbol_can_be_added Checks if the file type supports adding the given symbol. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + symbols Returns all Symbols in the file, sorted by position in the file. - + list[ Symbol | Class | Function | Assignment | TInterface] } description="A list of all top-level symbols in the file, sorted by their position in the file. Symbols can be one of the following types: - Symbol: Base symbol class - TClass: Class definition - TFunction: Function definition - TGlobalVar: Global variable assignment - TInterface: Interface definition"/> @@ -754,7 +754,7 @@ Returns all Symbols in the file, sorted by position in the file. ### update_filepath Renames the file and updates all imports to point to the new location. - + usages Returns a list of usages of the exportable object. - + + ## Attributes diff --git a/docs/api-reference/core/Statement.mdx b/docs/api-reference/core/Statement.mdx index 3d97f11c4..92c6de578 100644 --- a/docs/api-reference/core/Statement.mdx +++ b/docs/api-reference/core/Statement.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Statement ] } description=""/> @@ -201,7 +201,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -314,7 +314,7 @@ 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 - + Editable | None } description=""/> @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -330,7 +330,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes diff --git a/docs/api-reference/core/String.mdx b/docs/api-reference/core/String.mdx index 75650387e..80c552eca 100644 --- a/docs/api-reference/core/String.mdx +++ b/docs/api-reference/core/String.mdx @@ -16,7 +16,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -109,7 +109,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -117,7 +117,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ String ] } description=""/> @@ -206,7 +206,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -319,7 +319,7 @@ 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 - + Editable | None } description=""/> @@ -327,7 +327,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -335,7 +335,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Edits the source code of this placeholder node. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/core/SubscriptExpression.mdx b/docs/api-reference/core/SubscriptExpression.mdx index bb7ec93f2..da2c6bb46 100644 --- a/docs/api-reference/core/SubscriptExpression.mdx +++ b/docs/api-reference/core/SubscriptExpression.mdx @@ -15,7 +15,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -109,7 +109,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SubscriptExpression ] } description=""/> @@ -198,7 +198,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -311,7 +311,7 @@ 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 - + Editable | None } description=""/> @@ -319,7 +319,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -327,7 +327,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -161,7 +161,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SwitchCase ] } description=""/> @@ -250,7 +250,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -363,7 +363,7 @@ 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 - + Editable | None } description=""/> @@ -371,7 +371,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -379,7 +379,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -117,7 +117,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -125,7 +125,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SwitchStatement ] } description=""/> @@ -214,7 +214,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -327,7 +327,7 @@ 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 - + Editable | None } description=""/> @@ -335,7 +335,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -343,7 +343,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -144,7 +144,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Symbol ] } description=""/> @@ -233,7 +233,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -241,7 +241,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -360,7 +360,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -397,7 +397,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -405,7 +405,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Editable](/api-reference/core/Editable) @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + 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. - + CodeFlag[ SymbolGroup ] } description=""/> @@ -194,7 +194,7 @@ 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 - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -307,7 +307,7 @@ 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 - + Editable | None } description=""/> @@ -315,7 +315,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -323,7 +323,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -121,7 +121,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SymbolStatement ] } description=""/> @@ -210,7 +210,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -323,7 +323,7 @@ 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 - + Editable | None } description=""/> @@ -331,7 +331,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -339,7 +339,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -102,7 +102,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -110,7 +110,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TernaryExpression ] } description=""/> @@ -199,7 +199,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -312,7 +312,7 @@ 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 - + Editable | None } description=""/> @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a ternary expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [BlockStatement](/api-reference/core/BlockStatement), [Expression](/api-reference/core/Expression), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable) @@ -129,7 +129,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -160,7 +160,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TryCatchStatement ] } description=""/> @@ -249,7 +249,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -362,7 +362,7 @@ 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 - + Editable | None } description=""/> @@ -370,7 +370,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -378,7 +378,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [SymbolGroup](/api-reference/core/SymbolGroup) @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -110,7 +110,7 @@ Edit the source for this Collection instance. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Tuple ] } description=""/> @@ -164,7 +164,7 @@ 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. - + int } description=""/> @@ -195,7 +195,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -203,7 +203,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ 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 - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -309,7 +309,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -109,7 +109,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -117,7 +117,7 @@ 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. - + CodeFlag[ TupleType ] } description=""/> @@ -171,7 +171,7 @@ 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. - + int } description=""/> @@ -202,7 +202,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -210,7 +210,7 @@ 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_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -300,7 +300,7 @@ 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 - + Editable | None } description=""/> @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -316,7 +316,7 @@ 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. - + search Searches for regex matches in the codebase. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -97,7 +97,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Type ] } description=""/> @@ -186,7 +186,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -299,7 +299,7 @@ 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 - + Editable | None } description=""/> @@ -307,7 +307,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -315,7 +315,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [HasBlock](/api-reference/core/HasBlock), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -149,7 +149,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -197,7 +197,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TypeAlias ] } description=""/> @@ -286,7 +286,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Get attribute by name. - + Attribute | None } description=""/> @@ -294,7 +294,7 @@ Get attribute by name. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -302,7 +302,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -421,7 +421,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -458,7 +458,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -466,7 +466,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Edits the type annotation of a placeholder node. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/core/Typeable.mdx b/docs/api-reference/core/Typeable.mdx index e4ac5a612..6a93fda67 100644 --- a/docs/api-reference/core/Typeable.mdx +++ b/docs/api-reference/core/Typeable.mdx @@ -15,7 +15,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Typeable ] } description=""/> @@ -192,7 +192,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ 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 - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ UnaryExpression ] } description=""/> @@ -192,7 +192,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ 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 - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a unary expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -109,7 +109,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -117,7 +117,7 @@ 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. - + CodeFlag[ UnionType ] } description=""/> @@ -171,7 +171,7 @@ 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. - + int } description=""/> @@ -202,7 +202,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -210,7 +210,7 @@ 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_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -300,7 +300,7 @@ 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 - + Editable | None } description=""/> @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -316,7 +316,7 @@ 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. - + search Searches for regex matches in the codebase. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Unwrappable](/api-reference/core/Unwrappable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Unpack ] } description=""/> @@ -194,7 +194,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -307,7 +307,7 @@ 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 - + Editable | None } description=""/> @@ -315,7 +315,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -323,7 +323,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -401,7 +401,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -97,7 +97,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Unwrappable ] } description=""/> @@ -186,7 +186,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -299,7 +299,7 @@ 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 - + Editable | None } description=""/> @@ -307,7 +307,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -315,7 +315,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Usable ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -204,7 +204,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ 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 - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ## Attributes diff --git a/docs/api-reference/core/UsageKind.mdx b/docs/api-reference/core/UsageKind.mdx index 9956bf4f8..3048ef120 100644 --- a/docs/api-reference/core/UsageKind.mdx +++ b/docs/api-reference/core/UsageKind.mdx @@ -25,7 +25,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes diff --git a/docs/api-reference/core/UsageType.mdx b/docs/api-reference/core/UsageType.mdx index fbef98871..3bc3444ed 100644 --- a/docs/api-reference/core/UsageType.mdx +++ b/docs/api-reference/core/UsageType.mdx @@ -18,7 +18,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes diff --git a/docs/api-reference/core/Value.mdx b/docs/api-reference/core/Value.mdx index cda9f591f..2794e37a1 100644 --- a/docs/api-reference/core/Value.mdx +++ b/docs/api-reference/core/Value.mdx @@ -16,7 +16,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -100,7 +100,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Value ] } description=""/> @@ -189,7 +189,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -302,7 +302,7 @@ 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 - + Editable | None } description=""/> @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -318,7 +318,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -125,7 +125,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ WhileStatement ] } description=""/> @@ -245,7 +245,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -358,7 +358,7 @@ 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 - + Editable | None } description=""/> @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -374,7 +374,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [Statement](/api-reference/core/Statement), [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -141,7 +141,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -172,7 +172,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ WithStatement ] } description=""/> @@ -261,7 +261,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -374,7 +374,7 @@ 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 - + Editable | None } description=""/> @@ -382,7 +382,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -390,7 +390,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [PySymbol](/api-reference/python/PySymbol), [Assignment](/api-reference/core/Assignment), [Symbol](/api-reference/core/Symbol), [HasValue](/api-reference/core/HasValue), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -143,7 +143,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -186,7 +186,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyAssignment ] } description=""/> @@ -275,7 +275,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_named_expression Creates a MultiExpression from a Python named expression. - + get_import_string Generates an import string for a Python symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -353,7 +353,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -472,7 +472,7 @@ Check if this node is contained another node of the given class ### local_usages Retrieves all usages of the assigned variable within its code block scope. - + list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> @@ -480,7 +480,7 @@ Retrieves all usages of the assigned variable within its code block scope. ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -517,7 +517,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an assignment expression by reducing it based on a boolean condition and updating all the usages. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_type_annotation Adds or updates a type annotation for the current assignment. - + set_value Sets the value of an assignment expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [AssignmentStatement](/api-reference/core/AssignmentStatement), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -133,7 +133,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -141,7 +141,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyAssignmentStatement ] } description=""/> @@ -230,7 +230,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_assignment Creates a PyAssignmentStatement instance from a TreeSitter assignment node. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -396,7 +396,7 @@ 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 - + Editable | None } description=""/> @@ -404,7 +404,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -412,7 +412,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [PyAssignmentStatement](/api-reference/python/PyAssignmentStatement), [Attribute](/api-reference/core/Attribute), [AssignmentStatement](/api-reference/core/AssignmentStatement), [Usable](/api-reference/core/Usable), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -153,7 +153,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -161,7 +161,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyAttribute ] } description=""/> @@ -250,7 +250,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_assignment Creates a PyAssignmentStatement instance from a TreeSitter assignment node. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -311,7 +311,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -424,7 +424,7 @@ Check if this node is contained another node of the given class ### local_usages Returns all instances where this attribute is used within its parent code block. - + list[ Editable [ PyAttribute ]] } description="A sorted list of unique attribute references. Each reference is an Editable object representing a usage of this attribute."/> @@ -432,7 +432,7 @@ Returns all instances where this attribute is used within its parent code block. ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -440,7 +440,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -448,7 +448,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of a node's assignment. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -121,7 +121,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -152,7 +152,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyBlockStatement ] } description=""/> @@ -241,7 +241,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -354,7 +354,7 @@ 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 - + Editable | None } description=""/> @@ -362,7 +362,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -370,7 +370,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyBreakStatement ] } description=""/> @@ -201,7 +201,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -314,7 +314,7 @@ 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 - + Editable | None } description=""/> @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -330,7 +330,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [CatchStatement](/api-reference/core/CatchStatement), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -161,7 +161,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyCatchStatement ] } description=""/> @@ -250,7 +250,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -363,7 +363,7 @@ 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 - + Editable | None } description=""/> @@ -371,7 +371,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -379,7 +379,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [ChainedAttribute](/api-reference/core/ChainedAttribute), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -109,7 +109,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyChainedAttribute ] } description=""/> @@ -198,7 +198,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -311,7 +311,7 @@ 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 - + Editable | None } description=""/> @@ -319,7 +319,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -327,7 +327,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [PySymbol](/api-reference/python/PySymbol), [Class](/api-reference/core/Class), [HasBlock](/api-reference/core/HasBlock), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -180,7 +180,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_attribute Adds an attribute to a class from another class. - + add_attribute_from_source Adds an attribute to a class from raw source code, placing it in a specific location - + add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_source Adds source code to the class definition. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -303,7 +303,7 @@ Find all ancestors of the node of the given type. Does not return itself ### attributes Retrieves all attributes from this Class including those from its superclasses up to a - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyClass ] } description=""/> @@ -415,7 +415,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns a specific attribute by name. - + get_import_string Generates an import string for a Python symbol. - + get_method Returns a specific method by name from the class or any of its superclasses. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -492,7 +492,7 @@ Returns the name node of the object. ### get_nested_class Returns a nested class by name from the current class. - + get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_parent_class Returns the parent class node with the specified name. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_subclass_of Checks if the class inherits from a specified parent class. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -719,7 +719,7 @@ Check if this node is contained another node of the given class ### methods Retrieves all methods that exist on this Class, including methods from superclasses, with - + move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -785,7 +785,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -793,7 +793,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_docstring Sets or updates a docstring for a Python function or class. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + subclasses Returns all classes which subclass this class. - + superclasses Returns a list of all classes that this class extends, up to max_depth. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [CodeBlock](/api-reference/core/CodeBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -137,7 +137,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -145,7 +145,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyCodeBlock ] } description=""/> @@ -234,7 +234,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_assignments Returns a list of assignments with the specified variable name. - + get_attributes Returns attributes from the code block, with the option to include or exclude private - + get_comment Gets the first comment statement containing a specific text string. - + get_local_var_assignment Returns the first code statement that assigns a local variable with the specified name. - + get_local_var_assignments Returns all instances of local variable assignments that match the specified variable - + get_statements Returns all statements of a given type up to the specified block level. - + get_variable_usages Returns all instances of variable usages in a code block. - + get_with_statements Gets with statements at a specific block level. - + indent Adjusts the indentation level of the entire code block. - + insert_before Inserts new source code at the top of the code block. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -430,7 +430,7 @@ 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 - + Editable | None } description=""/> @@ -438,7 +438,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -446,7 +446,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_variable_usages Renames all instances of variable usages in the code block. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + unwrap Extracts a code block from its parent wrapper container by removing the wrapping - + None } description=""/> @@ -582,7 +582,7 @@ Extracts a code block from its parent wrapper container by removing the wrapping ### wrap Wraps a code block with a statement and indents it. - + + ### Inherits from [Comment](/api-reference/core/Comment), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -116,7 +116,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -124,7 +124,7 @@ Find all ancestors of the node of the given type. Does not return itself ### clean_comment Cleans a comment block by removing comment symbols, leading/trailing whitespace, and standardizing indentation. - + edit Replace the source of this `Editable` with `new_src`. - + edit_text Replace the text of a comment with new text. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyComment ] } description=""/> @@ -247,7 +247,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### generate_comment Converts text content into a Python comment block. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -395,7 +395,7 @@ 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 - + Editable | None } description=""/> @@ -403,7 +403,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -411,7 +411,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [CommentGroup](/api-reference/core/CommentGroup), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -108,7 +108,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + edit_text Replace the text content of a comment group with new text. - + 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. - + CodeFlag[ PyCommentGroup ] } description=""/> @@ -222,7 +222,7 @@ 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 - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -335,7 +335,7 @@ 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 - + Editable | None } description=""/> @@ -343,7 +343,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -351,7 +351,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + to_google_docstring Convert a comment group into a Google-style docstring. - + + ## Attributes diff --git a/docs/api-reference/python/PyConditionalExpression.mdx b/docs/api-reference/python/PyConditionalExpression.mdx index 7973a211a..18f394eaf 100644 --- a/docs/api-reference/python/PyConditionalExpression.mdx +++ b/docs/api-reference/python/PyConditionalExpression.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [TernaryExpression](/api-reference/core/TernaryExpression), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -102,7 +102,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -110,7 +110,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyConditionalExpression ] } description=""/> @@ -199,7 +199,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -312,7 +312,7 @@ 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 - + Editable | None } description=""/> @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a ternary expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Decorator](/api-reference/core/Decorator), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyDecorator ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -204,7 +204,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ 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 - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [SourceFile](/api-reference/core/SourceFile), [HasBlock](/api-reference/core/HasBlock), [Usable](/api-reference/core/Usable), [File](/api-reference/core/File), [Expression](/api-reference/core/Expression), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [HasName](/api-reference/core/HasName) @@ -191,7 +191,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + add_import_from_import_string Adds an import statement to the file from a string representation. - + add_symbol_from_source Adds a symbol to a file from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -256,7 +256,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_by_byte_range Finds all editable objects that overlap with the given byte range in the file. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyFile ] } description=""/> @@ -362,7 +362,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Returns a specific Class by full name. Returns None if not found. - + get_extensions Returns the file extensions associated with Python files. - + list[str] } description="A list containing '.py' as the only Python file extension."/> @@ -387,7 +387,7 @@ Returns the file extensions associated with Python files. ### get_function Returns a specific Function by name. - + get_global_var Returns a specific global var by name. Returns None if not found. - + get_import Returns the import with matching alias. Returns None if not found. - + get_import_string Generates an import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -481,7 +481,7 @@ Returns the name node of the object. ### get_symbol Gets a symbol by its name from the file. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + has_import Returns True if the file has an import with the given alias. - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -628,7 +628,7 @@ 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 - + Editable | None } description=""/> @@ -636,7 +636,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -644,7 +644,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -652,7 +652,7 @@ Removes the file from the file system and graph. ### replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + set_name Sets the name of a code element. - + symbol_can_be_added Checks if a Python symbol can be added to this Python source file. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + symbols Returns all Symbols in the file, sorted by position in the file. - + list[ Symbol | Class | Function | Assignment | TInterface] } description="A list of all top-level symbols in the file, sorted by their position in the file. Symbols can be one of the following types: - Symbol: Base symbol class - TClass: Class definition - TFunction: Function definition - TGlobalVar: Global variable assignment - TInterface: Interface definition"/> @@ -816,7 +816,7 @@ Returns all Symbols in the file, sorted by position in the file. ### update_filepath Renames the file and updates all imports to point to the new location. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [ForLoopStatement](/api-reference/core/ForLoopStatement), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -134,7 +134,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -165,7 +165,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyForLoopStatement ] } description=""/> @@ -254,7 +254,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -367,7 +367,7 @@ 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 - + Editable | None } description=""/> @@ -375,7 +375,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -383,7 +383,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [PySymbol](/api-reference/python/PySymbol), [Function](/api-reference/core/Function), [HasBlock](/api-reference/core/HasBlock), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -210,7 +210,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_statements Adds statements to the end of a function body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -293,7 +293,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Modifies the function to be asynchronous. - + None } description=""/> @@ -301,7 +301,7 @@ Modifies the function to be asynchronous. ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyFunction ] } description=""/> @@ -390,7 +390,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates an import string for a Python symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -433,7 +433,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -603,7 +603,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -640,7 +640,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### prepend_statements Prepends statements to the start of the function body. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -665,7 +665,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_local_variable Renames a local variable and all its usages within a function body. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_docstring Sets or updates a docstring for a Python function or class. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_return_type Sets or modifies the return type annotation of a function. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyNamedType](/api-reference/python/PyNamedType), [GenericType](/api-reference/core/GenericType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyGenericType ] } description=""/> @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -208,7 +208,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -321,7 +321,7 @@ 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 - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -337,7 +337,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyHasBlock ] } description=""/> @@ -223,7 +223,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -336,7 +336,7 @@ 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 - + Editable | None } description=""/> @@ -344,7 +344,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -352,7 +352,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [IfBlockStatement](/api-reference/core/IfBlockStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -141,7 +141,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -149,7 +149,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + elif_statements Returns all elif blocks within the if block. - + list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> @@ -192,7 +192,7 @@ Returns all elif blocks within the if block. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyIfBlockStatement ] } description=""/> @@ -246,7 +246,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -359,7 +359,7 @@ 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 - + Editable | None } description=""/> @@ -367,7 +367,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a conditional block by reducing its condition to a boolean value. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Import](/api-reference/core/Import), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -155,7 +155,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -163,7 +163,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyImport ] } description=""/> @@ -252,7 +252,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates an import string for a Python import statement. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -295,7 +295,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased_import Returns True if this import is aliased. - + bool } description="True if the import has an alias different from its original name, False otherwise."/> @@ -408,7 +408,7 @@ Returns True if this import is aliased. ### is_module_import Determines if the import is a module-level or wildcard import. - + bool } description="True if the import is a module-level or wildcard import, False otherwise."/> @@ -416,7 +416,7 @@ Determines if the import is a module-level or wildcard import. ### is_reexport Returns true if the Import object is also an Export object. - + bool } description="True if the import is re-exported, False otherwise."/> @@ -424,7 +424,7 @@ Returns true if the Import object is also an Export object. ### is_symbol_import Returns True if this import is importing a symbol rather than a module. - + bool } description="True if this import is a symbol import, False if it is a module import."/> @@ -432,7 +432,7 @@ Returns True if this import is importing a symbol rather than a module. ### is_wildcard_import Returns True if the import symbol is a wildcard import. - + bool } description="True if this is a wildcard import, False otherwise."/> @@ -440,7 +440,7 @@ Returns True if the import symbol is a wildcard import. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -448,7 +448,7 @@ 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 - + Editable | None } description=""/> @@ -456,7 +456,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -464,7 +464,7 @@ Reduces an editable to the following condition ### remove Remove this import from the import statement. - + rename Renames the import symbol and updates all its usages throughout the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_import_module Sets the module of an import. - + set_import_symbol_alias Sets alias or name of an import at the declaration level. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [ImportStatement](/api-reference/core/ImportStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -108,7 +108,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyImportStatement ] } description=""/> @@ -205,7 +205,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -318,7 +318,7 @@ 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 - + Editable | None } description=""/> @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -334,7 +334,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [SwitchCase](/api-reference/core/SwitchCase), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -125,7 +125,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyMatchCase ] } description=""/> @@ -245,7 +245,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -358,7 +358,7 @@ 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 - + Editable | None } description=""/> @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -374,7 +374,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [SwitchStatement](/api-reference/core/SwitchStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -121,7 +121,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyMatchStatement ] } description=""/> @@ -210,7 +210,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -323,7 +323,7 @@ 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 - + Editable | None } description=""/> @@ -331,7 +331,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -339,7 +339,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -100,7 +100,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -108,7 +108,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyNamedType ] } description=""/> @@ -197,7 +197,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -205,7 +205,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -318,7 +318,7 @@ 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 - + Editable | None } description=""/> @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -334,7 +334,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Parameter](/api-reference/core/Parameter), [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Typeable](/api-reference/core/Typeable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -127,7 +127,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_trailing_comment Add a trailing comment to a parameter in a function signature. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -152,7 +152,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyParameter ] } description=""/> @@ -241,7 +241,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -249,7 +249,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -362,7 +362,7 @@ 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 - + Editable | None } description=""/> @@ -370,7 +370,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -378,7 +378,7 @@ Reduces an editable to the following condition ### remove Removes the parameter from the function definition and all its call sites. - + rename Renames a parameter in a function definition and updates all related references. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_type_annotation Sets the type annotation of a parameter. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyPassStatement ] } description=""/> @@ -201,7 +201,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -314,7 +314,7 @@ 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 - + Editable | None } description=""/> @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -330,7 +330,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Edits or creates a return type annotation for a method or function. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/python/PyString.mdx b/docs/api-reference/python/PyString.mdx index 74344fde2..80a1e072b 100644 --- a/docs/api-reference/python/PyString.mdx +++ b/docs/api-reference/python/PyString.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [String](/api-reference/core/String), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyString ] } description=""/> @@ -201,7 +201,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -314,7 +314,7 @@ 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 - + Editable | None } description=""/> @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -330,7 +330,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Symbol](/api-reference/core/Symbol), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -120,7 +120,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -163,7 +163,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PySymbol ] } description=""/> @@ -252,7 +252,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates an import string for a Python symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -295,7 +295,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -414,7 +414,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -451,7 +451,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -459,7 +459,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [TryCatchStatement](/api-reference/core/TryCatchStatement), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -133,7 +133,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -164,7 +164,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyTryCatchStatement ] } description=""/> @@ -253,7 +253,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -366,7 +366,7 @@ 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 - + Editable | None } description=""/> @@ -374,7 +374,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -382,7 +382,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [UnionType](/api-reference/core/UnionType), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -119,7 +119,7 @@ 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. - + CodeFlag[ PyUnionType ] } description=""/> @@ -173,7 +173,7 @@ 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. - + int } description=""/> @@ -204,7 +204,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -212,7 +212,7 @@ 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_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -302,7 +302,7 @@ 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 - + Editable | None } description=""/> @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -318,7 +318,7 @@ 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. - + search Searches for regex matches in the codebase. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [WhileStatement](/api-reference/core/WhileStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -133,7 +133,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -164,7 +164,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyWhileStatement ] } description=""/> @@ -253,7 +253,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -366,7 +366,7 @@ 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 - + Editable | None } description=""/> @@ -374,7 +374,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -382,7 +382,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_prop Adds a new prop to a JSXElement. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -142,7 +142,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ JSXElement ] } description=""/> @@ -231,7 +231,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -239,7 +239,7 @@ Returns the name node of the object. ### get_prop Returns the JSXProp with the given name from the JSXElement. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -369,7 +369,7 @@ 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 - + Editable | None } description=""/> @@ -377,7 +377,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -385,7 +385,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a JSXElement by modifying both opening and closing tags. - + wrap Wraps the current JSXElement with the provided opening and closing tags, properly handling indentation. - + + ### Inherits from [Unwrappable](/api-reference/core/Unwrappable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ JSXExpression ] } description=""/> @@ -188,7 +188,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ 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 - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a JSX expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ JSXProp ] } description=""/> @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -208,7 +208,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after a JSX prop in a TypeScript/JSX file. - + insert_before Insert a new source code string before a JSX prop in a React component. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -321,7 +321,7 @@ 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 - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -337,7 +337,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [TSNamedType](/api-reference/typescript/TSNamedType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -98,7 +98,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSArrayType ] } description=""/> @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -203,7 +203,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -316,7 +316,7 @@ 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 - + Editable | None } description=""/> @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -332,7 +332,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [TSSymbol](/api-reference/typescript/TSSymbol), [Assignment](/api-reference/core/Assignment), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [HasValue](/api-reference/core/HasValue), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -172,7 +172,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -215,7 +215,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSAssignment ] } description=""/> @@ -304,7 +304,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_named_expression Creates a MultiExpression object from a TypeScript named expression node. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -382,7 +382,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -501,7 +501,7 @@ Check if this node is contained another node of the given class ### local_usages Retrieves all usages of the assigned variable within its code block scope. - + list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> @@ -509,7 +509,7 @@ Retrieves all usages of the assigned variable within its code block scope. ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -546,7 +546,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an assignment expression by reducing it based on a boolean condition and updating all the usages. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment for an assignment node. - + set_name Sets the name of a code element. - + set_type_annotation Adds or updates a type annotation for the current assignment. - + set_value Sets the value of an assignment expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [AssignmentStatement](/api-reference/core/AssignmentStatement), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -133,7 +133,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -141,7 +141,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSAssignmentStatement ] } description=""/> @@ -230,7 +230,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -343,7 +343,7 @@ 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 - + Editable | None } description=""/> @@ -351,7 +351,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -359,7 +359,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [TSAssignmentStatement](/api-reference/typescript/TSAssignmentStatement), [Attribute](/api-reference/core/Attribute), [AssignmentStatement](/api-reference/core/AssignmentStatement), [Usable](/api-reference/core/Usable), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -153,7 +153,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -161,7 +161,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSAttribute ] } description=""/> @@ -250,7 +250,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -258,7 +258,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -371,7 +371,7 @@ Check if this node is contained another node of the given class ### local_usages Returns local usages of a TypeScript attribute within its code block. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -396,7 +396,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -404,7 +404,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of a node's assignment. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -125,7 +125,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSBlockStatement ] } description=""/> @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -375,7 +375,7 @@ 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 - + Editable | None } description=""/> @@ -383,7 +383,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -391,7 +391,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [CatchStatement](/api-reference/core/CatchStatement), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -134,7 +134,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -165,7 +165,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSCatchStatement ] } description=""/> @@ -254,7 +254,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -384,7 +384,7 @@ 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 - + Editable | None } description=""/> @@ -392,7 +392,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -400,7 +400,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [ChainedAttribute](/api-reference/core/ChainedAttribute), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSChainedAttribute ] } description=""/> @@ -201,7 +201,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -314,7 +314,7 @@ 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 - + Editable | None } description=""/> @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -330,7 +330,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [Class](/api-reference/core/Class), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -217,7 +217,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_attribute Adds an attribute to a class from another class. - + add_attribute_from_source Adds a class attribute from source code to a TypeScript/JavaScript class. - + add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_source Adds source code to a class body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -340,7 +340,7 @@ Find all ancestors of the node of the given type. Does not return itself ### attributes Retrieves all attributes from this Class including those from its superclasses up to a - + class_component_to_function_component Converts a class component to a function component. - + None } description=""/> @@ -371,7 +371,7 @@ Converts a class component to a function component. ### convert_props_to_interface Converts React component props to TypeScript interfaces. - + None } description=""/> @@ -379,7 +379,7 @@ Converts React component props to TypeScript interfaces. ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSClass ] } description=""/> @@ -468,7 +468,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns a specific attribute by name. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_method Returns a specific method by name from the class or any of its superclasses. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -562,7 +562,7 @@ Returns the name node of the object. ### get_nested_class Returns a nested class by name from the current class. - + get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_parent_class Returns the parent class node with the specified name. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_subclass_of Checks if the class inherits from a specified parent class. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -789,7 +789,7 @@ Check if this node is contained another node of the given class ### methods Retrieves all methods that exist on this Class, including methods from superclasses, with - + move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -855,7 +855,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -863,7 +863,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + subclasses Returns all classes which subclass this class. - + superclasses Returns a list of all classes that this class extends, up to max_depth. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [CodeBlock](/api-reference/core/CodeBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -133,7 +133,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -141,7 +141,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSCodeBlock ] } description=""/> @@ -230,7 +230,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_assignments Returns a list of assignments with the specified variable name. - + get_attributes Returns attributes from the code block, with the option to include or exclude private - + get_comment Gets the first comment statement containing a specific text string. - + get_local_var_assignment Returns the first code statement that assigns a local variable with the specified name. - + get_local_var_assignments Returns all instances of local variable assignments that match the specified variable - + get_statements Returns all statements of a given type up to the specified block level. - + get_variable_usages Returns all instances of variable usages in a code block. - + indent Adjusts the indentation level of the entire code block. - + insert_before Inserts new source code at the top of the code block. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -409,7 +409,7 @@ 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 - + Editable | None } description=""/> @@ -417,7 +417,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -425,7 +425,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_variable_usages Renames all instances of variable usages in the code block. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + unwrap Unwraps a code block by removing its opening and closing braces. - + None } description=""/> @@ -561,7 +561,7 @@ Unwraps a code block by removing its opening and closing braces. ### wrap Wraps a code block with a statement and indents it. - + + ### Inherits from [Comment](/api-reference/core/Comment), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -112,7 +112,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself ### clean_comment Cleans comment markers and whitespace from a comment string. - + edit Replace the source of this `Editable` with `new_src`. - + edit_text Replace the text of a comment with new text. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSComment ] } description=""/> @@ -243,7 +243,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### generate_comment Generates a TypeScript comment block from the given text content. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -391,7 +391,7 @@ 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 - + Editable | None } description=""/> @@ -399,7 +399,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -407,7 +407,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [CommentGroup](/api-reference/core/CommentGroup), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -108,7 +108,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + edit_text Replace the text content of a comment group with new text. - + 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. - + CodeFlag[ TSCommentGroup ] } description=""/> @@ -222,7 +222,7 @@ 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 - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -335,7 +335,7 @@ 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 - + Editable | None } description=""/> @@ -343,7 +343,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -351,7 +351,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ## Attributes diff --git a/docs/api-reference/typescript/TSConditionalType.mdx b/docs/api-reference/typescript/TSConditionalType.mdx index 20cecea4d..54e84002d 100644 --- a/docs/api-reference/typescript/TSConditionalType.mdx +++ b/docs/api-reference/typescript/TSConditionalType.mdx @@ -15,7 +15,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -119,7 +119,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSConditionalType ] } description=""/> @@ -208,7 +208,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -321,7 +321,7 @@ 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 - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -337,7 +337,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes @@ -72,7 +72,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### resolve_base_url Resolves an import path with the base url. - + str } description=""/> @@ -80,7 +80,7 @@ Resolves an import path with the base url. ### translate_absolute_path Translates an absolute path to an import path using the tsconfig paths. - + translate_import_path Translates an import path to an absolute path using the tsconfig paths. - + + ### Inherits from [Decorator](/api-reference/core/Decorator), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSDecorator ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -204,7 +204,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ 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 - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Dict](/api-reference/core/Dict), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -100,7 +100,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSDict ] } description=""/> @@ -189,7 +189,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -302,7 +302,7 @@ 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 - + Editable | None } description=""/> @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -318,7 +318,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -170,7 +170,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -236,7 +236,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSEnum ] } description=""/> @@ -325,7 +325,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns an attribute from the TypeScript enum by its name. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -402,7 +402,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -521,7 +521,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -558,7 +558,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -566,7 +566,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Export](/api-reference/core/Export), [Editable](/api-reference/core/Editable), [Exportable](/api-reference/core/Exportable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -144,7 +144,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -152,7 +152,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSExport ] } description=""/> @@ -241,7 +241,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Returns the import string for this export. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -284,7 +284,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased Determines if the Export object is aliased. - + bool } description="True if the exported symbol has a different name than the name it is exported as, False otherwise."/> @@ -397,7 +397,7 @@ Determines if the Export object is aliased. ### is_default_export Determines if an export is the default export for a file. - + bool } description="True if this is a default export, False otherwise."/> @@ -405,7 +405,7 @@ Determines if an export is the default export for a file. ### is_default_symbol_export Returns True if this is exporting a default symbol, as opposed to a default object export. - + is_module_export Determines if the export is exporting a module rather than a symbol. - + bool } description="True if the export represents a module export, False otherwise."/> @@ -430,7 +430,7 @@ Determines if the export is exporting a module rather than a symbol. ### is_named_export Determines whether this export is a named export. - + bool } description="True if this is a named export, False if it is a default export."/> @@ -438,7 +438,7 @@ Determines whether this export is a named export. ### is_reexport Returns whether the export is re-exporting an import or export. - + is_type_export Determines if this export is exclusively exporting a type. - + bool } description="True if this is a type-only export, False otherwise."/> @@ -463,7 +463,7 @@ Determines if this export is exclusively exporting a type. ### is_wildcard_export Determines if the export is a wildcard export. - + bool } description="True if the export is a wildcard export (e.g. 'export * from "./module"'), False otherwise."/> @@ -471,7 +471,7 @@ Determines if the export is a wildcard export. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -479,7 +479,7 @@ Check if this node is contained another node of the given class ### make_non_default Converts the export to a named export. - + None } description=""/> @@ -487,7 +487,7 @@ Converts the export to a named export. ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -495,7 +495,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -503,7 +503,7 @@ Reduces an editable to the following condition ### reexport_symbol Returns the import object that is re-exporting this symbol. - + TSImport | None } description="The import object being re-exported, or None if this is not a re-export or no import was found."/> @@ -511,7 +511,7 @@ Returns the import object that is re-exporting this symbol. ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + to_import_string Converts this export into its equivalent import string representation. - + str } description="The import string representation of this export. Examples: - For `export { foo } from './bar'` -> `import { foo } from './bar'` - For `export * from './bar'` -> `import * as _namespace from './bar'` - For `export { default as foo } from './bar'` -> `import foo from './bar'`"/> @@ -669,7 +669,7 @@ Converts this export into its equivalent import string representation. ### usages Returns a list of usages of the exportable object. - + + ### Inherits from [TSNamedType](/api-reference/typescript/TSNamedType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSExpressionType ] } description=""/> @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -208,7 +208,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -321,7 +321,7 @@ 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 - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -337,7 +337,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [TSHasBlock](/api-reference/typescript/TSHasBlock), [SourceFile](/api-reference/core/SourceFile), [Usable](/api-reference/core/Usable), [HasBlock](/api-reference/core/HasBlock), [File](/api-reference/core/File), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [HasName](/api-reference/core/HasName) @@ -240,7 +240,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + add_export_to_symbol Adds an export keyword to a symbol in a TypeScript file. - + add_import_from_import_string Adds import to the file from a string representation of an import statement. - + add_symbol_from_source Adds a symbol to a file from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -322,7 +322,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_by_byte_range Finds all editable objects that overlap with the given byte range in the file. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSFile ] } description=""/> @@ -428,7 +428,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Returns a specific Class by full name. Returns None if not found. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_config Returns the nearest tsconfig.json applicable to this file. - + TSConfig | None } description="The TypeScript configuration object if found, None otherwise."/> @@ -470,7 +470,7 @@ Returns the nearest tsconfig.json applicable to this file. ### get_export Returns an export object with the specified name from the file. - + get_export_statement_for_path Gets the first export of specified type that contains the given path in single or double quotes. - + get_extensions Returns a list of file extensions that this class can parse. - + list[str] } description="A list of file extensions including '.tsx', '.ts', '.jsx', and '.js'."/> @@ -518,7 +518,7 @@ Returns a list of file extensions that this class can parse. ### get_function Returns a specific Function by name. - + get_global_var Returns a specific global var by name. Returns None if not found. - + get_import Returns the import with matching alias. Returns None if not found. - + get_import_string Generates and returns an import statement for the file. - + get_interface Retrieves a specific interface from the file by its name. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -629,7 +629,7 @@ Returns the name node of the object. ### get_namespace Returns a specific namespace by name from the file's namespaces. - + get_symbol Gets a symbol by its name from the file. - + get_type Returns a specific Type by name from the file's types. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + has_export_statement_for_path Checks if the file has exports of specified type that contains the given path in single or double quotes. - + has_import Returns True if the file has an import with the given alias. - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -833,7 +833,7 @@ 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 - + Editable | None } description=""/> @@ -841,7 +841,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -849,7 +849,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -857,7 +857,7 @@ Removes the file from the file system and graph. ### remove_unused_exports Removes unused exports from the file. - + None } description=""/> @@ -865,7 +865,7 @@ Removes unused exports from the file. ### replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + set_name Sets the name of a code element. - + symbol_can_be_added Determines if a TypeScript symbol can be added to this file based on its type and JSX compatibility. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + symbols Returns all Symbols in the file, sorted by position in the file. - + list[ Symbol | Class | Function | Assignment | TInterface] } description="A list of all top-level symbols in the file, sorted by their position in the file. Symbols can be one of the following types: - Symbol: Base symbol class - TClass: Class definition - TFunction: Function definition - TGlobalVar: Global variable assignment - TInterface: Interface definition"/> @@ -1035,7 +1035,7 @@ Returns all Symbols in the file, sorted by position in the file. ### usages Returns a list of usages of the exportable object. - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [ForLoopStatement](/api-reference/core/ForLoopStatement), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -158,7 +158,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -189,7 +189,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSForLoopStatement ] } description=""/> @@ -278,7 +278,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -408,7 +408,7 @@ 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 - + Editable | None } description=""/> @@ -416,7 +416,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -424,7 +424,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [Function](/api-reference/core/Function), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -238,7 +238,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_statements Adds statements to the end of a function body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -321,7 +321,7 @@ Find all ancestors of the node of the given type. Does not return itself ### arrow_to_named Converts an arrow function to a named function in TypeScript/JavaScript. - + asyncify Modifies the function to be asynchronous, if it is not already. - + None } description=""/> @@ -346,7 +346,7 @@ Modifies the function to be asynchronous, if it is not already. ### convert_props_to_interface Converts React component props to TypeScript interfaces. - + None } description=""/> @@ -354,7 +354,7 @@ Converts React component props to TypeScript interfaces. ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSFunction ] } description=""/> @@ -443,7 +443,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -503,7 +503,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_valid_node Determines if a given tree-sitter node corresponds to a valid function type. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -690,7 +690,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -727,7 +727,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### prepend_statements Prepends the provided code to the beginning of the function body. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -752,7 +752,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_local_variable Renames a local variable and all its usages within a function body. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_return_type Sets the return type annotation for the function. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -115,7 +115,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Modifies the function type to be asynchronous by wrapping its return type in a Promise. - + None } description=""/> @@ -123,7 +123,7 @@ Modifies the function type to be asynchronous by wrapping its return type in a P ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSFunctionType ] } description=""/> @@ -212,7 +212,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -325,7 +325,7 @@ 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 - + Editable | None } description=""/> @@ -333,7 +333,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -341,7 +341,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [GenericType](/api-reference/core/GenericType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSGenericType ] } description=""/> @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -208,7 +208,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -321,7 +321,7 @@ 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 - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -337,7 +337,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -144,7 +144,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSHasBlock ] } description=""/> @@ -233,7 +233,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -363,7 +363,7 @@ 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 - + Editable | None } description=""/> @@ -371,7 +371,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -379,7 +379,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [IfBlockStatement](/api-reference/core/IfBlockStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -142,7 +142,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -150,7 +150,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + elif_statements Returns all elif blocks within the if block. - + list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> @@ -193,7 +193,7 @@ Returns all elif blocks within the if block. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSIfBlockStatement ] } description=""/> @@ -247,7 +247,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -360,7 +360,7 @@ 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 - + Editable | None } description=""/> @@ -368,7 +368,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a conditional block by reducing its condition to a boolean value. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [Import](/api-reference/core/Import), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -171,7 +171,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -179,7 +179,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSImport ] } description=""/> @@ -268,7 +268,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates an import string for an import statement. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -311,7 +311,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased_import Returns True if this import is aliased. - + bool } description="True if the import has an alias different from its original name, False otherwise."/> @@ -424,7 +424,7 @@ Returns True if this import is aliased. ### is_default_import Determines whether the import is a default export import. - + is_module_import Determines if an import represents a module-level import. - + is_reexport Returns true if the Import object is also an Export object. - + bool } description="True if the import is re-exported, False otherwise."/> @@ -466,7 +466,7 @@ Returns true if the Import object is also an Export object. ### is_symbol_import Returns True if this import is importing a symbol rather than a module. - + bool } description="True if this import is a symbol import, False if it is a module import."/> @@ -474,7 +474,7 @@ Returns True if this import is importing a symbol rather than a module. ### is_type_import Checks if an import is a type import. - + bool } description="True if the import is a type import, False otherwise."/> @@ -482,7 +482,7 @@ Checks if an import is a type import. ### is_wildcard_import Returns True if the import symbol is a wildcard import. - + bool } description="True if this is a wildcard import, False otherwise."/> @@ -490,7 +490,7 @@ Returns True if the import symbol is a wildcard import. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -498,7 +498,7 @@ 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 - + Editable | None } description=""/> @@ -506,7 +506,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -514,7 +514,7 @@ Reduces an editable to the following condition ### remove Remove this import from the import statement. - + rename Renames the import symbol and updates all its usages throughout the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve_import Resolves an import statement to its target file and symbol. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_import_module Sets the module of an import. - + set_import_symbol_alias Sets alias or name of an import at the declaration level. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [ImportStatement](/api-reference/core/ImportStatement), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression) @@ -117,7 +117,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -125,7 +125,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSImportStatement ] } description=""/> @@ -214,7 +214,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -327,7 +327,7 @@ 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 - + Editable | None } description=""/> @@ -335,7 +335,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -343,7 +343,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -178,7 +178,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -244,7 +244,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + extends Returns True if the interface implements the given parent interface. - + bool } description=""/> @@ -287,7 +287,7 @@ Returns True if the interface implements the given parent interface. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSInterface ] } description=""/> @@ -341,7 +341,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns the attribute with the given name, if it exists. - + Attribute | None } description=""/> @@ -349,7 +349,7 @@ Returns the attribute with the given name, if it exists. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -409,7 +409,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + implementations Returns all classes and interfaces that implement a given interface. - + list[Interface | Class ] } description=""/> @@ -440,7 +440,7 @@ Returns all classes and interfaces that implement a given interface. ### insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -536,7 +536,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -573,7 +573,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -581,7 +581,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasName](/api-reference/core/HasName), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -137,7 +137,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -145,7 +145,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSLabeledStatement ] } description=""/> @@ -234,7 +234,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -242,7 +242,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -355,7 +355,7 @@ 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 - + Editable | None } description=""/> @@ -363,7 +363,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -371,7 +371,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSLookupType ] } description=""/> @@ -201,7 +201,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -314,7 +314,7 @@ 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 - + Editable | None } description=""/> @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -330,7 +330,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -98,7 +98,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSNamedType ] } description=""/> @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -203,7 +203,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -316,7 +316,7 @@ 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 - + Editable | None } description=""/> @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -332,7 +332,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasName](/api-reference/core/HasName), [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable) @@ -173,7 +173,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -239,7 +239,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSNamespace ] } description=""/> @@ -328,7 +328,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Get a class by name from this namespace. - + TSClass | None } description=""/> @@ -336,7 +336,7 @@ Get a class by name from this namespace. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_enum Get an enum by name from this namespace. - + TSEnum | None } description=""/> @@ -361,7 +361,7 @@ Get an enum by name from this namespace. ### get_function Get a function by name from this namespace. - + TSFunction | None } description="The found function, or None if not found"/> @@ -369,7 +369,7 @@ Get a function by name from this namespace. ### get_import_string Generates the appropriate import string for a symbol. - + get_interface Get an interface by name from this namespace. - + TSInterface | None } description=""/> @@ -412,7 +412,7 @@ Get an interface by name from this namespace. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -420,7 +420,7 @@ Returns the name node of the object. ### get_namespace Get a namespace by name from this namespace. - + TSNamespace | None } description="The found namespace, or None if not found"/> @@ -428,7 +428,7 @@ Get a namespace by name from this namespace. ### get_nested_namespaces Get all nested namespaces within this namespace. - + list[ TSNamespace ] } description="List of all nested namespace objects"/> @@ -436,7 +436,7 @@ Get all nested namespaces within this namespace. ### get_symbol Get a symbol by name from this namespace. - + Symbol | None } description="The found symbol, or None if not found"/> @@ -444,7 +444,7 @@ Get a symbol by name from this namespace. ### get_type Get a type alias by name from this namespace. - + TSTypeAlias | None } description=""/> @@ -452,7 +452,7 @@ Get a type alias by name from this namespace. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -571,7 +571,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -608,7 +608,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -616,7 +616,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [TSDict](/api-reference/typescript/TSDict), [Expression](/api-reference/core/Expression), [Dict](/api-reference/core/Dict), [Editable](/api-reference/core/Editable) @@ -98,7 +98,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSObjectType ] } description=""/> @@ -195,7 +195,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -308,7 +308,7 @@ 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 - + Editable | None } description=""/> @@ -316,7 +316,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -324,7 +324,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Pair](/api-reference/core/Pair), [HasValue](/api-reference/core/HasValue), [Editable](/api-reference/core/Editable) @@ -109,7 +109,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -117,7 +117,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSPair ] } description=""/> @@ -206,7 +206,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -319,7 +319,7 @@ 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 - + Editable | None } description=""/> @@ -327,7 +327,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -335,7 +335,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Parameter](/api-reference/core/Parameter), [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Typeable](/api-reference/core/Typeable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -139,7 +139,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -147,7 +147,7 @@ Find all ancestors of the node of the given type. Does not return itself ### convert_to_interface Converts a parameter's inline type definition to an interface. - + None } description=""/> @@ -155,7 +155,7 @@ Converts a parameter's inline type definition to an interface. ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSParameter ] } description=""/> @@ -244,7 +244,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -252,7 +252,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -365,7 +365,7 @@ 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 - + Editable | None } description=""/> @@ -373,7 +373,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -381,7 +381,7 @@ Reduces an editable to the following condition ### remove Removes the parameter from the function definition and all its call sites. - + rename Renames a parameter in a function definition and updates all related references. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_type_annotation Sets the type annotation for this parameter. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -100,7 +100,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -108,7 +108,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSQueryType ] } description=""/> @@ -197,7 +197,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -310,7 +310,7 @@ 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 - + Editable | None } description=""/> @@ -318,7 +318,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -326,7 +326,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -100,7 +100,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -108,7 +108,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSReadonlyType ] } description=""/> @@ -197,7 +197,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -310,7 +310,7 @@ 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 - + Editable | None } description=""/> @@ -318,7 +318,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -326,7 +326,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -26,7 +26,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Modifies the return type annotation of a function. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/typescript/TSString.mdx b/docs/api-reference/typescript/TSString.mdx index 3de32a01c..bbc2ab0ec 100644 --- a/docs/api-reference/typescript/TSString.mdx +++ b/docs/api-reference/typescript/TSString.mdx @@ -20,7 +20,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [String](/api-reference/core/String), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -121,7 +121,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSString ] } description=""/> @@ -210,7 +210,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -323,7 +323,7 @@ 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 - + Editable | None } description=""/> @@ -331,7 +331,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -339,7 +339,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [SwitchCase](/api-reference/core/SwitchCase), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -137,7 +137,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -168,7 +168,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSSwitchCase ] } description=""/> @@ -257,7 +257,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -387,7 +387,7 @@ 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 - + Editable | None } description=""/> @@ -395,7 +395,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -403,7 +403,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [SwitchStatement](/api-reference/core/SwitchStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -121,7 +121,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSSwitchStatement ] } description=""/> @@ -210,7 +210,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -323,7 +323,7 @@ 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 - + Editable | None } description=""/> @@ -331,7 +331,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -339,7 +339,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -149,7 +149,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -192,7 +192,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSSymbol ] } description=""/> @@ -281,7 +281,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -324,7 +324,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -443,7 +443,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -480,7 +480,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -488,7 +488,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [TernaryExpression](/api-reference/core/TernaryExpression), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -102,7 +102,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -110,7 +110,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSTernaryExpression ] } description=""/> @@ -199,7 +199,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -312,7 +312,7 @@ 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 - + Editable | None } description=""/> @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a ternary expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [TryCatchStatement](/api-reference/core/TryCatchStatement), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -137,7 +137,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -168,7 +168,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSTryCatchStatement ] } description=""/> @@ -257,7 +257,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -387,7 +387,7 @@ 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 - + Editable | None } description=""/> @@ -395,7 +395,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -403,7 +403,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TypeAlias](/api-reference/core/TypeAlias), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [HasValue](/api-reference/core/HasValue), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -174,7 +174,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -240,7 +240,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSTypeAlias ] } description=""/> @@ -329,7 +329,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Retrieves a specific attribute from a TypeScript type alias by its name. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -406,7 +406,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -525,7 +525,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -562,7 +562,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -570,7 +570,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -90,7 +90,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSUndefinedType ] } description=""/> @@ -187,7 +187,7 @@ 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 - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -300,7 +300,7 @@ 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 - + Editable | None } description=""/> @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -316,7 +316,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [UnionType](/api-reference/core/UnionType), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -119,7 +119,7 @@ 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. - + CodeFlag[ TSUnionType ] } description=""/> @@ -173,7 +173,7 @@ 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. - + int } description=""/> @@ -204,7 +204,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -212,7 +212,7 @@ 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_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -302,7 +302,7 @@ 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 - + Editable | None } description=""/> @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -318,7 +318,7 @@ 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. - + search Searches for regex matches in the codebase. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [WhileStatement](/api-reference/core/WhileStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -137,7 +137,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -168,7 +168,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSWhileStatement ] } description=""/> @@ -257,7 +257,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -387,7 +387,7 @@ 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 - + Editable | None } description=""/> @@ -395,7 +395,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -403,7 +403,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + Each guide includes practical examples and best practices. Start with core concepts or jump directly to the topics most relevant to your needs. -{" "} + diff --git a/docs/building-with-codegen/reducing-conditions.mdx b/docs/building-with-codegen/reducing-conditions.mdx index 8ee18222c..5c5deee9c 100644 --- a/docs/building-with-codegen/reducing-conditions.mdx +++ b/docs/building-with-codegen/reducing-conditions.mdx @@ -274,4 +274,4 @@ const MyComponent: React.FC = () => { Condition reduction is particularly useful for cleaning up feature flags in React components, where conditional rendering is common. -{" "} + diff --git a/docs/building-with-codegen/symbol-api.mdx b/docs/building-with-codegen/symbol-api.mdx index ce3d2cbda..a25eb6328 100644 --- a/docs/building-with-codegen/symbol-api.mdx +++ b/docs/building-with-codegen/symbol-api.mdx @@ -113,4 +113,4 @@ for method in class_def.methods: The Symbol API is designed to be intuitive and match how developers think about code. Most transformations start with finding relevant symbols and then applying changes to them. -{" "} + diff --git a/docs/introduction/about.mdx b/docs/introduction/about.mdx index 903865ec9..24e7a5dba 100644 --- a/docs/introduction/about.mdx +++ b/docs/introduction/about.mdx @@ -68,4 +68,4 @@ We believe in the power of open source software. Our core library, [codegen](htt Want to learn more about what we're building? Check out our [getting started guide](/introduction/getting-started) or join our [community Slack](https://join.slack.com/t/codegen-community/shared_invite/...). -{" "} +