diff --git a/docs/api-reference/core/Argument.mdx b/docs/api-reference/core/Argument.mdx index 8a293a313..a6bedf024 100644 --- a/docs/api-reference/core/Argument.mdx +++ b/docs/api-reference/core/Argument.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of function calls present in the value of this argument." /> +list[ FunctionCall ] } description="Returns a list of function calls present in the value of this argument." /> ### index @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -100,11 +100,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -131,7 +131,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -189,7 +189,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -212,7 +212,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -220,7 +220,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Argument ] } description=""/> +CodeFlag[ Argument ] } description=""/> ### get_name @@ -228,7 +228,7 @@ 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."/> +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."/> ### get_variable_usages @@ -251,7 +251,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -349,7 +349,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -473,7 +473,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/core/Assignment.mdx b/docs/api-reference/core/Assignment.mdx index bbf165d26..2efe22c8c 100644 --- a/docs/api-reference/core/Assignment.mdx +++ b/docs/api-reference/core/Assignment.mdx @@ -31,11 +31,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -43,7 +43,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -68,7 +68,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -76,7 +76,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> ### is_local_variable @@ -102,19 +102,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -132,15 +132,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -162,12 +162,29 @@ Adds a comment to the symbol. None } description=""/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -225,7 +242,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -248,7 +265,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -256,7 +273,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Assignment ] } description=""/> +CodeFlag[ Assignment ] } description=""/> ### get_name @@ -264,7 +281,7 @@ 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."/> +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."/> ### get_variable_usages @@ -287,7 +304,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -391,7 +408,7 @@ 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."/> +list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> ### move_to_file @@ -428,7 +445,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -477,6 +494,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -544,7 +584,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -634,36 +674,36 @@ Sets the value of an assignment expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/AssignmentStatement.mdx b/docs/api-reference/core/AssignmentStatement.mdx index 90aeb8483..00fc852e1 100644 --- a/docs/api-reference/core/AssignmentStatement.mdx +++ b/docs/api-reference/core/AssignmentStatement.mdx @@ -25,7 +25,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignments -list[ Assignment ] } description=" +list[ Assignment ] } description=" " /> ### extended @@ -51,7 +51,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -59,16 +59,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### left -Expression [ Assignment ] } description=" +Expression [ Assignment ] } description=" " /> ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ AssignmentStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ AssignmentStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -82,23 +82,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ Assignment ] | None } description=" +Expression [ Assignment ] | None } description=" " /> ### source @@ -117,11 +117,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -131,7 +131,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -189,7 +189,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -212,7 +212,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -220,7 +220,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ AssignmentStatement ] } description=""/> +CodeFlag[ AssignmentStatement ] } description=""/> ### get_variable_usages @@ -243,7 +243,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -341,7 +341,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -448,7 +448,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/core/Attribute.mdx b/docs/api-reference/core/Attribute.mdx index ceedc28d9..7343bf2a9 100644 --- a/docs/api-reference/core/Attribute.mdx +++ b/docs/api-reference/core/Attribute.mdx @@ -25,12 +25,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignments -list[ Assignment ] } description=" +list[ Assignment ] } description=" " /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -59,7 +59,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### left -Expression [ Assignment ] } description=" +Expression [ Assignment ] } description=" " /> ### name @@ -84,11 +84,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ Attribute ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ Attribute ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -102,23 +102,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ Assignment ] | None } description=" +Expression [ Assignment ] | None } description=" " /> ### source @@ -137,11 +137,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -151,7 +151,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -209,7 +209,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -232,7 +232,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -240,7 +240,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Attribute ] } description=""/> +CodeFlag[ Attribute ] } description=""/> ### get_name @@ -248,7 +248,7 @@ 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."/> +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."/> ### get_variable_usages @@ -271,7 +271,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -369,7 +369,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -409,6 +409,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -476,7 +499,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -515,36 +538,36 @@ Sets the value of a node's assignment. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/AwaitExpression.mdx b/docs/api-reference/core/AwaitExpression.mdx index 71a434e3d..af97f6319 100644 --- a/docs/api-reference/core/AwaitExpression.mdx +++ b/docs/api-reference/core/AwaitExpression.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the await expression." /> +list[ FunctionCall ] } description="Gets all function calls within the await expression." /> ### node_type @@ -55,19 +55,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -80,11 +80,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -94,7 +94,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -152,7 +152,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -175,7 +175,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -183,7 +183,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ AwaitExpression ] } description=""/> +CodeFlag[ AwaitExpression ] } description=""/> ### get_variable_usages @@ -206,7 +206,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -304,7 +304,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -419,7 +419,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/core/BinaryExpression.mdx b/docs/api-reference/core/BinaryExpression.mdx index 2e56e1837..a6a67334c 100644 --- a/docs/api-reference/core/BinaryExpression.mdx +++ b/docs/api-reference/core/BinaryExpression.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### elements -list[ Expression [ BinaryExpression ]] } description="Returns all elements in a binary expression chain." /> +list[ Expression [ BinaryExpression ]] } description="Returns all elements in a binary expression chain." /> ### extended @@ -45,11 +45,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### left -Expression [ ComparisonExpression ] | None } description=" +Expression [ ComparisonExpression ] | None } description=" " /> ### node_type @@ -59,7 +59,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### operators -list[ ExpressionGroup [ Expression [ BinaryExpression ], BinaryExpression ]] } description="Returns a list of operators in a chain of binary operations." /> +list[ ExpressionGroup [ Expression [ BinaryExpression ], BinaryExpression ]] } description="Returns a list of operators in a chain of binary operations." /> ### parent @@ -68,23 +68,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ ComparisonExpression ] | None } description=" +Expression [ ComparisonExpression ] | None } description=" " /> ### source @@ -98,7 +98,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -108,7 +108,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -166,7 +166,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -189,7 +189,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -197,7 +197,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ BinaryExpression ] } description=""/> +CodeFlag[ BinaryExpression ] } description=""/> ### get_variable_usages @@ -220,7 +220,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -318,7 +318,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -434,7 +434,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/BlockStatement.mdx b/docs/api-reference/core/BlockStatement.mdx index 4e922362a..9b9f4f432 100644 --- a/docs/api-reference/core/BlockStatement.mdx +++ b/docs/api-reference/core/BlockStatement.mdx @@ -20,16 +20,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -54,7 +54,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -66,11 +66,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ BlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ BlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -84,19 +84,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -114,7 +114,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -147,7 +147,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -205,7 +205,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -228,7 +228,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -236,7 +236,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ BlockStatement ] } description=""/> +CodeFlag[ BlockStatement ] } description=""/> ### get_variable_usages @@ -259,7 +259,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -357,7 +357,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -464,7 +464,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/Boolean.mdx b/docs/api-reference/core/Boolean.mdx index ea2a1cb77..cd93b1e0d 100644 --- a/docs/api-reference/core/Boolean.mdx +++ b/docs/api-reference/core/Boolean.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -58,19 +58,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -93,7 +93,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -151,7 +151,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -174,7 +174,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -182,7 +182,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Boolean ] } description=""/> +CodeFlag[ Boolean ] } description=""/> ### get_variable_usages @@ -205,7 +205,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -303,7 +303,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -410,7 +410,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Callable.mdx b/docs/api-reference/core/Callable.mdx index bba80ecda..299cf69bd 100644 --- a/docs/api-reference/core/Callable.mdx +++ b/docs/api-reference/core/Callable.mdx @@ -23,11 +23,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -69,7 +69,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , Callable ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , Callable ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -78,23 +78,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### source @@ -108,7 +108,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -118,7 +118,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -176,7 +176,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -199,7 +199,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -207,7 +207,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Callable ] } description=""/> +CodeFlag[ Callable ] } description=""/> ### get_name @@ -215,7 +215,7 @@ 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."/> +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."/> ### get_parameter @@ -232,7 +232,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -249,7 +249,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -266,7 +266,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_variable_usages @@ -289,7 +289,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -387,7 +387,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -427,6 +427,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -494,7 +517,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -516,36 +539,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/CatchStatement.mdx b/docs/api-reference/core/CatchStatement.mdx index 199936f11..98c857e45 100644 --- a/docs/api-reference/core/CatchStatement.mdx +++ b/docs/api-reference/core/CatchStatement.mdx @@ -25,20 +25,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ PyCatchStatement ] | None } description="The condition which triggers this clause" /> +Expression [ PyCatchStatement ] | None } description="The condition which triggers this clause" /> ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -63,7 +63,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -75,11 +75,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ CatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ CatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -93,19 +93,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ CatchStatement ] } description=""/> +CodeFlag[ CatchStatement ] } description=""/> ### get_variable_usages @@ -268,7 +268,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -473,7 +473,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/ChainedAttribute.mdx b/docs/api-reference/core/ChainedAttribute.mdx index 58918a938..17ff7bf0c 100644 --- a/docs/api-reference/core/ChainedAttribute.mdx +++ b/docs/api-reference/core/ChainedAttribute.mdx @@ -53,7 +53,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -164,7 +164,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -187,7 +187,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ChainedAttribute ] } description=""/> +CodeFlag[ ChainedAttribute ] } description=""/> ### get_variable_usages @@ -218,7 +218,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -316,7 +316,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -423,7 +423,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Class.mdx b/docs/api-reference/core/Class.mdx index 99718c16d..f6c03c92f 100644 --- a/docs/api-reference/core/Class.mdx +++ b/docs/api-reference/core/Class.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### code_block @@ -28,11 +28,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> ### constructor -Function | None } description="Returns the constructor method for this class." /> +Function | None } description="Returns the constructor method for this class." /> ### constructor_keyword @@ -41,15 +41,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -57,7 +57,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -82,11 +82,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### inline_comment -CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> ### is_decorated @@ -102,7 +102,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_classes -list[ Class ] } description="Retrieves the nested classes defined within this class." /> +list[ Class ] } description="Retrieves the nested classes defined within this class." /> ### node_type @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , Class ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , Class ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -120,32 +120,32 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_class_names -list[ Name | ChainedAttribute ] } description="Returns a list of the parent class names that this class inherits from." /> +list[ Name | ChainedAttribute ] } description="Returns a list of the parent class names that this class inherits from." /> ### parent_classes -Parents[ Type , PyClass ] | None } description=" +Parents[ Type , PyClass ] | None } description=" " /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### source @@ -164,12 +164,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -254,6 +254,23 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### add_source Add a block of source code to the bottom of a class definition. @@ -276,7 +293,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### attributes @@ -299,7 +316,7 @@ Retrieves all attributes from this Class including those from its superclasses u -list[ Attribute ] } description="A list of unique attributes from this class and its superclasses. If an attribute is defined in multiple classes, the first definition encountered is used."/> +list[ Attribute ] } description="A list of unique attributes from this class and its superclasses. If an attribute is defined in multiple classes, the first definition encountered is used."/> ### edit @@ -357,7 +374,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -380,7 +397,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -388,7 +405,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Class ] } description=""/> +CodeFlag[ Class ] } description=""/> ### get_attribute @@ -405,7 +422,7 @@ Returns a specific attribute by name. -Attribute | None } description="The matching attribute if found, None otherwise. If multiple attributes with the same name exist in the inheritance hierarchy, returns the first one found."/> +Attribute | None } description="The matching attribute if found, None otherwise. If multiple attributes with the same name exist in the inheritance hierarchy, returns the first one found."/> ### get_method @@ -422,7 +439,7 @@ Returns a specific method by name from the class or any of its superclasses. -Function | None } description="The method if found, None otherwise."/> +Function | None } description="The method if found, None otherwise."/> ### get_name @@ -430,7 +447,7 @@ 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."/> +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."/> ### get_nested_class @@ -447,7 +464,7 @@ Returns a nested class by name from the current class. -Class | None } description="The nested class if found, None otherwise."/> +Class | None } description="The nested class if found, None otherwise."/> ### get_parameter @@ -464,7 +481,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -481,7 +498,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -498,7 +515,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_parent_class @@ -515,7 +532,7 @@ Returns the parent class node with the specified name. -Editable | None } description="The matching parent class node, or None if no match is found."/> +Editable | None } description="The matching parent class node, or None if no match is found."/> ### get_variable_usages @@ -538,7 +555,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -636,7 +653,7 @@ Checks if the class inherits from a specified parent class. str | Class } + type={ <>str | Class } description="The parent class to check for. Can be specified either as a class name string or Class object." defaultValue="" /> @@ -686,7 +703,7 @@ Retrieves all methods that exist on this Class, including methods from superclas -list[ Function ] | MultiLineCollection [ Function , Class ] } description=""/> +list[ Function ] | MultiLineCollection [ Function , Class ] } description=""/> ### move_to_file @@ -723,7 +740,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -763,6 +780,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -830,7 +870,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -915,7 +955,7 @@ Returns all classes which subclass this class. -list[ Class ] } description="A list of Class objects that inherit from this class."/> +list[ Class ] } description="A list of Class objects that inherit from this class."/> ### superclasses @@ -932,41 +972,41 @@ Returns a list of all classes that this class extends, up to max_depth. -list[ Class | ExternalModule | Interface] } description="A list of all superclass symbols in MRO order, up to max_depth. Returns an empty list if the class has no parent classes."/> +list[ Class | ExternalModule | Interface] } description="A list of all superclass symbols in MRO order, up to max_depth. Returns an empty list if the class has no parent classes."/> ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/CodeBlock.mdx b/docs/api-reference/core/CodeBlock.mdx index 20b0b22c1..4dc88f8b2 100644 --- a/docs/api-reference/core/CodeBlock.mdx +++ b/docs/api-reference/core/CodeBlock.mdx @@ -24,19 +24,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignment_statements -list[ AssignmentStatement [ CodeBlock , Assignment ]] } description="Returns list of top level assignment statements in the code block." /> +list[ AssignmentStatement [ CodeBlock , Assignment ]] } description="Returns list of top level assignment statements in the code block." /> ### assignments -list[ Assignment [ Editable , CodeBlock ]] } description="Returns all assignments in the code block across all nesting levels." /> +list[ Assignment [ Editable , CodeBlock ]] } description="Returns all assignments in the code block across all nesting levels." /> ### attributes -list[ Attribute [ Editable , CodeBlock ]] } description="Returns a list of top level class attribute statements in the code block." /> +list[ Attribute [ Editable , CodeBlock ]] } description="Returns a list of top level class attribute statements in the code block." /> ### comments -list[ Comment [ Editable , CodeBlock ]] } description="Gets list of top level comments in the code block." /> +list[ Comment [ Editable , CodeBlock ]] } description="Gets list of top level comments in the code block." /> ### extended @@ -61,11 +61,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls in the code block." /> +list[ FunctionCall ] } description="Returns a list of all function calls in the code block." /> ### if_blocks -list[ IfBlockStatement [ CodeBlock ]] } description="Returns a list of top level if statements in the code block." /> +list[ IfBlockStatement [ CodeBlock ]] } description="Returns a list of top level if statements in the code block." /> ### level @@ -74,7 +74,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### local_var_assignments -list[ Assignment [ Editable , CodeBlock ]] } description="Returns all local variable assignment in the code block, for all nest levels." /> +list[ Assignment [ Editable , CodeBlock ]] } description="Returns all local variable assignment in the code block, for all nest levels." /> ### node_type @@ -88,28 +88,28 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_statements -list[ ReturnStatement [ CodeBlock ]] } description="Gets all return statements at the top level of the code block." /> +list[ ReturnStatement [ CodeBlock ]] } description="Gets all return statements at the top level of the code block." /> ### source @@ -117,11 +117,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### statements -MultiLineCollection [ Statement , CodeBlock ] } description="Gets a view of the top-level statements in the code block." /> +MultiLineCollection [ Statement , CodeBlock ] } description="Gets a view of the top-level statements in the code block." /> ### symbol_statements -list[ SymbolStatement ] } description="Returns list of top level symbol statements in the code block." /> +list[ SymbolStatement ] } description="Returns list of top level symbol statements in the code block." /> ### ts_node @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -140,7 +140,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -198,7 +198,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -221,7 +221,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -229,7 +229,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ CodeBlock ] } description=""/> +CodeFlag[ CodeBlock ] } description=""/> ### get_assignments @@ -246,7 +246,7 @@ Returns a list of assignments with the specified variable name. -list[ Assignment [ Editable , CodeBlock ]] } description="A list of Assignment objects that match the variable name."/> +list[ Assignment [ Editable , CodeBlock ]] } description="A list of Assignment objects that match the variable name."/> ### get_attributes @@ -263,7 +263,7 @@ Returns attributes from the code block, with the option to include or exclude pr -list[ Attribute [ Editable , CodeBlock ]] } description="A list of attribute statements matching the privacy criteria."/> +list[ Attribute [ Editable , CodeBlock ]] } description="A list of attribute statements matching the privacy criteria."/> ### get_comment @@ -280,7 +280,7 @@ Gets the first comment statement containing a specific text string. -Comment [ Editable , CodeBlock ] | None } description="The first comment statement containing the search text, or None if no matching comment is found."/> +Comment [ Editable , CodeBlock ] | None } description="The first comment statement containing the search text, or None if no matching comment is found."/> ### get_local_var_assignment @@ -297,7 +297,7 @@ Returns the first code statement that assigns a local variable with the specifie -Assignment [ Editable , CodeBlock ] | None } description="The first matching local variable assignment, or None if no match is found."/> +Assignment [ Editable , CodeBlock ] | None } description="The first matching local variable assignment, or None if no match is found."/> ### get_local_var_assignments @@ -320,7 +320,7 @@ Returns all instances of local variable assignments that match the specified var -list[ Assignment [ Editable , CodeBlock ]] } description="List of Assignment objects representing local variable assignments that match the specified name criteria."/> +list[ Assignment [ Editable , CodeBlock ]] } description="List of Assignment objects representing local variable assignments that match the specified name criteria."/> ### get_statements @@ -330,7 +330,7 @@ Returns all statements of a given type up to the specified block level. StatementType | None } + type={ <>StatementType | None } description="The type of statements to return. If None, returns all statement types." defaultValue="None" /> @@ -343,7 +343,7 @@ Returns all statements of a given type up to the specified block level. -list[ Statement [ CodeBlock ]] } description=""/> +list[ Statement [ CodeBlock ]] } description=""/> ### get_variable_usages @@ -366,7 +366,7 @@ Returns all instances of variable usages in a code block. -list[ Editable [ CodeBlock ]] } description="A sorted list of variable usage instances as Editable objects."/> +list[ Editable [ CodeBlock ]] } description="A sorted list of variable usage instances as Editable objects."/> ### indent @@ -386,6 +386,35 @@ Adjusts the indentation level of the entire code block. None } description=""/> +### insert_after +Inserts source code at the bottom of the code block. + + + +str } + description="The source code to insert." + defaultValue="" +/> +bool } + description="Whether to fix the indentation of the inserted code. Defaults to True." + defaultValue="True" +/> +bool } + description="Whether to add a newline before the inserted code. Defaults to True." + defaultValue="True" +/> + + + +None } description=""/> + + ### insert_before Inserts new source code at the top of the code block. @@ -416,7 +445,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -552,7 +581,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### unwrap diff --git a/docs/api-reference/core/Codebase.mdx b/docs/api-reference/core/Codebase.mdx index 53a65b87f..fa46cb215 100644 --- a/docs/api-reference/core/Codebase.mdx +++ b/docs/api-reference/core/Codebase.mdx @@ -14,14 +14,14 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes ### classes -list[ Class ] } description="List of all Classes in the codebase." /> +list[ Class ] } description="List of all Classes in the codebase." /> ### console @@ -38,23 +38,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### directories -list[ Directory ] } description="List all directories in the codebase." /> +list[ Directory ] } description="List all directories in the codebase." /> ### external_modules -list[ ExternalModule ] } description="Returns a list of all external modules in the codebase." /> +list[ ExternalModule ] } description="Returns a list of all external modules in the codebase." /> ### functions -list[ Function ] } description="List of all Functions in the codebase." /> +list[ Function ] } description="List of all Functions in the codebase." /> ### global_vars -list[ Assignment ] } description="List of all GlobalVars in the codebase." /> +list[ Assignment ] } description="List of all GlobalVars in the codebase." /> ### imports -list[ Import ] } description="Returns a list of all Import nodes in the codebase." /> +list[ Import ] } description="Returns a list of all Import nodes in the codebase." /> ### interfaces @@ -75,11 +75,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Symbol ] } description="List of all top-level Symbols (Classes, Functions, etc.) in the codebase. Excludes Class" /> +list[ Symbol ] } description="List of all top-level Symbols (Classes, Functions, etc.) in the codebase. Excludes Class" /> ### types -list[ TypeAlias ] } description="List of all Types in the codebase (Typescript only)." /> +list[ TypeAlias ] } description="List of all Types in the codebase (Typescript only)." /> ### viz @@ -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. - + Editable | None } + type={ <>Editable | None } description="An optional editable object (like a function, class, etc.) that provides the main focus for the AI's response." defaultValue="None" /> Editable | list[ Editable ] | dict[str, Editable | list[ Editable ]] | None } + type={ <>Editable | list[ Editable ] | dict[str, Editable | list[ Editable ]] | None } description="Additional context to help inform the AI's response." defaultValue="None" /> @@ -126,7 +126,7 @@ Generates a response from the AI based on the provided prompt, target, and conte ### 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."/> +list[ SourceFile ] | list[ File ] } description="A sorted list of source files in the codebase."/> ### find_by_span Finds editable objects that overlap with the given source code span. - + -list[ Editable ] } description="A list of Editable objects that overlap with the given span."/> +list[ Editable ] } description="A list of Editable objects that overlap with the given span."/> + + +### from_repo +Fetches a codebase from GitHub and returns a Codebase instance. + + + +str } + description="The name of the repository in format "owner/repo"" + defaultValue="" +/> +Optional[str] } + description="The directory to clone the repo into. Defaults to /tmp/codegen" + defaultValue="None" +/> +Optional[str] } + description="The specific commit hash to clone. Defaults to HEAD" + defaultValue="None" +/> +bool } + description="Whether to do a shallow clone. Defaults to True" + defaultValue="True" +/> + + + +Codebase } description="A Codebase instance initialized with the cloned repository"/> ### get_class Returns a class that matches the given name. - + -Class | None } description="The class with the given name, or None if optional=True and class not found."/> +Class | None } description="The class with the given name, or None if optional=True and class not found."/> ### get_directory Returns Directory by `dir_path`, or full path to the directory from codebase root. - + -Directory | None } description="The Directory object if found, None if optional=True and directory not found."/> +Directory | None } description="The Directory object if found, None if optional=True and directory not found."/> ### get_file Retrieves a file from the codebase by its filepath. - + -SourceFile | None } description="The source file if found, None if optional=True and file not found."/> +SourceFile | None } description="The source file if found, None if optional=True and file not found."/> ### get_function Retrieves a function from the codebase by its name. - + -Function | None } description="The matching function if found. If optional=True and no match is found, returns None."/> +Function | None } description="The matching function if found. If optional=True and no match is found, returns None."/> ### 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. - + -Symbol | None } description="The matched Symbol if found, None if not found and optional=True."/> +Symbol | None } description="The matched Symbol if found, None if not found and optional=True."/> ### get_symbols Retrieves all symbols in the codebase that match the given symbol name. - + -list[ Symbol ] } description="A list of Symbol objects that match the given name, sorted alphabetically."/> +list[ Symbol ] } description="A list of Symbol objects that match the given name, sorted alphabetically."/> ### 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 +545,7 @@ Resets the codebase by ### set_ai_key Sets the OpenAI key for the current Codebase instance. - + None } description=""/> @@ -518,7 +553,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 +561,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. - + Editable | str | int | None } + type={ <>Editable | str | int | None } description="The root node to visualize around. When specified, the visualization will be centered on this node. Defaults to None." defaultValue="None" /> diff --git a/docs/api-reference/core/Comment.mdx b/docs/api-reference/core/Comment.mdx index 5bb7e69b7..17370c99b 100644 --- a/docs/api-reference/core/Comment.mdx +++ b/docs/api-reference/core/Comment.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -49,11 +49,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns a list of nested code blocks within the statement." /> +list[ CodeBlock ] } description="Returns a list of nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ Comment ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ Comment ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -186,7 +186,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -209,7 +209,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -217,7 +217,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Comment ] } description=""/> +CodeFlag[ Comment ] } description=""/> ### get_variable_usages @@ -240,7 +240,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -338,7 +338,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -445,7 +445,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/CommentGroup.mdx b/docs/api-reference/core/CommentGroup.mdx index c6476eb51..36e0bc34d 100644 --- a/docs/api-reference/core/CommentGroup.mdx +++ b/docs/api-reference/core/CommentGroup.mdx @@ -41,15 +41,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -63,15 +63,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### text @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -177,7 +177,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -200,7 +200,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -208,7 +208,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ CommentGroup ] } description=""/> +CodeFlag[ CommentGroup ] } description=""/> ### get_variable_usages @@ -231,7 +231,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -430,7 +430,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/core/ComparisonExpression.mdx b/docs/api-reference/core/ComparisonExpression.mdx index 19ffb2fb9..4de1d2368 100644 --- a/docs/api-reference/core/ComparisonExpression.mdx +++ b/docs/api-reference/core/ComparisonExpression.mdx @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### elements -list[ Expression [ ComparisonExpression ]] } description="Returns a list of expressions for named child nodes." /> +list[ Expression [ ComparisonExpression ]] } description="Returns a list of expressions for named child nodes." /> ### extended @@ -48,11 +48,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### left -Expression [ ComparisonExpression ] | None } description=" +Expression [ ComparisonExpression ] | None } description=" " /> ### node_type @@ -62,7 +62,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### operators -list[ ExpressionGroup [ Expression [ ComparisonExpression ], ComparisonExpression ]] } description="Returns a list of operator expressions in a comparison expression." /> +list[ ExpressionGroup [ Expression [ ComparisonExpression ], ComparisonExpression ]] } description="Returns a list of operator expressions in a comparison expression." /> ### parent @@ -71,23 +71,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ ComparisonExpression ] | None } description=" +Expression [ ComparisonExpression ] | None } description=" " /> ### source @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -169,7 +169,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -192,7 +192,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ComparisonExpression ] } description=""/> +CodeFlag[ ComparisonExpression ] } description=""/> ### get_variable_usages @@ -223,7 +223,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Decorator.mdx b/docs/api-reference/core/Decorator.mdx index a5faa770a..c2acdf233 100644 --- a/docs/api-reference/core/Decorator.mdx +++ b/docs/api-reference/core/Decorator.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call -FunctionCall | None } description="Returns any function call made by this decorator." /> +FunctionCall | None } description="Returns any function call made by this decorator." /> ### extended @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -160,7 +160,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -183,7 +183,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -191,7 +191,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Decorator ] } description=""/> +CodeFlag[ Decorator ] } description=""/> ### get_name @@ -199,7 +199,7 @@ 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."/> +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."/> ### get_variable_usages @@ -222,7 +222,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -444,7 +444,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/core/Dict.mdx b/docs/api-reference/core/Dict.mdx index 055e0d68a..202bee716 100644 --- a/docs/api-reference/core/Dict.mdx +++ b/docs/api-reference/core/Dict.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -58,19 +58,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -83,12 +83,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### unpack -Unpack [ TSObjectType ] | None } description=" +Unpack [ TSObjectType ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -156,7 +156,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -179,7 +179,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -187,7 +187,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Dict ] } description=""/> +CodeFlag[ Dict ] } description=""/> ### get_variable_usages @@ -210,7 +210,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -415,7 +415,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Directory.mdx b/docs/api-reference/core/Directory.mdx index 7964db3d9..ec314c95d 100644 --- a/docs/api-reference/core/Directory.mdx +++ b/docs/api-reference/core/Directory.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### classes -list[ Class ] } description="Get a recursive list of all classes in the directory and its subdirectories." /> +list[ Class ] } description="Get a recursive list of all classes in the directory and its subdirectories." /> ### dirpath @@ -29,23 +29,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### files -list[ File ] } description="Get a recursive list of all files in the directory and its subdirectories." /> +list[ File ] } description="Get a recursive list of all files in the directory and its subdirectories." /> ### functions -list[ Function ] } description="Get a recursive list of all functions in the directory and its subdirectories." /> +list[ Function ] } description="Get a recursive list of all functions in the directory and its subdirectories." /> ### global_vars -list[ Assignment ] } description="Get a recursive list of all global variables in the directory and its subdirectories." /> +list[ Assignment ] } description="Get a recursive list of all global variables in the directory and its subdirectories." /> ### import_statements -list[ ImportStatement ] } description="Get a recursive list of all import statements in the directory and its subdirectories." /> +list[ ImportStatement ] } description="Get a recursive list of all import statements in the directory and its subdirectories." /> ### items -dict[str, File | Directory ] } description=" +dict[str, File | Directory ] } description=" " /> ### name @@ -54,7 +54,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent -Directory | None } description=" +Directory | None } description=" " /> ### path @@ -64,11 +64,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### subdirectories -list[ Directory ] } description="Get a recursive list of all subdirectories in the directory and its subdirectories." /> +list[ Directory ] } description="Get a recursive list of all subdirectories in the directory and its subdirectories." /> ### symbols -list[ Symbol ] } description="Get a recursive list of all symbols in the directory and its subdirectories." /> +list[ Symbol ] } description="Get a recursive list of all symbols in the directory and its subdirectories." /> ## Methods @@ -94,7 +94,7 @@ Get a class by name in the directory and its subdirectories. -Class | None } description=""/> +Class | None } description=""/> ### get_file @@ -102,7 +102,7 @@ Get a file by its name relative to the directory. -File | None } description=""/> +File | None } description=""/> ### get_function @@ -110,7 +110,7 @@ Get a function by name in the directory and its subdirectories. -Function | None } description=""/> +Function | None } description=""/> ### get_global_var @@ -118,7 +118,7 @@ Get a global variable by name in the directory and its subdirectories. -Assignment | None } description=""/> +Assignment | None } description=""/> ### get_import_statement @@ -126,7 +126,7 @@ Get an import statement by name in the directory and its subdirectories. -ImportStatement | None } description=""/> +ImportStatement | None } description=""/> ### get_subdirectory @@ -134,7 +134,7 @@ Get a subdirectory by its path relative to the directory. -Directory | None } description=""/> +Directory | None } description=""/> ### get_symbol @@ -142,7 +142,15 @@ Get a symbol by name in the directory and its subdirectories. -Symbol | None } description=""/> +Symbol | None } description=""/> + + +### remove +Remove the directory and all its files and subdirectories. + + + +None } description=""/> ### remove_file diff --git a/docs/api-reference/core/Editable.mdx b/docs/api-reference/core/Editable.mdx index d66e52a02..5ec1cbbe6 100644 --- a/docs/api-reference/core/Editable.mdx +++ b/docs/api-reference/core/Editable.mdx @@ -43,7 +43,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -57,15 +57,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -78,7 +78,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -88,7 +88,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -146,7 +146,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -169,7 +169,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -177,7 +177,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Editable ] } description=""/> +CodeFlag[ Editable ] } description=""/> ### get_variable_usages @@ -200,7 +200,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -405,7 +405,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Export.mdx b/docs/api-reference/core/Export.mdx index 78a2de6b7..f73edd0ca 100644 --- a/docs/api-reference/core/Export.mdx +++ b/docs/api-reference/core/Export.mdx @@ -20,11 +20,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### export_statement @@ -37,7 +37,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### exported_symbol -Exportable | None } description="Returns the symbol, file, or import being exported from this export object." /> +Exportable | None } description="Returns the symbol, file, or import being exported from this export object." /> ### extended @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### is_exported @@ -92,23 +92,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_symbol -Exportable | None } description="Returns the resolved symbol for an export." /> +Exportable | None } description="Returns the resolved symbol for an export." /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -121,7 +121,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -131,7 +131,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -189,7 +189,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -212,7 +212,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -220,7 +220,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Export ] } description=""/> +CodeFlag[ Export ] } description=""/> ### get_import_string @@ -263,7 +263,7 @@ 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."/> +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."/> ### get_variable_usages @@ -286,7 +286,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -408,7 +408,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -448,6 +448,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -515,7 +538,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -537,36 +560,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/ExportStatement.mdx b/docs/api-reference/core/ExportStatement.mdx index 7d254a663..ef33c81fa 100644 --- a/docs/api-reference/core/ExportStatement.mdx +++ b/docs/api-reference/core/ExportStatement.mdx @@ -25,7 +25,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### exports -Collection[ Export , ExportStatement ] } description="A list of the individual exports this statement represents" /> +Collection[ Export , ExportStatement ] } description="A list of the individual exports this statement represents" /> ### extended @@ -50,7 +50,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -58,11 +58,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ ExportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ ExportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -76,23 +76,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### reexports -list[ TSExport ] } description="Retrieves a list of re-exported symbols from this export statement." /> +list[ TSExport ] } description="Retrieves a list of re-exported symbols from this export statement." /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -110,7 +110,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ExportStatement ] } description=""/> +CodeFlag[ ExportStatement ] } description=""/> ### get_variable_usages @@ -232,7 +232,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -330,7 +330,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Exportable.mdx b/docs/api-reference/core/Exportable.mdx index 39b6b2a87..26396e8fd 100644 --- a/docs/api-reference/core/Exportable.mdx +++ b/docs/api-reference/core/Exportable.mdx @@ -22,11 +22,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -59,7 +59,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### is_exported @@ -85,19 +85,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -110,7 +110,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Exportable ] } description=""/> +CodeFlag[ Exportable ] } description=""/> ### get_import_string @@ -252,7 +252,7 @@ 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."/> +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."/> ### get_variable_usages @@ -275,7 +275,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -373,7 +373,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -413,6 +413,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -480,7 +503,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -502,36 +525,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/Expression.mdx b/docs/api-reference/core/Expression.mdx index ba9b43e5f..508758f84 100644 --- a/docs/api-reference/core/Expression.mdx +++ b/docs/api-reference/core/Expression.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -55,19 +55,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -80,7 +80,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -90,7 +90,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -148,7 +148,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -171,7 +171,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -179,7 +179,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Expression ] } description=""/> +CodeFlag[ Expression ] } description=""/> ### get_variable_usages @@ -202,7 +202,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -300,7 +300,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -407,7 +407,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/ExpressionGroup.mdx b/docs/api-reference/core/ExpressionGroup.mdx index 70ff37242..9281bae17 100644 --- a/docs/api-reference/core/ExpressionGroup.mdx +++ b/docs/api-reference/core/ExpressionGroup.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### expressions -list[ Expression ] } description="Returns all expressions in the group." /> +list[ Expression ] } description="Returns all expressions in the group." /> ### extended @@ -45,15 +45,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the expression group." /> +list[ FunctionCall ] } description="Returns all function calls within the expression group." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -67,15 +67,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -160,7 +160,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -183,7 +183,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -191,7 +191,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ExpressionGroup ] } description=""/> +CodeFlag[ ExpressionGroup ] } description=""/> ### get_variable_usages @@ -214,7 +214,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -312,7 +312,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -413,7 +413,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/core/ExpressionStatement.mdx b/docs/api-reference/core/ExpressionStatement.mdx index 5419ab447..ee91ea5ca 100644 --- a/docs/api-reference/core/ExpressionStatement.mdx +++ b/docs/api-reference/core/ExpressionStatement.mdx @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Get all function calls contained within this expression statement." /> +list[ FunctionCall ] } description="Get all function calls contained within this expression statement." /> ### index @@ -64,11 +64,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ ExpressionStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ ExpressionStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -82,19 +82,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -112,11 +112,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -126,7 +126,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -184,7 +184,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -207,7 +207,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -215,7 +215,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ExpressionStatement ] } description=""/> +CodeFlag[ ExpressionStatement ] } description=""/> ### get_variable_usages @@ -238,7 +238,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -336,7 +336,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -451,7 +451,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/core/ExternalModule.mdx b/docs/api-reference/core/ExternalModule.mdx index da8de0d76..2c69be879 100644 --- a/docs/api-reference/core/ExternalModule.mdx +++ b/docs/api-reference/core/ExternalModule.mdx @@ -25,11 +25,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -58,7 +58,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -list[ Parameter ] } description="Returns list of named parameters from an external function symbol." /> +list[ Parameter ] } description="Returns list of named parameters from an external function symbol." /> ### parent @@ -80,23 +80,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### source @@ -110,7 +110,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ExternalModule ] } description=""/> +CodeFlag[ ExternalModule ] } description=""/> ### from_import @@ -269,7 +269,7 @@ 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."/> +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."/> ### get_parameter @@ -286,7 +286,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -303,7 +303,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -320,7 +320,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_variable_usages @@ -343,7 +343,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -441,7 +441,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -481,6 +481,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -548,7 +571,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -570,36 +593,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/File.mdx b/docs/api-reference/core/File.mdx index e0d0adbfa..73a40212d 100644 --- a/docs/api-reference/core/File.mdx +++ b/docs/api-reference/core/File.mdx @@ -27,7 +27,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### directory -Directory | None } description="Returns the directory that contains this file." /> +Directory | None } description="Returns the directory that contains this file." /> ### extended @@ -61,7 +61,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### is_binary @@ -88,15 +88,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### path @@ -118,7 +118,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -128,7 +128,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -186,7 +186,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -209,7 +209,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -217,7 +217,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ File ] } description=""/> +CodeFlag[ File ] } description=""/> ### get_variable_usages @@ -240,7 +240,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -338,7 +338,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### parse @@ -458,7 +458,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### update_filepath diff --git a/docs/api-reference/core/FlagKwargs.mdx b/docs/api-reference/core/FlagKwargs.mdx new file mode 100644 index 000000000..087bf7478 --- /dev/null +++ b/docs/api-reference/core/FlagKwargs.mdx @@ -0,0 +1,38 @@ +--- +title: "FlagKwargs" +sidebarTitle: "FlagKwargs" +icon: "" +description: "Kwargs for the flag_instance method of the Codebase class. + +Attributes: +message: The message to be displayed in the diff preview or posted as a comment on the PR. +message_type: Where the message will be sent (CODEGEN, GITHUB, SLACK) +message_recipient: The recipient of the message. +" +--- +import {Parameter} from '/snippets/Parameter.mdx'; +import {ParameterWrapper} from '/snippets/ParameterWrapper.mdx'; +import {Return} from '/snippets/Return.mdx'; +import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; +import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; +import {Attribute} from '/snippets/Attribute.mdx'; + + + + +## Attributes + +### message + +ReadOnly[str | None] } description="The message to be displayed in the diff preview or posted as a comment on the PR." /> + +### message_recipient + +ReadOnly[str | None] } description="The recipient of the message." /> + +### message_type + +ReadOnly[ MessageType ] } description="Where the message will be sent (CODEGEN, GITHUB, SLACK)" /> + + + diff --git a/docs/api-reference/core/ForLoopStatement.mdx b/docs/api-reference/core/ForLoopStatement.mdx index 1ce2fb51c..08ca24070 100644 --- a/docs/api-reference/core/ForLoopStatement.mdx +++ b/docs/api-reference/core/ForLoopStatement.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 [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) @@ -28,11 +28,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -57,7 +57,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### index @@ -69,21 +69,21 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### item -Expression [ ForLoopStatement ] | None } description=" +Expression [ ForLoopStatement ] | None } description=" " /> ### iterable -Expression [ ForLoopStatement ] } description=" +Expression [ ForLoopStatement ] } description=" " /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ ForLoopStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ ForLoopStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -97,19 +97,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -127,7 +127,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -160,7 +160,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -218,7 +218,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -241,7 +241,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -249,7 +249,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ForLoopStatement ] } description=""/> +CodeFlag[ ForLoopStatement ] } description=""/> ### get_variable_usages @@ -272,7 +272,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -370,7 +370,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -477,7 +477,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/Function.mdx b/docs/api-reference/core/Function.mdx index c6c096272..cc7f41a91 100644 --- a/docs/api-reference/core/Function.mdx +++ b/docs/api-reference/core/Function.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 [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) @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### code_block @@ -32,19 +32,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -52,7 +52,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -77,7 +77,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the function and its parameters." /> +list[ FunctionCall ] } description="Gets all function calls within the function and its parameters." /> ### function_signature @@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> ### is_async @@ -129,7 +129,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_functions -list[ Function ] } description="Returns a list of nested functions defined within this function's code block." /> +list[ Function ] } description="Returns a list of nested functions defined within this function's code block." /> ### node_type @@ -138,7 +138,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , Function ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , Function ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -147,27 +147,27 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_statements -list[ ReturnStatement ] } description="Returns a list of all return statements within this function's body." /> +list[ ReturnStatement ] } description="Returns a list of all return statements within this function's body." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### source @@ -186,12 +186,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -236,9 +236,26 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### add_statements Adds statements to the end of a function body. - + -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### asyncify @@ -324,7 +341,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -347,7 +364,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -355,7 +372,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Function ] } description=""/> +CodeFlag[ Function ] } description=""/> ### get_name @@ -363,7 +380,7 @@ 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."/> +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."/> ### get_parameter @@ -380,7 +397,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -397,7 +414,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -414,7 +431,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_variable_usages @@ -437,7 +454,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -528,6 +545,29 @@ Inserts text before the current symbol node in the Abstract Syntax Tree. None } description=""/> +### insert_statements +Inserts lines of code into the function body at the specified index. + + + +str } + description="The code lines to insert into the function body." + defaultValue="" +/> +int, optional } + description="The position in the function body where the lines should be inserted. Defaults to 0." + defaultValue="0" +/> + + + +None } description=""/> + + ### is_wrapped_in Check if this node is contained another node of the given class @@ -570,12 +610,12 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### prepend_statements Prepends the provided code to the beginning of the function body. - + None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### rename_local_variable Renames a local variable and all its usages within a function body. @@ -723,7 +786,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -813,36 +876,36 @@ Sets the return type annotation for the function. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/FunctionCall.mdx b/docs/api-reference/core/FunctionCall.mdx index 28dda8785..253552290 100644 --- a/docs/api-reference/core/FunctionCall.mdx +++ b/docs/api-reference/core/FunctionCall.mdx @@ -25,15 +25,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### args -Collection[ Argument , FunctionCall ] } description="Returns a list of arguments passed into the function invocation." /> +Collection[ Argument , FunctionCall ] } description="Returns a list of arguments passed into the function invocation." /> ### base -Editable | None } description="Returns the base object of this function call chain." /> +Editable | None } description="Returns the base object of this function call chain." /> ### call_chain -list[ FunctionCall ] } description="Returns a list of all function calls in this function call chain, including this call. Does not include calls made after this one." /> +list[ FunctionCall ] } description="Returns a list of all function calls in this function call chain, including this call. Does not include calls made after this one." /> ### extended @@ -62,15 +62,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this function call." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this function call." /> ### function_definition -Callable | None } description="Returns the resolved function definition that is being called." /> +Callable | None } description="Returns the resolved function definition that is being called." /> ### function_definitions -list[ Callable ] } description="Returns a list of callable objects that could potentially be the target of this function" /> +list[ Callable ] } description="Returns a list of callable objects that could potentially be the target of this function" /> ### is_awaited @@ -92,23 +92,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Retrieves the parent function of the current function call." /> +Function | None } description="Retrieves the parent function of the current function call." /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### predecessor -FunctionCall [ Editable ] | None } description="Returns the previous function call in a function call chain." /> +FunctionCall [ Editable ] | None } description="Returns the previous function call in a function call chain." /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -121,7 +121,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -131,7 +131,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### asyncify @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ FunctionCall ] } description=""/> +CodeFlag[ FunctionCall ] } description=""/> ### from_usage @@ -255,20 +255,20 @@ Creates a FunctionCall object from an Editable instance that represents a functi Editable [ Editable ] } + type={ <>Editable [ Editable ] } description="The Editable node that potentially represents a function call." defaultValue="" /> Editable | None } + type={ <>Editable | None } description="The parent node for the new FunctionCall. If None, uses the parent from the input node." defaultValue="None" /> -FunctionCall | None } description="A new FunctionCall object if the input node represents a function call, None otherwise."/> +FunctionCall | None } description="A new FunctionCall object if the input node represents a function call, None otherwise."/> ### get_arg_by_index @@ -285,7 +285,7 @@ Returns the Argument with the given index from the function call's argument list -Argument | None } description="The Argument object at the specified index, or None if the index is out of bounds."/> +Argument | None } description="The Argument object at the specified index, or None if the index is out of bounds."/> ### get_arg_by_parameter_name @@ -302,7 +302,7 @@ Returns an argument by its parameter name. -Argument | None } description="The matching argument if found, None otherwise."/> +Argument | None } description="The matching argument if found, None otherwise."/> ### get_name @@ -310,7 +310,7 @@ 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."/> +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."/> ### get_variable_usages @@ -333,7 +333,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -431,7 +431,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -555,7 +555,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_kwarg diff --git a/docs/api-reference/core/GenericType.mdx b/docs/api-reference/core/GenericType.mdx index ddfb8fea7..3d9753a23 100644 --- a/docs/api-reference/core/GenericType.mdx +++ b/docs/api-reference/core/GenericType.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -58,7 +58,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -Collection[ Type , GenericType ] } description="Retrieves the generic type parameters associated with this type." /> +Collection[ Type , GenericType ] } description="Retrieves the generic type parameters associated with this type." /> ### parent @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -160,7 +160,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -183,7 +183,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -191,7 +191,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ GenericType ] } description=""/> +CodeFlag[ GenericType ] } description=""/> ### get_name @@ -199,7 +199,7 @@ 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."/> +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."/> ### get_variable_usages @@ -222,7 +222,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -444,7 +444,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/core/HasBlock.mdx b/docs/api-reference/core/HasBlock.mdx index 0994149be..aebea95d6 100644 --- a/docs/api-reference/core/HasBlock.mdx +++ b/docs/api-reference/core/HasBlock.mdx @@ -24,11 +24,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -53,7 +53,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### is_decorated @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -129,7 +129,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -187,7 +187,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -210,7 +210,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -218,7 +218,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ HasBlock ] } description=""/> +CodeFlag[ HasBlock ] } description=""/> ### get_variable_usages @@ -241,7 +241,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -339,7 +339,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -446,7 +446,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/HasName.mdx b/docs/api-reference/core/HasName.mdx index fc73ec78d..75591050f 100644 --- a/docs/api-reference/core/HasName.mdx +++ b/docs/api-reference/core/HasName.mdx @@ -32,7 +32,7 @@ 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."/> +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."/> ### rename diff --git a/docs/api-reference/core/HasValue.mdx b/docs/api-reference/core/HasValue.mdx index 0071902b9..0f42662e9 100644 --- a/docs/api-reference/core/HasValue.mdx +++ b/docs/api-reference/core/HasValue.mdx @@ -18,7 +18,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ## Methods diff --git a/docs/api-reference/core/IfBlockStatement.mdx b/docs/api-reference/core/IfBlockStatement.mdx index 63c7eda23..57bf481b0 100644 --- a/docs/api-reference/core/IfBlockStatement.mdx +++ b/docs/api-reference/core/IfBlockStatement.mdx @@ -33,11 +33,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative_blocks -list[ IfBlockStatement ] } description="Returns a list of alternative if/elif/else blocks for the current block." /> +list[ IfBlockStatement ] } description="Returns a list of alternative if/elif/else blocks for the current block." /> ### condition -Expression [ PyIfBlockStatement ] | None } description="The condition expression for the if block. None if the block is an else block." /> +Expression [ PyIfBlockStatement ] | None } description="The condition expression for the if block. None if the block is an else block." /> ### consequence_block @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### else_statement -IfBlockStatement | None } description="Returns the else block within the if-statement." /> +IfBlockStatement | None } description="Returns the else block within the if-statement." /> ### extended @@ -70,7 +70,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the if block statement and its alternative blocks." /> +list[ FunctionCall ] } description="Returns all function calls within the if block statement and its alternative blocks." /> ### index @@ -90,11 +90,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested code blocks within an if/elif/else statement block." /> +list[ CodeBlock ] } description="Returns all nested code blocks within an if/elif/else statement block." /> ### nested_statements -list[ MultiLineCollection [ Statement [ IfBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ IfBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -108,19 +108,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -138,7 +138,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -148,7 +148,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -191,7 +191,7 @@ Returns all elif blocks within the if block. -list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> +list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> ### find @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ IfBlockStatement ] } description=""/> +CodeFlag[ IfBlockStatement ] } description=""/> ### get_variable_usages @@ -268,7 +268,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -482,7 +482,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Import.mdx b/docs/api-reference/core/Import.mdx index 3fedbf56d..9de6c6ad3 100644 --- a/docs/api-reference/core/Import.mdx +++ b/docs/api-reference/core/Import.mdx @@ -34,12 +34,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alias -Editable | None } description=" +Editable | None } description=" " /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -64,7 +64,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### from_file -SourceFile | None } description="Returns the SourceFile that an Import is importing from." /> +SourceFile | None } description="Returns the SourceFile that an Import is importing from." /> ### full_name @@ -72,7 +72,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### import_specifier @@ -89,15 +89,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### imported_exports -list[ Exportable ] } description="Returns the enumerated list of symbols imported from a module import." /> +list[ Exportable ] } description="Returns the enumerated list of symbols imported from a module import." /> ### imported_symbol -Symbol | ExternalModule | SourceFile | Import | None } description="Returns the symbol directly being imported, including an indirect import and an External" /> +Symbol | ExternalModule | SourceFile | Import | None } description="Returns the symbol directly being imported, including an indirect import and an External" /> ### module -Editable | None } description=" +Editable | None } description=" " /> ### name @@ -120,23 +120,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_symbol -Symbol | ExternalModule | SourceFile | None } description="Returns the symbol, source file, or external module that this import ultimately resolves" /> +Symbol | ExternalModule | SourceFile | None } description="Returns the symbol, source file, or external module that this import ultimately resolves" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -144,7 +144,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbol_name -Editable | None } description="The name of the symbol being imported. For instance import a as b has a symbol_name of a." /> +Editable | None } description="The name of the symbol being imported. For instance import a as b has a symbol_name of a." /> ### to_file @@ -162,7 +162,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -172,7 +172,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -230,7 +230,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -253,7 +253,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -261,7 +261,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Import ] } description=""/> +CodeFlag[ Import ] } description=""/> ### get_name @@ -269,7 +269,7 @@ 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."/> +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."/> ### get_variable_usages @@ -292,7 +292,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -430,7 +430,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -560,7 +560,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_import_module @@ -616,36 +616,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/ImportStatement.mdx b/docs/api-reference/core/ImportStatement.mdx index 38338c7fd..694e0eac7 100644 --- a/docs/api-reference/core/ImportStatement.mdx +++ b/docs/api-reference/core/ImportStatement.mdx @@ -46,11 +46,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### imports -Collection[ Import , PyImportStatement ] } description="A collection of the individual imports this statement represents" /> +Collection[ Import , PyImportStatement ] } description="A collection of the individual imports this statement represents" /> ### index @@ -58,11 +58,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ ImportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ ImportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -76,19 +76,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -106,7 +106,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -174,7 +174,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -197,7 +197,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -205,7 +205,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ImportStatement ] } description=""/> +CodeFlag[ ImportStatement ] } description=""/> ### get_variable_usages @@ -228,7 +228,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -433,7 +433,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Importable.mdx b/docs/api-reference/core/Importable.mdx index 0fac1ac0e..8597ce158 100644 --- a/docs/api-reference/core/Importable.mdx +++ b/docs/api-reference/core/Importable.mdx @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -52,7 +52,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -70,19 +70,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -163,7 +163,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -186,7 +186,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -194,7 +194,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Importable ] } description=""/> +CodeFlag[ Importable ] } description=""/> ### get_name @@ -202,7 +202,7 @@ 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."/> +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."/> ### get_variable_usages @@ -225,7 +225,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -323,7 +323,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -447,7 +447,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/core/List.mdx b/docs/api-reference/core/List.mdx index af9d3db95..47bb450e9 100644 --- a/docs/api-reference/core/List.mdx +++ b/docs/api-reference/core/List.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -58,19 +58,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -78,7 +78,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -97,7 +97,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -128,7 +128,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -151,7 +151,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -159,7 +159,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ List ] } description=""/> +CodeFlag[ List ] } description=""/> ### get_variable_usages @@ -182,7 +182,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -296,7 +296,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -314,7 +314,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -391,7 +391,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/MultiExpression.mdx b/docs/api-reference/core/MultiExpression.mdx index a1759a847..16baeb49f 100644 --- a/docs/api-reference/core/MultiExpression.mdx +++ b/docs/api-reference/core/MultiExpression.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### expressions -list[ Expression ] } description=" +list[ Expression ] } description=" " /> ### extended @@ -46,7 +46,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -60,19 +60,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -85,7 +85,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -153,7 +153,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -176,7 +176,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ MultiExpression ] } description=""/> +CodeFlag[ MultiExpression ] } description=""/> ### get_variable_usages @@ -207,7 +207,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -412,7 +412,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/MultiLineCollection.mdx b/docs/api-reference/core/MultiLineCollection.mdx index 7194928f1..5b74c37c7 100644 --- a/docs/api-reference/core/MultiLineCollection.mdx +++ b/docs/api-reference/core/MultiLineCollection.mdx @@ -45,15 +45,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -67,15 +67,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -133,7 +133,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -156,7 +156,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -164,7 +164,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ MultiLineCollection ] } description=""/> +CodeFlag[ MultiLineCollection ] } description=""/> ### get_variable_usages @@ -187,7 +187,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -319,7 +319,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -390,7 +390,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/core/Name.mdx b/docs/api-reference/core/Name.mdx index 34473b06f..b7e77a001 100644 --- a/docs/api-reference/core/Name.mdx +++ b/docs/api-reference/core/Name.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -59,19 +59,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -84,7 +84,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -94,7 +94,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -152,7 +152,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -175,7 +175,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -183,7 +183,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Name ] } description=""/> +CodeFlag[ Name ] } description=""/> ### get_variable_usages @@ -206,7 +206,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -304,7 +304,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -411,7 +411,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/NamedType.mdx b/docs/api-reference/core/NamedType.mdx index 23254994f..4b4437e23 100644 --- a/docs/api-reference/core/NamedType.mdx +++ b/docs/api-reference/core/NamedType.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -63,19 +63,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -88,7 +88,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -156,7 +156,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -179,7 +179,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -187,7 +187,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ NamedType ] } description=""/> +CodeFlag[ NamedType ] } description=""/> ### get_name @@ -195,7 +195,7 @@ 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."/> +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."/> ### get_variable_usages @@ -218,7 +218,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -316,7 +316,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -440,7 +440,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/core/NoneType.mdx b/docs/api-reference/core/NoneType.mdx index 4e8b9e370..96aff9d53 100644 --- a/docs/api-reference/core/NoneType.mdx +++ b/docs/api-reference/core/NoneType.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -55,19 +55,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -80,7 +80,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -90,7 +90,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -148,7 +148,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -171,7 +171,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -179,7 +179,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ NoneType ] } description=""/> +CodeFlag[ NoneType ] } description=""/> ### get_variable_usages @@ -202,7 +202,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -300,7 +300,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -407,7 +407,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Number.mdx b/docs/api-reference/core/Number.mdx index f388c002b..eff71564f 100644 --- a/docs/api-reference/core/Number.mdx +++ b/docs/api-reference/core/Number.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -58,19 +58,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -93,7 +93,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -151,7 +151,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -174,7 +174,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -182,7 +182,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Number ] } description=""/> +CodeFlag[ Number ] } description=""/> ### get_variable_usages @@ -205,7 +205,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -303,7 +303,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -410,7 +410,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Pair.mdx b/docs/api-reference/core/Pair.mdx index 5f2054ca7..9bd08fd04 100644 --- a/docs/api-reference/core/Pair.mdx +++ b/docs/api-reference/core/Pair.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### key @@ -64,15 +64,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -85,11 +85,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -157,7 +157,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -180,7 +180,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -188,7 +188,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Pair ] } description=""/> +CodeFlag[ Pair ] } description=""/> ### get_variable_usages @@ -211,7 +211,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -416,7 +416,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/core/Parameter.mdx b/docs/api-reference/core/Parameter.mdx index cb7157107..8814ca33e 100644 --- a/docs/api-reference/core/Parameter.mdx +++ b/docs/api-reference/core/Parameter.mdx @@ -14,7 +14,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### 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) +[HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) ## Attributes @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -53,7 +53,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -87,19 +87,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -112,15 +112,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -130,7 +130,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -188,7 +188,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -211,7 +211,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -219,7 +219,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Parameter ] } description=""/> +CodeFlag[ Parameter ] } description=""/> ### get_name @@ -227,7 +227,7 @@ 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."/> +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."/> ### get_variable_usages @@ -250,7 +250,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -348,7 +348,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -478,7 +478,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -534,36 +534,36 @@ Sets the value of the node's value Expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/ParenthesizedExpression.mdx b/docs/api-reference/core/ParenthesizedExpression.mdx index 19d1b7749..1bf56d1f2 100644 --- a/docs/api-reference/core/ParenthesizedExpression.mdx +++ b/docs/api-reference/core/ParenthesizedExpression.mdx @@ -47,7 +47,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Retrieves a list of function calls within a parenthesized expression." /> +list[ FunctionCall ] } description="Retrieves a list of function calls within a parenthesized expression." /> ### node_type @@ -61,19 +61,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -86,11 +86,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -100,7 +100,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -158,7 +158,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -181,7 +181,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -189,7 +189,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ParenthesizedExpression ] } description=""/> +CodeFlag[ ParenthesizedExpression ] } description=""/> ### get_variable_usages @@ -212,7 +212,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -440,7 +440,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value @@ -460,4 +460,21 @@ Sets the value of the node's value Expression. None } description=""/> +### unwrap +Removes the parentheses from a parenthesized expression node. + + + +Expression | None, optional } + description="The node to unwrap. Defaults to None." + defaultValue="None" +/> + + + +None } description=""/> + + diff --git a/docs/api-reference/core/PlaceholderType.mdx b/docs/api-reference/core/PlaceholderType.mdx index 5d9a5bcf5..ed823a215 100644 --- a/docs/api-reference/core/PlaceholderType.mdx +++ b/docs/api-reference/core/PlaceholderType.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -55,19 +55,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -80,7 +80,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -90,7 +90,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -148,7 +148,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -171,7 +171,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -179,7 +179,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PlaceholderType ] } description=""/> +CodeFlag[ PlaceholderType ] } description=""/> ### get_variable_usages @@ -202,7 +202,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -300,7 +300,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -407,7 +407,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/RaiseStatement.mdx b/docs/api-reference/core/RaiseStatement.mdx index 149c92607..5aa38058a 100644 --- a/docs/api-reference/core/RaiseStatement.mdx +++ b/docs/api-reference/core/RaiseStatement.mdx @@ -47,7 +47,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets function calls within a raise statement's value expression." /> +list[ FunctionCall ] } description="Gets function calls within a raise statement's value expression." /> ### index @@ -55,11 +55,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ RaiseStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ RaiseStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -73,19 +73,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -103,11 +103,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -117,7 +117,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -175,7 +175,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -198,7 +198,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -206,7 +206,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ RaiseStatement ] } description=""/> +CodeFlag[ RaiseStatement ] } description=""/> ### get_variable_usages @@ -229,7 +229,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -327,7 +327,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -434,7 +434,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/core/ReturnStatement.mdx b/docs/api-reference/core/ReturnStatement.mdx index 5699c50ba..6791085e6 100644 --- a/docs/api-reference/core/ReturnStatement.mdx +++ b/docs/api-reference/core/ReturnStatement.mdx @@ -50,7 +50,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of function calls contained within this return statement." /> +list[ FunctionCall ] } description="Returns a list of function calls contained within this return statement." /> ### index @@ -58,11 +58,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ ReturnStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ ReturnStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -76,19 +76,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -106,11 +106,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ ReturnStatement ] } description=""/> +CodeFlag[ ReturnStatement ] } description=""/> ### get_variable_usages @@ -232,7 +232,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -330,7 +330,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/core/SourceFile.mdx b/docs/api-reference/core/SourceFile.mdx index 82c4fdf79..c4543ec20 100644 --- a/docs/api-reference/core/SourceFile.mdx +++ b/docs/api-reference/core/SourceFile.mdx @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### classes -list[ Class ] } description="Returns all Classes in the file." /> +list[ Class ] } description="Returns all Classes in the file." /> ### code_block @@ -37,19 +37,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### directory -Directory | None } description="Returns the directory that contains this file." /> +Directory | None } description="Returns the directory that contains this file." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -87,15 +87,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### functions -list[ Function ] } description="Returns all Functions in the file." /> +list[ Function ] } description="Returns all Functions in the file." /> ### global_vars -list[ Assignment ] } description="Returns all GlobalVars in the file." /> +list[ Assignment ] } description="Returns all GlobalVars in the file." /> ### import_module_name @@ -103,19 +103,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### import_statements -list[ ImportStatement ] } description="Returns all ImportStatements in the file, where each import statement can contain" /> +list[ ImportStatement ] } description="Returns all ImportStatements in the file, where each import statement can contain" /> ### importers -list[ Import ] } description="Returns all imports that directly imports this file as a module." /> +list[ Import ] } description="Returns all imports that directly imports this file as a module." /> ### imports -list[ Import ] } description="List of all Imports in this file." /> +list[ Import ] } description="List of all Imports in this file." /> ### inbound_imports -list[ Import ] } description="Returns all imports that are importing symbols contained in this file." /> +list[ Import ] } description="Returns all imports that are importing symbols contained in this file." /> ### is_binary @@ -145,15 +145,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### path @@ -162,7 +162,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -174,7 +174,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols_sorted_topologically -list[ Symbol ] } description="Returns all Symbols in the file, sorted topologically (parents first). Robust to" /> +list[ Symbol ] } description="Returns all Symbols in the file, sorted topologically (parents first). Robust to" /> ### ts_node @@ -183,7 +183,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -228,6 +228,29 @@ Adds import to the file from a string representation of an import statement. None } description=""/> +### add_symbol +Adds `symbol` to the file. + + + +Symbol } + description="The symbol to add to the file." + defaultValue="" +/> +bool, optional } + description="Whether to export the symbol. Defaults to True." + defaultValue="True" +/> + + + +Symbol | None } description="The existing symbol if it already exists in the file or None if it was added."/> + + ### add_symbol_from_source Adds a symbol to a file from a string representation. @@ -245,12 +268,47 @@ Adds a symbol to a file from a string representation. None } description="The symbol is added directly to the file's content."/> +### add_symbol_import +Adds an import to a file for a given symbol. + + + +Symbol } + description="The symbol to import." + defaultValue="" +/> +str | None } + description="Optional alias for the imported symbol. Defaults to None." + defaultValue="None" +/> +ImportType } + description="The type of import to use. Defaults to ImportType.UNKNOWN." + defaultValue="ImportType.UNKNOWN" +/> +bool } + description="Whether this is a type-only import. Defaults to False." + defaultValue="False" +/> + + + +Import | None } description="The existing import for the symbol or None if it was added."/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -308,7 +366,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_by_byte_range @@ -325,7 +383,7 @@ Finds all editable objects that overlap with the given byte range in the file. -list[ Editable ] } description="A list of all Editable objects that overlap with the given range."/> +list[ Editable ] } description="A list of all Editable objects that overlap with the given range."/> ### find_string_literals @@ -348,7 +406,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -356,7 +414,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ SourceFile ] } description=""/> +CodeFlag[ SourceFile ] } description=""/> ### get_class @@ -373,7 +431,7 @@ Returns a specific Class by full name. Returns None if not found. -Class | None } description="The matching Class object if found, None otherwise."/> +Class | None } description="The matching Class object if found, None otherwise."/> ### get_function @@ -390,7 +448,7 @@ Returns a specific Function by name. -Function | None } description="The matching Function object if found, None otherwise."/> +Function | None } description="The matching Function object if found, None otherwise."/> ### get_global_var @@ -407,7 +465,7 @@ Returns a specific global var by name. Returns None if not found. -Assignment | None } description="The global variable if found, None otherwise."/> +Assignment | None } description="The global variable if found, None otherwise."/> ### get_import @@ -424,7 +482,7 @@ Returns the import with matching alias. Returns None if not found. -Import | None } description="The import statement with the matching alias if found, None otherwise."/> +Import | None } description="The import statement with the matching alias if found, None otherwise."/> ### get_name @@ -432,7 +490,7 @@ 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."/> +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."/> ### get_symbol @@ -449,7 +507,7 @@ Gets a symbol by its name from the file. -Symbol | None } description="The found symbol, or None if not found."/> +Symbol | None } description="The found symbol, or None if not found."/> ### get_variable_usages @@ -472,7 +530,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### has_import @@ -587,7 +645,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -606,6 +664,37 @@ Removes the file from the file system and graph. None } description=""/> +### remove_unused_exports +Removes unused exports from the file. + + + +None } description=""/> + + +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -673,7 +762,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring @@ -729,19 +818,19 @@ Checks if the file type supports adding the given symbol. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### symbols @@ -749,7 +838,7 @@ 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"/> +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"/> ### update_filepath @@ -771,19 +860,19 @@ Renames the file and updates all imports to point to the new location. ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/Statement.mdx b/docs/api-reference/core/Statement.mdx index 92c6de578..e1731c449 100644 --- a/docs/api-reference/core/Statement.mdx +++ b/docs/api-reference/core/Statement.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -49,11 +49,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ Statement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ Statement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -165,7 +165,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -188,7 +188,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Statement ] } description=""/> +CodeFlag[ Statement ] } description=""/> ### get_variable_usages @@ -219,7 +219,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/String.mdx b/docs/api-reference/core/String.mdx index 80c552eca..524a4eb69 100644 --- a/docs/api-reference/core/String.mdx +++ b/docs/api-reference/core/String.mdx @@ -29,12 +29,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### content_nodes -Collection[ Expression [ Editable ], PyString ] } description=" +Collection[ Expression [ Editable ], PyString ] } description=" " /> ### expressions -list[ Expression [ Editable ]] } description="embedded expressions in the string, only applicable for templated or formatted strings" /> +list[ Expression [ Editable ]] } description="embedded expressions in the string, only applicable for templated or formatted strings" /> ### extended @@ -59,7 +59,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -73,19 +73,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -98,7 +98,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ### with_quotes @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -170,7 +170,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -193,7 +193,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -201,7 +201,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ String ] } description=""/> +CodeFlag[ String ] } description=""/> ### get_variable_usages @@ -224,7 +224,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -429,7 +429,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/SubscriptExpression.mdx b/docs/api-reference/core/SubscriptExpression.mdx index da2c6bb46..024ffdc3a 100644 --- a/docs/api-reference/core/SubscriptExpression.mdx +++ b/docs/api-reference/core/SubscriptExpression.mdx @@ -45,11 +45,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### indices -list[ Expression ] } description=" +list[ Expression ] } description=" " /> ### node_type @@ -69,19 +69,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -104,7 +104,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -162,7 +162,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -185,7 +185,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -193,7 +193,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ SubscriptExpression ] } description=""/> +CodeFlag[ SubscriptExpression ] } description=""/> ### get_variable_usages @@ -216,7 +216,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -314,7 +314,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -421,7 +421,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/SwitchCase.mdx b/docs/api-reference/core/SwitchCase.mdx index de36320fb..dc762de5a 100644 --- a/docs/api-reference/core/SwitchCase.mdx +++ b/docs/api-reference/core/SwitchCase.mdx @@ -25,20 +25,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ PyMatchCase ] | None } description="The condition which triggers this case" /> +Expression [ PyMatchCase ] | None } description="The condition which triggers this case" /> ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -63,7 +63,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -75,11 +75,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ SwitchCase ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ SwitchCase ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -93,19 +93,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ SwitchCase ] } description=""/> +CodeFlag[ SwitchCase ] } description=""/> ### get_variable_usages @@ -268,7 +268,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -473,7 +473,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/SwitchStatement.mdx b/docs/api-reference/core/SwitchStatement.mdx index 44d1aa80d..4b9e9cd32 100644 --- a/docs/api-reference/core/SwitchStatement.mdx +++ b/docs/api-reference/core/SwitchStatement.mdx @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### cases -list[ SwitchCase ] } description=" +list[ SwitchCase ] } description=" " /> ### extended @@ -50,7 +50,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the switch statement." /> +list[ FunctionCall ] } description="Returns all function calls within the switch statement." /> ### index @@ -58,11 +58,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the switch statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the switch statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ SwitchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ SwitchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -76,19 +76,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -106,11 +106,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression [ PyMatchStatement ] } description="The value to switch on" /> +Expression [ PyMatchStatement ] } description="The value to switch on" /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ SwitchStatement ] } description=""/> +CodeFlag[ SwitchStatement ] } description=""/> ### get_variable_usages @@ -232,7 +232,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -330,7 +330,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/Symbol.mdx b/docs/api-reference/core/Symbol.mdx index 189b14419..07c3b1f26 100644 --- a/docs/api-reference/core/Symbol.mdx +++ b/docs/api-reference/core/Symbol.mdx @@ -23,11 +23,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -35,7 +35,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -60,11 +60,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### inline_comment -CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> ### name @@ -82,19 +82,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -112,7 +112,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -134,12 +134,29 @@ Adds a comment to the symbol. None } description=""/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -197,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -220,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -228,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Symbol ] } description=""/> +CodeFlag[ Symbol ] } description=""/> ### get_name @@ -236,7 +253,7 @@ 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."/> +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."/> ### get_variable_usages @@ -259,7 +276,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -392,7 +409,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -432,6 +449,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -499,7 +539,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -555,36 +595,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/SymbolGroup.mdx b/docs/api-reference/core/SymbolGroup.mdx index 5abfa0274..1a0ed0258 100644 --- a/docs/api-reference/core/SymbolGroup.mdx +++ b/docs/api-reference/core/SymbolGroup.mdx @@ -43,15 +43,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -65,15 +65,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -81,7 +81,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -90,7 +90,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -100,7 +100,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -158,7 +158,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -181,7 +181,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -189,7 +189,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ SymbolGroup ] } description=""/> +CodeFlag[ SymbolGroup ] } description=""/> ### get_variable_usages @@ -212,7 +212,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -411,7 +411,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/core/SymbolStatement.mdx b/docs/api-reference/core/SymbolStatement.mdx index 05ce0ff6b..d5d81bf40 100644 --- a/docs/api-reference/core/SymbolStatement.mdx +++ b/docs/api-reference/core/SymbolStatement.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls contained within the symbol associated with this statement." /> +list[ FunctionCall ] } description="Returns all function calls contained within the symbol associated with this statement." /> ### index @@ -53,11 +53,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ SymbolStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ SymbolStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -106,7 +106,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -174,7 +174,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -197,7 +197,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -205,7 +205,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ SymbolStatement ] } description=""/> +CodeFlag[ SymbolStatement ] } description=""/> ### get_variable_usages @@ -228,7 +228,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -433,7 +433,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/TernaryExpression.mdx b/docs/api-reference/core/TernaryExpression.mdx index ea4354e53..265b1efb0 100644 --- a/docs/api-reference/core/TernaryExpression.mdx +++ b/docs/api-reference/core/TernaryExpression.mdx @@ -20,17 +20,17 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### condition -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### consequence -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### extended @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -70,19 +70,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -163,7 +163,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -186,7 +186,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -194,7 +194,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TernaryExpression ] } description=""/> +CodeFlag[ TernaryExpression ] } description=""/> ### get_variable_usages @@ -217,7 +217,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -315,7 +315,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -331,7 +331,7 @@ Simplifies a ternary expression based on a boolean condition. /> Editable | None, optional } + type={ <>Editable | None, optional } description="The node to be edited. Defaults to None." defaultValue="None" /> @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/TryCatchStatement.mdx b/docs/api-reference/core/TryCatchStatement.mdx index 8524b3ce4..58b361a17 100644 --- a/docs/api-reference/core/TryCatchStatement.mdx +++ b/docs/api-reference/core/TryCatchStatement.mdx @@ -29,11 +29,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -58,11 +58,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### finalizer -BlockStatement | None } description="The code block executed regardless of if an exception is thrown or not" /> +BlockStatement | None } description="The code block executed regardless of if an exception is thrown or not" /> ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### index @@ -74,11 +74,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TryCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TryCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -92,19 +92,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -122,7 +122,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -155,7 +155,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -213,7 +213,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -236,7 +236,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -244,7 +244,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TryCatchStatement ] } description=""/> +CodeFlag[ TryCatchStatement ] } description=""/> ### get_variable_usages @@ -267,7 +267,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -365,7 +365,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -472,7 +472,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/Tuple.mdx b/docs/api-reference/core/Tuple.mdx index deee0588d..99708bde0 100644 --- a/docs/api-reference/core/Tuple.mdx +++ b/docs/api-reference/core/Tuple.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -58,19 +58,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -78,7 +78,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -97,7 +97,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -128,7 +128,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -151,7 +151,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -159,7 +159,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Tuple ] } description=""/> +CodeFlag[ Tuple ] } description=""/> ### get_variable_usages @@ -182,7 +182,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -296,7 +296,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -314,7 +314,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -391,7 +391,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/TupleType.mdx b/docs/api-reference/core/TupleType.mdx index 624cd0f2c..c60e09954 100644 --- a/docs/api-reference/core/TupleType.mdx +++ b/docs/api-reference/core/TupleType.mdx @@ -43,15 +43,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -65,19 +65,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -85,7 +85,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -104,7 +104,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -135,7 +135,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -158,7 +158,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -166,7 +166,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TupleType ] } description=""/> +CodeFlag[ TupleType ] } description=""/> ### get_variable_usages @@ -189,7 +189,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -303,7 +303,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -321,7 +321,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -392,7 +392,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/core/Type.mdx b/docs/api-reference/core/Type.mdx index 7c3b032ae..46d42e47c 100644 --- a/docs/api-reference/core/Type.mdx +++ b/docs/api-reference/core/Type.mdx @@ -43,7 +43,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -57,19 +57,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -82,7 +82,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -92,7 +92,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -150,7 +150,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -173,7 +173,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -181,7 +181,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Type ] } description=""/> +CodeFlag[ Type ] } description=""/> ### get_variable_usages @@ -204,7 +204,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -302,7 +302,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -409,7 +409,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/TypeAlias.mdx b/docs/api-reference/core/TypeAlias.mdx index e4a999f53..46839f265 100644 --- a/docs/api-reference/core/TypeAlias.mdx +++ b/docs/api-reference/core/TypeAlias.mdx @@ -23,7 +23,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### attributes -list[ Attribute ] } description="List of expressions defined in this Type object." /> +list[ Attribute ] } description="List of expressions defined in this Type object." /> ### code_block @@ -32,19 +32,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the comment group associated with the symbol, if any." /> ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -52,7 +52,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -77,11 +77,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### inline_comment -CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> +CommentGroup | None } description="Returns the inline comment group associated with the symbol, if any." /> ### is_decorated @@ -103,19 +103,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -133,16 +133,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -187,12 +187,29 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -250,7 +267,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -273,7 +290,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -281,7 +298,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TypeAlias ] } description=""/> +CodeFlag[ TypeAlias ] } description=""/> ### get_attribute @@ -289,7 +306,7 @@ Get attribute by name. -Attribute | None } description=""/> +Attribute | None } description=""/> ### get_name @@ -297,7 +314,7 @@ 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."/> +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."/> ### get_variable_usages @@ -320,7 +337,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -453,7 +470,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -493,6 +510,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -560,7 +600,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -650,36 +690,36 @@ Sets the value of the node's value Expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/Typeable.mdx b/docs/api-reference/core/Typeable.mdx index 6a93fda67..cd1e30c1f 100644 --- a/docs/api-reference/core/Typeable.mdx +++ b/docs/api-reference/core/Typeable.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### is_typed @@ -63,15 +63,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -84,11 +84,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -156,7 +156,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -179,7 +179,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -187,7 +187,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Typeable ] } description=""/> +CodeFlag[ Typeable ] } description=""/> ### get_variable_usages @@ -210,7 +210,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -415,7 +415,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/UnaryExpression.mdx b/docs/api-reference/core/UnaryExpression.mdx index bc3c6bafa..6fcc14cec 100644 --- a/docs/api-reference/core/UnaryExpression.mdx +++ b/docs/api-reference/core/UnaryExpression.mdx @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### argument -Expression [ UnaryExpression ] } description="The argument of the unary expression" /> +Expression [ UnaryExpression ] } description="The argument of the unary expression" /> ### extended @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -63,19 +63,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -88,7 +88,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -98,7 +98,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -156,7 +156,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -179,7 +179,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -187,7 +187,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ UnaryExpression ] } description=""/> +CodeFlag[ UnaryExpression ] } description=""/> ### get_variable_usages @@ -210,7 +210,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -308,7 +308,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/UnionType.mdx b/docs/api-reference/core/UnionType.mdx index 9836f6060..cbaba00b1 100644 --- a/docs/api-reference/core/UnionType.mdx +++ b/docs/api-reference/core/UnionType.mdx @@ -43,15 +43,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -65,19 +65,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -85,7 +85,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -104,7 +104,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -135,7 +135,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -158,7 +158,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -166,7 +166,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ UnionType ] } description=""/> +CodeFlag[ UnionType ] } description=""/> ### get_variable_usages @@ -189,7 +189,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -303,7 +303,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -321,7 +321,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -392,7 +392,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/core/Unpack.mdx b/docs/api-reference/core/Unpack.mdx index 3f794b4cd..af1ca970c 100644 --- a/docs/api-reference/core/Unpack.mdx +++ b/docs/api-reference/core/Unpack.mdx @@ -47,7 +47,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -61,19 +61,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -86,11 +86,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -100,7 +100,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -158,7 +158,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -181,7 +181,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -189,7 +189,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Unpack ] } description=""/> +CodeFlag[ Unpack ] } description=""/> ### get_variable_usages @@ -212,7 +212,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -310,7 +310,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -425,7 +425,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value @@ -445,4 +445,21 @@ Sets the value of the node's value Expression. None } description=""/> +### unwrap +Unwraps a node's content into its parent node. + + + +Expression | None } + description="The node to unwrap. If None, uses the instance's value node." + defaultValue="None" +/> + + + +None } description=""/> + + diff --git a/docs/api-reference/core/Unwrappable.mdx b/docs/api-reference/core/Unwrappable.mdx index 000306291..a5a00b9e9 100644 --- a/docs/api-reference/core/Unwrappable.mdx +++ b/docs/api-reference/core/Unwrappable.mdx @@ -43,7 +43,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -57,19 +57,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -82,7 +82,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -92,7 +92,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -150,7 +150,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -173,7 +173,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -181,7 +181,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Unwrappable ] } description=""/> +CodeFlag[ Unwrappable ] } description=""/> ### get_variable_usages @@ -204,7 +204,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -302,7 +302,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -409,7 +409,15 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> + + +### unwrap +Unwrap this expression, removing parenthesis and other syntax elements while maintaining the function of the code. + + + +None } description=""/> diff --git a/docs/api-reference/core/Usable.mdx b/docs/api-reference/core/Usable.mdx index cfd0e6e2a..6c5256fba 100644 --- a/docs/api-reference/core/Usable.mdx +++ b/docs/api-reference/core/Usable.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 [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -160,7 +160,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -183,7 +183,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -191,7 +191,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Usable ] } description=""/> +CodeFlag[ Usable ] } description=""/> ### get_name @@ -199,7 +199,7 @@ 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."/> +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."/> ### get_variable_usages @@ -222,7 +222,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -360,6 +360,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -427,7 +450,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -449,36 +472,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/core/Usage.mdx b/docs/api-reference/core/Usage.mdx index 8e91e6cb8..915de80d4 100644 --- a/docs/api-reference/core/Usage.mdx +++ b/docs/api-reference/core/Usage.mdx @@ -25,7 +25,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### imported_by -Import | None } description=" +Import | None } description=" " /> ### kind @@ -34,11 +34,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### match -Name | ChainedAttribute | FunctionCall } description="The exact match of the usage" /> +Name | ChainedAttribute | FunctionCall } description="The exact match of the usage" /> ### usage_symbol -Import | Symbol | Export | SourceFile } description="The symbol this object is used in" /> +Import | Symbol | Export | SourceFile } description="The symbol this object is used in" /> ### usage_type diff --git a/docs/api-reference/core/Value.mdx b/docs/api-reference/core/Value.mdx index 2794e37a1..d87ce0c3f 100644 --- a/docs/api-reference/core/Value.mdx +++ b/docs/api-reference/core/Value.mdx @@ -46,7 +46,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -60,19 +60,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -85,7 +85,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -153,7 +153,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -176,7 +176,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ Value ] } description=""/> +CodeFlag[ Value ] } description=""/> ### get_variable_usages @@ -207,7 +207,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -412,7 +412,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/core/WhileStatement.mdx b/docs/api-reference/core/WhileStatement.mdx index 249e14caf..18a6b1ce7 100644 --- a/docs/api-reference/core/WhileStatement.mdx +++ b/docs/api-reference/core/WhileStatement.mdx @@ -25,15 +25,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### condition -Expression [ TSWhileStatement ] } description="The condition expression of the while loop." /> +Expression [ TSWhileStatement ] } description="The condition expression of the while loop." /> ### decorators -list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> +list[ Decorator ] } description="Returns list of all decorators on this Symbol." /> ### docstring -CommentGroup | None } description="Retrieves the docstring of the expression." /> +CommentGroup | None } description="Retrieves the docstring of the expression." /> ### extended @@ -58,7 +58,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the while statement block." /> +list[ FunctionCall ] } description="Returns all function calls within the while statement block." /> ### index @@ -70,11 +70,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ WhileStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ WhileStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -88,19 +88,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -118,7 +118,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -151,7 +151,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -209,7 +209,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -232,7 +232,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -240,7 +240,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ WhileStatement ] } description=""/> +CodeFlag[ WhileStatement ] } description=""/> ### get_variable_usages @@ -263,7 +263,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -361,7 +361,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -468,7 +468,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/core/WithStatement.mdx b/docs/api-reference/core/WithStatement.mdx index 892cecaf4..4e0ca3590 100644 --- a/docs/api-reference/core/WithStatement.mdx +++ b/docs/api-reference/core/WithStatement.mdx @@ -41,15 +41,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -PyCodeBlock [ WithStatement ] } description="(PyCodeBlock) the code block of the with statement" /> +PyCodeBlock [ WithStatement ] } description="(PyCodeBlock) the code block of the with statement" /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -74,7 +74,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls in the code block and within the with clause." /> +list[ FunctionCall ] } description="Returns all function calls in the code block and within the with clause." /> ### index @@ -86,11 +86,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ PyCodeBlock ] } description="Returns all nested code blocks within the statement." /> +list[ PyCodeBlock ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ WithStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ WithStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -104,19 +104,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -134,7 +134,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -167,7 +167,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -225,7 +225,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -248,7 +248,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -256,7 +256,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ WithStatement ] } description=""/> +CodeFlag[ WithStatement ] } description=""/> ### get_variable_usages @@ -279,7 +279,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -377,7 +377,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -484,7 +484,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyAssignment.mdx b/docs/api-reference/python/PyAssignment.mdx index 5b807703c..85ca91d8e 100644 --- a/docs/api-reference/python/PyAssignment.mdx +++ b/docs/api-reference/python/PyAssignment.mdx @@ -23,11 +23,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -PyCommentGroup | None } description="Returns the comment group associated with the symbol." /> +PyCommentGroup | None } description="Returns the comment group associated with the symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -35,7 +35,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -60,7 +60,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -68,7 +68,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -PyCommentGroup | None } description="A property that retrieves the inline comment group associated with a symbol." /> +PyCommentGroup | None } description="A property that retrieves the inline comment group associated with a symbol." /> ### is_exported @@ -98,19 +98,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -128,15 +128,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -176,12 +176,29 @@ Adds a new comment to the symbol. None } description=""/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -239,7 +256,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -262,7 +279,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -270,7 +287,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyAssignment ] } description=""/> +CodeFlag[ PyAssignment ] } description=""/> ### from_named_expression @@ -305,7 +322,7 @@ Creates a MultiExpression from a Python named expression. -MultiExpression [ PyAssignmentStatement , PyAssignment ] } description="A MultiExpression containing the assignments created from the named expression."/> +MultiExpression [ PyAssignmentStatement , PyAssignment ] } description="A MultiExpression containing the assignments created from the named expression."/> ### get_import_string @@ -348,7 +365,7 @@ 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."/> +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."/> ### get_variable_usages @@ -371,7 +388,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -475,7 +492,7 @@ 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."/> +list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> ### move_to_file @@ -512,7 +529,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -561,6 +578,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -628,7 +668,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -656,7 +696,7 @@ Sets a comment for the Python symbol. /> PyCommentType , optional } + type={ <>PyCommentType , optional } description="Type of comment to add (e.g., single line," defaultValue="PyCommentType.SINGLE_LINE" /> @@ -748,36 +788,36 @@ Sets the value of an assignment expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyAssignmentStatement.mdx b/docs/api-reference/python/PyAssignmentStatement.mdx index dcfe6b072..9de875430 100644 --- a/docs/api-reference/python/PyAssignmentStatement.mdx +++ b/docs/api-reference/python/PyAssignmentStatement.mdx @@ -30,7 +30,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignments -list[ Assignment ] } description=" +list[ Assignment ] } description=" " /> ### extended @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -64,16 +64,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### left -Expression [ Assignment ] } description=" +Expression [ Assignment ] } description=" " /> ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyAssignmentStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyAssignmentStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -87,23 +87,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ Assignment ] | None } description=" +Expression [ Assignment ] | None } description=" " /> ### source @@ -122,11 +122,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -194,7 +194,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -217,7 +217,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -225,7 +225,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyAssignmentStatement ] } description=""/> +CodeFlag[ PyAssignmentStatement ] } description=""/> ### from_assignment @@ -301,7 +301,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -399,7 +399,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -506,7 +506,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/python/PyAttribute.mdx b/docs/api-reference/python/PyAttribute.mdx index bf26c5dae..8de2518e5 100644 --- a/docs/api-reference/python/PyAttribute.mdx +++ b/docs/api-reference/python/PyAttribute.mdx @@ -30,12 +30,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignments -list[ Assignment ] } description=" +list[ Assignment ] } description=" " /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -64,7 +64,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -80,7 +80,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### left -Expression [ Assignment ] } description=" +Expression [ Assignment ] } description=" " /> ### name @@ -89,11 +89,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyAttribute ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyAttribute ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -107,23 +107,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ Assignment ] | None } description=" +Expression [ Assignment ] | None } description=" " /> ### source @@ -142,11 +142,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyAttribute ] } description=""/> +CodeFlag[ PyAttribute ] } description=""/> ### from_assignment @@ -306,7 +306,7 @@ 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."/> +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."/> ### get_variable_usages @@ -329,7 +329,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -427,7 +427,7 @@ 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."/> +list[ Editable [ PyAttribute ]] } description="A sorted list of unique attribute references. Each reference is an Editable object representing a usage of this attribute."/> ### parent_of_type @@ -435,7 +435,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -475,6 +475,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -542,7 +565,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -581,36 +604,36 @@ Sets the value of a node's assignment. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyBlockStatement.mdx b/docs/api-reference/python/PyBlockStatement.mdx index 458a4064b..82e539035 100644 --- a/docs/api-reference/python/PyBlockStatement.mdx +++ b/docs/api-reference/python/PyBlockStatement.mdx @@ -20,16 +20,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -54,7 +54,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -66,11 +66,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -84,19 +84,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -114,7 +114,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -147,7 +147,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -205,7 +205,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -228,7 +228,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -236,7 +236,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyBlockStatement ] } description=""/> +CodeFlag[ PyBlockStatement ] } description=""/> ### get_variable_usages @@ -259,7 +259,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -357,7 +357,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -464,7 +464,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyBreakStatement.mdx b/docs/api-reference/python/PyBreakStatement.mdx index 825e91c30..d3f35e1da 100644 --- a/docs/api-reference/python/PyBreakStatement.mdx +++ b/docs/api-reference/python/PyBreakStatement.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -49,11 +49,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyBreakStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyBreakStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -165,7 +165,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -188,7 +188,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyBreakStatement ] } description=""/> +CodeFlag[ PyBreakStatement ] } description=""/> ### get_variable_usages @@ -219,7 +219,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyCatchStatement.mdx b/docs/api-reference/python/PyCatchStatement.mdx index 748755607..68d8f15c8 100644 --- a/docs/api-reference/python/PyCatchStatement.mdx +++ b/docs/api-reference/python/PyCatchStatement.mdx @@ -25,20 +25,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ PyCatchStatement ] | None } description="The condition which triggers this clause" /> +Expression [ PyCatchStatement ] | None } description="The condition which triggers this clause" /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -63,7 +63,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -75,11 +75,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -93,19 +93,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyCatchStatement ] } description=""/> +CodeFlag[ PyCatchStatement ] } description=""/> ### get_variable_usages @@ -268,7 +268,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -473,7 +473,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyChainedAttribute.mdx b/docs/api-reference/python/PyChainedAttribute.mdx index c74707a71..4e42143dd 100644 --- a/docs/api-reference/python/PyChainedAttribute.mdx +++ b/docs/api-reference/python/PyChainedAttribute.mdx @@ -51,7 +51,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -69,19 +69,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -104,7 +104,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -162,7 +162,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -185,7 +185,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -193,7 +193,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyChainedAttribute ] } description=""/> +CodeFlag[ PyChainedAttribute ] } description=""/> ### get_variable_usages @@ -216,7 +216,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -314,7 +314,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -421,7 +421,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyClass.mdx b/docs/api-reference/python/PyClass.mdx index d2c26a5a4..eff06aae3 100644 --- a/docs/api-reference/python/PyClass.mdx +++ b/docs/api-reference/python/PyClass.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### code_block @@ -28,11 +28,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -PyCommentGroup | None } description="Retrieves the comment group associated with a Python symbol." /> +PyCommentGroup | None } description="Retrieves the comment group associated with a Python symbol." /> ### constructor -Function | None } description="Returns the constructor method for this class." /> +Function | None } description="Returns the constructor method for this class." /> ### constructor_keyword @@ -41,15 +41,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -57,7 +57,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -82,11 +82,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### inline_comment -PyCommentGroup | None } description="Returns the inline comment group associated with this symbol." /> +PyCommentGroup | None } description="Returns the inline comment group associated with this symbol." /> ### is_decorated @@ -106,7 +106,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_classes -list[ PyClass ] } description="Retrieves the nested classes defined within this class." /> +list[ PyClass ] } description="Retrieves the nested classes defined within this class." /> ### node_type @@ -115,7 +115,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , PyClass ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , PyClass ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -124,32 +124,32 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_class_names -list[ Name | ChainedAttribute ] } description="Returns a list of the parent class names that this class inherits from." /> +list[ Name | ChainedAttribute ] } description="Returns a list of the parent class names that this class inherits from." /> ### parent_classes -Parents[ Type , PyClass ] | None } description=" +Parents[ Type , PyClass ] | None } description=" " /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### source @@ -168,12 +168,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -276,6 +276,23 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### add_source Adds source code to the class definition. @@ -298,7 +315,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### attributes @@ -321,7 +338,7 @@ Retrieves all attributes from this Class including those from its superclasses u -list[ Attribute ] } description="A list of unique attributes from this class and its superclasses. If an attribute is defined in multiple classes, the first definition encountered is used."/> +list[ Attribute ] } description="A list of unique attributes from this class and its superclasses. If an attribute is defined in multiple classes, the first definition encountered is used."/> ### edit @@ -379,7 +396,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -402,7 +419,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -410,7 +427,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyClass ] } description=""/> +CodeFlag[ PyClass ] } description=""/> ### get_attribute @@ -427,7 +444,7 @@ Returns a specific attribute by name. -Attribute | None } description="The matching attribute if found, None otherwise. If multiple attributes with the same name exist in the inheritance hierarchy, returns the first one found."/> +Attribute | None } description="The matching attribute if found, None otherwise. If multiple attributes with the same name exist in the inheritance hierarchy, returns the first one found."/> ### get_import_string @@ -479,7 +496,7 @@ Returns a specific method by name from the class or any of its superclasses. -Function | None } description="The method if found, None otherwise."/> +Function | None } description="The method if found, None otherwise."/> ### get_name @@ -487,7 +504,7 @@ 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."/> +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."/> ### get_nested_class @@ -504,7 +521,7 @@ Returns a nested class by name from the current class. -PyClass | None } description="The nested class if found, None otherwise."/> +PyClass | None } description="The nested class if found, None otherwise."/> ### get_parameter @@ -521,7 +538,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -538,7 +555,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -555,7 +572,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_parent_class @@ -572,7 +589,7 @@ Returns the parent class node with the specified name. -Editable | None } description="The matching parent class node, or None if no match is found."/> +Editable | None } description="The matching parent class node, or None if no match is found."/> ### get_variable_usages @@ -595,7 +612,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -693,7 +710,7 @@ Checks if the class inherits from a specified parent class. str | Class } + type={ <>str | Class } description="The parent class to check for. Can be specified either as a class name string or Class object." defaultValue="" /> @@ -743,7 +760,7 @@ Retrieves all methods that exist on this Class, including methods from superclas -list[ Function ] | MultiLineCollection [ Function , PyClass ] } description=""/> +list[ Function ] | MultiLineCollection [ Function , PyClass ] } description=""/> ### move_to_file @@ -780,7 +797,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -820,6 +837,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -887,7 +927,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -915,7 +955,7 @@ Sets a comment for the Python symbol. /> PyCommentType , optional } + type={ <>PyCommentType , optional } description="Type of comment to add (e.g., single line," defaultValue="PyCommentType.SINGLE_LINE" /> @@ -1020,7 +1060,7 @@ Returns all classes which subclass this class. -list[ Class ] } description="A list of Class objects that inherit from this class."/> +list[ Class ] } description="A list of Class objects that inherit from this class."/> ### superclasses @@ -1037,41 +1077,41 @@ Returns a list of all classes that this class extends, up to max_depth. -list[ Class | ExternalModule | Interface] } description="A list of all superclass symbols in MRO order, up to max_depth. Returns an empty list if the class has no parent classes."/> +list[ Class | ExternalModule | Interface] } description="A list of all superclass symbols in MRO order, up to max_depth. Returns an empty list if the class has no parent classes."/> ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyCodeBlock.mdx b/docs/api-reference/python/PyCodeBlock.mdx index 88765aa14..8af5f0820 100644 --- a/docs/api-reference/python/PyCodeBlock.mdx +++ b/docs/api-reference/python/PyCodeBlock.mdx @@ -20,19 +20,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignment_statements -list[ AssignmentStatement [ PyCodeBlock , Assignment ]] } description="Returns list of top level assignment statements in the code block." /> +list[ AssignmentStatement [ PyCodeBlock , Assignment ]] } description="Returns list of top level assignment statements in the code block." /> ### assignments -list[ Assignment [ Editable , PyCodeBlock ]] } description="Returns all assignments in the code block across all nesting levels." /> +list[ Assignment [ Editable , PyCodeBlock ]] } description="Returns all assignments in the code block across all nesting levels." /> ### attributes -list[ Attribute [ Editable , PyCodeBlock ]] } description="Returns a list of top level class attribute statements in the code block." /> +list[ Attribute [ Editable , PyCodeBlock ]] } description="Returns a list of top level class attribute statements in the code block." /> ### comments -list[ Comment [ Editable , PyCodeBlock ]] } description="Gets list of top level comments in the code block." /> +list[ Comment [ Editable , PyCodeBlock ]] } description="Gets list of top level comments in the code block." /> ### extended @@ -57,11 +57,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls in the code block." /> +list[ FunctionCall ] } description="Returns a list of all function calls in the code block." /> ### if_blocks -list[ IfBlockStatement [ PyCodeBlock ]] } description="Returns a list of top level if statements in the code block." /> +list[ IfBlockStatement [ PyCodeBlock ]] } description="Returns a list of top level if statements in the code block." /> ### level @@ -70,7 +70,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### local_var_assignments -list[ Assignment [ Editable , PyCodeBlock ]] } description="Returns all local variable assignment in the code block, for all nest levels." /> +list[ Assignment [ Editable , PyCodeBlock ]] } description="Returns all local variable assignment in the code block, for all nest levels." /> ### node_type @@ -84,28 +84,28 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_statements -list[ ReturnStatement [ PyCodeBlock ]] } description="Gets all return statements at the top level of the code block." /> +list[ ReturnStatement [ PyCodeBlock ]] } description="Gets all return statements at the top level of the code block." /> ### source @@ -113,11 +113,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### statements -MultiLineCollection [ Statement , PyCodeBlock ] } description="Gets a view of the top-level statements in the code block." /> +MultiLineCollection [ Statement , PyCodeBlock ] } description="Gets a view of the top-level statements in the code block." /> ### symbol_statements -list[ SymbolStatement ] } description="Returns list of top level symbol statements in the code block." /> +list[ SymbolStatement ] } description="Returns list of top level symbol statements in the code block." /> ### ts_node @@ -126,11 +126,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ### with_statements -list[ WithStatement ] } description="Returns a list of all 'with' statements within the code block." /> +list[ WithStatement ] } description="Returns a list of all 'with' statements within the code block." /> ## Methods @@ -140,7 +140,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -198,7 +198,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -221,7 +221,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -229,7 +229,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyCodeBlock ] } description=""/> +CodeFlag[ PyCodeBlock ] } description=""/> ### get_assignments @@ -246,7 +246,7 @@ Returns a list of assignments with the specified variable name. -list[ Assignment [ Editable , PyCodeBlock ]] } description="A list of Assignment objects that match the variable name."/> +list[ Assignment [ Editable , PyCodeBlock ]] } description="A list of Assignment objects that match the variable name."/> ### get_attributes @@ -263,7 +263,7 @@ Returns attributes from the code block, with the option to include or exclude pr -list[ Attribute [ Editable , PyCodeBlock ]] } description="A list of attribute statements matching the privacy criteria."/> +list[ Attribute [ Editable , PyCodeBlock ]] } description="A list of attribute statements matching the privacy criteria."/> ### get_comment @@ -280,7 +280,7 @@ Gets the first comment statement containing a specific text string. -Comment [ Editable , PyCodeBlock ] | None } description="The first comment statement containing the search text, or None if no matching comment is found."/> +Comment [ Editable , PyCodeBlock ] | None } description="The first comment statement containing the search text, or None if no matching comment is found."/> ### get_local_var_assignment @@ -297,7 +297,7 @@ Returns the first code statement that assigns a local variable with the specifie -Assignment [ Editable , PyCodeBlock ] | None } description="The first matching local variable assignment, or None if no match is found."/> +Assignment [ Editable , PyCodeBlock ] | None } description="The first matching local variable assignment, or None if no match is found."/> ### get_local_var_assignments @@ -320,7 +320,7 @@ Returns all instances of local variable assignments that match the specified var -list[ Assignment [ Editable , PyCodeBlock ]] } description="List of Assignment objects representing local variable assignments that match the specified name criteria."/> +list[ Assignment [ Editable , PyCodeBlock ]] } description="List of Assignment objects representing local variable assignments that match the specified name criteria."/> ### get_statements @@ -330,7 +330,7 @@ Returns all statements of a given type up to the specified block level. StatementType | None } + type={ <>StatementType | None } description="The type of statements to return. If None, returns all statement types." defaultValue="None" /> @@ -343,7 +343,7 @@ Returns all statements of a given type up to the specified block level. -list[ Statement [ PyCodeBlock ]] } description=""/> +list[ Statement [ PyCodeBlock ]] } description=""/> ### get_variable_usages @@ -366,7 +366,7 @@ Returns all instances of variable usages in a code block. -list[ Editable [ PyCodeBlock ]] } description="A sorted list of variable usage instances as Editable objects."/> +list[ Editable [ PyCodeBlock ]] } description="A sorted list of variable usage instances as Editable objects."/> ### get_with_statements @@ -383,7 +383,7 @@ Gets with statements at a specific block level. -list[ WithStatement ] } description="A list of WithStatement objects at the specified block level."/> +list[ WithStatement ] } description="A list of WithStatement objects at the specified block level."/> ### indent @@ -403,6 +403,35 @@ Adjusts the indentation level of the entire code block. None } description=""/> +### insert_after +Inserts source code at the bottom of the code block. + + + +str } + description="The source code to insert." + defaultValue="" +/> +bool } + description="Whether to fix the indentation of the inserted code. Defaults to True." + defaultValue="True" +/> +bool } + description="Whether to add a newline before the inserted code. Defaults to True." + defaultValue="True" +/> + + + +None } description=""/> + + ### insert_before Inserts new source code at the top of the code block. @@ -433,7 +462,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -569,7 +598,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### unwrap diff --git a/docs/api-reference/python/PyComment.mdx b/docs/api-reference/python/PyComment.mdx index b6d2f0619..cccbd96a6 100644 --- a/docs/api-reference/python/PyComment.mdx +++ b/docs/api-reference/python/PyComment.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### google_style @@ -57,11 +57,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns a list of nested code blocks within the statement." /> +list[ CodeBlock ] } description="Returns a list of nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyComment ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyComment ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -75,19 +75,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -109,7 +109,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -119,7 +119,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### clean_comment @@ -211,7 +211,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -234,7 +234,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -242,7 +242,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyComment ] } description=""/> +CodeFlag[ PyComment ] } description=""/> ### generate_comment @@ -300,7 +300,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -398,7 +398,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -505,7 +505,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyCommentGroup.mdx b/docs/api-reference/python/PyCommentGroup.mdx index d7a5fbca8..731cf37d5 100644 --- a/docs/api-reference/python/PyCommentGroup.mdx +++ b/docs/api-reference/python/PyCommentGroup.mdx @@ -50,15 +50,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -72,15 +72,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -88,7 +88,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### text @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -186,7 +186,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -209,7 +209,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -217,7 +217,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyCommentGroup ] } description=""/> +CodeFlag[ PyCommentGroup ] } description=""/> ### get_variable_usages @@ -240,7 +240,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -338,7 +338,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -439,7 +439,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> ### to_google_docstring diff --git a/docs/api-reference/python/PyConditionalExpression.mdx b/docs/api-reference/python/PyConditionalExpression.mdx index 18f394eaf..1578a20ab 100644 --- a/docs/api-reference/python/PyConditionalExpression.mdx +++ b/docs/api-reference/python/PyConditionalExpression.mdx @@ -20,17 +20,17 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### condition -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### consequence -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### extended @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -70,19 +70,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -163,7 +163,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -186,7 +186,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -194,7 +194,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyConditionalExpression ] } description=""/> +CodeFlag[ PyConditionalExpression ] } description=""/> ### get_variable_usages @@ -217,7 +217,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -315,7 +315,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -331,7 +331,7 @@ Simplifies a ternary expression based on a boolean condition. /> Editable | None, optional } + type={ <>Editable | None, optional } description="The node to be edited. Defaults to None." defaultValue="None" /> @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyDecorator.mdx b/docs/api-reference/python/PyDecorator.mdx index 9bbf945c4..3c50c33b0 100644 --- a/docs/api-reference/python/PyDecorator.mdx +++ b/docs/api-reference/python/PyDecorator.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call -FunctionCall | None } description="Gets the function call node from the decorator if the decorator is a call." /> +FunctionCall | None } description="Gets the function call node from the decorator if the decorator is a call." /> ### extended @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -160,7 +160,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -183,7 +183,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -191,7 +191,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyDecorator ] } description=""/> +CodeFlag[ PyDecorator ] } description=""/> ### get_name @@ -199,7 +199,7 @@ 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."/> +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."/> ### get_variable_usages @@ -222,7 +222,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -444,7 +444,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/python/PyFile.mdx b/docs/api-reference/python/PyFile.mdx index 6a1be6b2d..96648ac63 100644 --- a/docs/api-reference/python/PyFile.mdx +++ b/docs/api-reference/python/PyFile.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### classes -list[ Class ] } description="Returns all Classes in the file." /> +list[ Class ] } description="Returns all Classes in the file." /> ### code_block @@ -33,19 +33,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### directory -Directory | None } description="Returns the directory that contains this file." /> +Directory | None } description="Returns the directory that contains this file." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -83,15 +83,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### functions -list[ Function ] } description="Returns all Functions in the file." /> +list[ Function ] } description="Returns all Functions in the file." /> ### global_vars -list[ Assignment ] } description="Returns all GlobalVars in the file." /> +list[ Assignment ] } description="Returns all GlobalVars in the file." /> ### import_module_name @@ -99,19 +99,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### import_statements -list[ ImportStatement ] } description="Returns all ImportStatements in the file, where each import statement can contain" /> +list[ ImportStatement ] } description="Returns all ImportStatements in the file, where each import statement can contain" /> ### importers -list[ Import ] } description="Returns all imports that directly imports this file as a module." /> +list[ Import ] } description="Returns all imports that directly imports this file as a module." /> ### imports -list[ Import ] } description="List of all Imports in this file." /> +list[ Import ] } description="List of all Imports in this file." /> ### inbound_imports -list[ Import ] } description="Returns all imports that are importing symbols contained in this file." /> +list[ Import ] } description="Returns all imports that are importing symbols contained in this file." /> ### is_binary @@ -141,15 +141,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### path @@ -163,7 +163,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -175,7 +175,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols_sorted_topologically -list[ Symbol ] } description="Returns all Symbols in the file, sorted topologically (parents first). Robust to" /> +list[ Symbol ] } description="Returns all Symbols in the file, sorted topologically (parents first). Robust to" /> ### ts_node @@ -184,7 +184,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -229,6 +229,29 @@ Adds an import statement to the file from a string representation. None } description="This function modifies the file in place."/> +### add_symbol +Adds `symbol` to the file. + + + +Symbol } + description="The symbol to add to the file." + defaultValue="" +/> +bool, optional } + description="Whether to export the symbol. Defaults to True." + defaultValue="True" +/> + + + +Symbol | None } description="The existing symbol if it already exists in the file or None if it was added."/> + + ### add_symbol_from_source Adds a symbol to a file from a string representation. @@ -246,12 +269,47 @@ Adds a symbol to a file from a string representation. None } description="The symbol is added directly to the file's content."/> +### add_symbol_import +Adds an import to a file for a given symbol. + + + +Symbol } + description="The symbol to import." + defaultValue="" +/> +str | None } + description="Optional alias for the imported symbol. Defaults to None." + defaultValue="None" +/> +ImportType } + description="The type of import to use. Defaults to ImportType.UNKNOWN." + defaultValue="ImportType.UNKNOWN" +/> +bool } + description="Whether this is a type-only import. Defaults to False." + defaultValue="False" +/> + + + +Import | None } description="The existing import for the symbol or None if it was added."/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -309,7 +367,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_by_byte_range @@ -326,7 +384,7 @@ Finds all editable objects that overlap with the given byte range in the file. -list[ Editable ] } description="A list of all Editable objects that overlap with the given range."/> +list[ Editable ] } description="A list of all Editable objects that overlap with the given range."/> ### find_string_literals @@ -349,7 +407,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -357,7 +415,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyFile ] } description=""/> +CodeFlag[ PyFile ] } description=""/> ### get_class @@ -374,7 +432,7 @@ Returns a specific Class by full name. Returns None if not found. -Class | None } description="The matching Class object if found, None otherwise."/> +Class | None } description="The matching Class object if found, None otherwise."/> ### get_extensions @@ -399,7 +457,7 @@ Returns a specific Function by name. -Function | None } description="The matching Function object if found, None otherwise."/> +Function | None } description="The matching Function object if found, None otherwise."/> ### get_global_var @@ -416,7 +474,7 @@ Returns a specific global var by name. Returns None if not found. -Assignment | None } description="The global variable if found, None otherwise."/> +Assignment | None } description="The global variable if found, None otherwise."/> ### get_import @@ -433,7 +491,24 @@ Returns the import with matching alias. Returns None if not found. -Import | None } description="The import statement with the matching alias if found, None otherwise."/> +Import | None } description="The import statement with the matching alias if found, None otherwise."/> + + +### get_import_insert_index +Determines the index position where a new import statement should be inserted in a Python file. + + + +str } + description="The import statement to be inserted." + defaultValue="" +/> + + + +int | None } description="The index where the import should be inserted. Returns 0 for future imports or if there are no existing imports after future imports. Returns None if there are no imports in the file."/> ### get_import_string @@ -476,7 +551,7 @@ 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."/> +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."/> ### get_symbol @@ -493,7 +568,7 @@ Gets a symbol by its name from the file. -Symbol | None } description="The found symbol, or None if not found."/> +Symbol | None } description="The found symbol, or None if not found."/> ### get_variable_usages @@ -516,7 +591,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### has_import @@ -631,7 +706,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -650,6 +725,29 @@ Removes the file from the file system and graph. None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -717,7 +815,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring @@ -791,19 +889,19 @@ 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. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### symbols @@ -811,7 +909,7 @@ 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"/> +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"/> ### update_filepath @@ -833,19 +931,19 @@ Renames the file and updates all imports to point to the new location. ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyForLoopStatement.mdx b/docs/api-reference/python/PyForLoopStatement.mdx index 3ba9d40db..d9235456b 100644 --- a/docs/api-reference/python/PyForLoopStatement.mdx +++ b/docs/api-reference/python/PyForLoopStatement.mdx @@ -25,16 +25,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -59,7 +59,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within this for loop statement." /> +list[ FunctionCall ] } description="Gets all function calls within this for loop statement." /> ### index @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### item -Expression [ PyForLoopStatement ] } description="An item in the iterable object" /> +Expression [ PyForLoopStatement ] } description="An item in the iterable object" /> ### iterable -Expression [ PyForLoopStatement ] } description="The iterable that is being iterated over" /> +Expression [ PyForLoopStatement ] } description="The iterable that is being iterated over" /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyForLoopStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyForLoopStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -97,19 +97,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -127,7 +127,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -160,7 +160,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -218,7 +218,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -241,7 +241,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -249,7 +249,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyForLoopStatement ] } description=""/> +CodeFlag[ PyForLoopStatement ] } description=""/> ### get_variable_usages @@ -272,7 +272,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -370,7 +370,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -477,7 +477,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyFunction.mdx b/docs/api-reference/python/PyFunction.mdx index 83bc03287..f74dfd64c 100644 --- a/docs/api-reference/python/PyFunction.mdx +++ b/docs/api-reference/python/PyFunction.mdx @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### code_block @@ -32,19 +32,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -PyCommentGroup | None } description="Retrieves the comment group associated with a Python symbol." /> +PyCommentGroup | None } description="Retrieves the comment group associated with a Python symbol." /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -52,7 +52,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -77,7 +77,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the function and its parameters." /> +list[ FunctionCall ] } description="Gets all function calls within the function and its parameters." /> ### function_signature @@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -PyCommentGroup | None } description="Returns the inline comment group associated with this symbol." /> +PyCommentGroup | None } description="Returns the inline comment group associated with this symbol." /> ### is_async @@ -141,7 +141,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_functions -list[ Function ] } description="Returns a list of nested functions defined within this function's code block." /> +list[ Function ] } description="Returns a list of nested functions defined within this function's code block." /> ### node_type @@ -150,7 +150,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , PyFunction ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , PyFunction ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -159,27 +159,27 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_statements -list[ ReturnStatement ] } description="Returns a list of all return statements within this function's body." /> +list[ ReturnStatement ] } description="Returns a list of all return statements within this function's body." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### source @@ -198,12 +198,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -266,9 +266,26 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### add_statements Adds statements to the end of a function body. - + -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### asyncify @@ -354,7 +371,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -377,7 +394,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -385,7 +402,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyFunction ] } description=""/> +CodeFlag[ PyFunction ] } description=""/> ### get_import_string @@ -428,7 +445,7 @@ 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."/> +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."/> ### get_parameter @@ -445,7 +462,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -462,7 +479,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -479,7 +496,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_variable_usages @@ -502,7 +519,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -593,6 +610,29 @@ Inserts text before the current symbol node in the Abstract Syntax Tree. None } description=""/> +### insert_statements +Inserts lines of code into the function body at the specified index. + + + +str } + description="The code lines to insert into the function body." + defaultValue="" +/> +int, optional } + description="The position in the function body where the lines should be inserted. Defaults to 0." + defaultValue="0" +/> + + + +None } description=""/> + + ### is_wrapped_in Check if this node is contained another node of the given class @@ -635,7 +675,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### prepend_statements @@ -692,6 +732,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### rename_local_variable Renames a local variable and all its usages within a function body. @@ -788,7 +851,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -816,7 +879,7 @@ Sets a comment for the Python symbol. /> PyCommentType , optional } + type={ <>PyCommentType , optional } description="Type of comment to add (e.g., single line," defaultValue="PyCommentType.SINGLE_LINE" /> @@ -926,36 +989,36 @@ Sets or modifies the return type annotation of a function. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyGenericType.mdx b/docs/api-reference/python/PyGenericType.mdx index dc9f80239..9c4e6279f 100644 --- a/docs/api-reference/python/PyGenericType.mdx +++ b/docs/api-reference/python/PyGenericType.mdx @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -62,7 +62,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -Collection[ Type , PyGenericType ] } description="Retrieves the generic type parameters associated with this type." /> +Collection[ Type , PyGenericType ] } description="Retrieves the generic type parameters associated with this type." /> ### parent @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -164,7 +164,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -187,7 +187,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyGenericType ] } description=""/> +CodeFlag[ PyGenericType ] } description=""/> ### get_name @@ -203,7 +203,7 @@ 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."/> +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."/> ### get_variable_usages @@ -226,7 +226,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -448,7 +448,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/python/PyHasBlock.mdx b/docs/api-reference/python/PyHasBlock.mdx index f8ca39235..1f7364e32 100644 --- a/docs/api-reference/python/PyHasBlock.mdx +++ b/docs/api-reference/python/PyHasBlock.mdx @@ -24,11 +24,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -53,7 +53,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### is_decorated @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -129,7 +129,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -187,7 +187,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -210,7 +210,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -218,7 +218,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyHasBlock ] } description=""/> +CodeFlag[ PyHasBlock ] } description=""/> ### get_variable_usages @@ -241,7 +241,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -339,7 +339,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -446,7 +446,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyIfBlockStatement.mdx b/docs/api-reference/python/PyIfBlockStatement.mdx index 5b2255be8..b338f82d5 100644 --- a/docs/api-reference/python/PyIfBlockStatement.mdx +++ b/docs/api-reference/python/PyIfBlockStatement.mdx @@ -29,11 +29,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative_blocks -list[ IfBlockStatement ] } description="Returns a list of alternative if/elif/else blocks for the current block." /> +list[ IfBlockStatement ] } description="Returns a list of alternative if/elif/else blocks for the current block." /> ### condition -Expression [ PyIfBlockStatement ] | None } description="The condition expression for the if block. None if the block is an else block." /> +Expression [ PyIfBlockStatement ] | None } description="The condition expression for the if block. None if the block is an else block." /> ### consequence_block @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### else_statement -IfBlockStatement | None } description="Returns the else block within the if-statement." /> +IfBlockStatement | None } description="Returns the else block within the if-statement." /> ### extended @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the if block statement and its alternative blocks." /> +list[ FunctionCall ] } description="Returns all function calls within the if block statement and its alternative blocks." /> ### index @@ -86,11 +86,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested code blocks within an if/elif/else statement block." /> +list[ CodeBlock ] } description="Returns all nested code blocks within an if/elif/else statement block." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyIfBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyIfBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -104,19 +104,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -134,7 +134,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -144,7 +144,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -187,7 +187,7 @@ Returns all elif blocks within the if block. -list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> +list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> ### find @@ -210,7 +210,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -233,7 +233,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -241,7 +241,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyIfBlockStatement ] } description=""/> +CodeFlag[ PyIfBlockStatement ] } description=""/> ### get_variable_usages @@ -264,7 +264,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -362,7 +362,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -478,7 +478,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyImport.mdx b/docs/api-reference/python/PyImport.mdx index 14708bbeb..34aa281a7 100644 --- a/docs/api-reference/python/PyImport.mdx +++ b/docs/api-reference/python/PyImport.mdx @@ -20,12 +20,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alias -Editable | None } description=" +Editable | None } description=" " /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -50,7 +50,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### from_file -SourceFile | None } description="Returns the SourceFile that an Import is importing from." /> +SourceFile | None } description="Returns the SourceFile that an Import is importing from." /> ### full_name @@ -58,7 +58,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### import_specifier @@ -75,15 +75,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### imported_exports -list[ Exportable ] } description="Returns a list of exports from an import statement." /> +list[ Exportable ] } description="Returns a list of exports from an import statement." /> ### imported_symbol -Symbol | ExternalModule | SourceFile | Import | None } description="Returns the symbol directly being imported, including an indirect import and an External" /> +Symbol | ExternalModule | SourceFile | Import | None } description="Returns the symbol directly being imported, including an indirect import and an External" /> ### module -Editable | None } description=" +Editable | None } description=" " /> ### name @@ -106,23 +106,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_symbol -Symbol | ExternalModule | SourceFile | None } description="Returns the symbol, source file, or external module that this import ultimately resolves" /> +Symbol | ExternalModule | SourceFile | None } description="Returns the symbol, source file, or external module that this import ultimately resolves" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbol_name -Editable | None } description="The name of the symbol being imported. For instance import a as b has a symbol_name of a." /> +Editable | None } description="The name of the symbol being imported. For instance import a as b has a symbol_name of a." /> ### to_file @@ -148,7 +148,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -158,7 +158,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -216,7 +216,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -239,7 +239,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -247,7 +247,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyImport ] } description=""/> +CodeFlag[ PyImport ] } description=""/> ### get_import_string @@ -290,7 +290,7 @@ 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."/> +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."/> ### get_variable_usages @@ -313,7 +313,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -451,7 +451,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -581,7 +581,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_import_module @@ -637,36 +637,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyImportStatement.mdx b/docs/api-reference/python/PyImportStatement.mdx index 3476f98a8..9cb1b046a 100644 --- a/docs/api-reference/python/PyImportStatement.mdx +++ b/docs/api-reference/python/PyImportStatement.mdx @@ -41,11 +41,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### imports -Collection[ Import , PyImportStatement ] } description="A collection of the individual imports this statement represents" /> +Collection[ Import , PyImportStatement ] } description="A collection of the individual imports this statement represents" /> ### index @@ -53,11 +53,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyImportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyImportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -169,7 +169,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -192,7 +192,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyImportStatement ] } description=""/> +CodeFlag[ PyImportStatement ] } description=""/> ### get_variable_usages @@ -223,7 +223,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -428,7 +428,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyMatchCase.mdx b/docs/api-reference/python/PyMatchCase.mdx index c0e122671..e3604e318 100644 --- a/docs/api-reference/python/PyMatchCase.mdx +++ b/docs/api-reference/python/PyMatchCase.mdx @@ -20,20 +20,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ PyMatchCase ] | None } description="The condition which triggers this case" /> +Expression [ PyMatchCase ] | None } description="The condition which triggers this case" /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### extended @@ -58,7 +58,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -70,11 +70,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyMatchCase ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyMatchCase ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -88,19 +88,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -118,7 +118,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -151,7 +151,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -209,7 +209,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -232,7 +232,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -240,7 +240,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyMatchCase ] } description=""/> +CodeFlag[ PyMatchCase ] } description=""/> ### get_variable_usages @@ -263,7 +263,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -361,7 +361,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -468,7 +468,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyMatchStatement.mdx b/docs/api-reference/python/PyMatchStatement.mdx index 92b959110..6934cc933 100644 --- a/docs/api-reference/python/PyMatchStatement.mdx +++ b/docs/api-reference/python/PyMatchStatement.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### cases -list[ SwitchCase ] } description=" +list[ SwitchCase ] } description=" " /> ### extended @@ -46,7 +46,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the switch statement." /> +list[ FunctionCall ] } description="Returns all function calls within the switch statement." /> ### index @@ -54,11 +54,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the switch statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the switch statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyMatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyMatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -72,19 +72,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -102,11 +102,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression [ PyMatchStatement ] } description="The value to switch on" /> +Expression [ PyMatchStatement ] } description="The value to switch on" /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -174,7 +174,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -197,7 +197,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -205,7 +205,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyMatchStatement ] } description=""/> +CodeFlag[ PyMatchStatement ] } description=""/> ### get_variable_usages @@ -228,7 +228,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -433,7 +433,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyNamedType.mdx b/docs/api-reference/python/PyNamedType.mdx index 379196912..3fa977702 100644 --- a/docs/api-reference/python/PyNamedType.mdx +++ b/docs/api-reference/python/PyNamedType.mdx @@ -50,7 +50,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -68,19 +68,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -93,7 +93,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -161,7 +161,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -184,7 +184,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -192,7 +192,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyNamedType ] } description=""/> +CodeFlag[ PyNamedType ] } description=""/> ### get_name @@ -200,7 +200,7 @@ 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."/> +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."/> ### get_variable_usages @@ -223,7 +223,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -445,7 +445,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/python/PyParameter.mdx b/docs/api-reference/python/PyParameter.mdx index c8ce469e1..2d178c3b9 100644 --- a/docs/api-reference/python/PyParameter.mdx +++ b/docs/api-reference/python/PyParameter.mdx @@ -14,7 +14,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### 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) +[Parameter](/api-reference/core/Parameter), [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) ## Attributes @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -53,7 +53,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -87,19 +87,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -112,15 +112,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -147,7 +147,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -205,7 +205,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -228,7 +228,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -236,7 +236,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyParameter ] } description=""/> +CodeFlag[ PyParameter ] } description=""/> ### get_name @@ -244,7 +244,7 @@ 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."/> +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."/> ### get_variable_usages @@ -267,7 +267,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -365,7 +365,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -495,7 +495,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -557,36 +557,36 @@ Sets the value of the node's value Expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyPassStatement.mdx b/docs/api-reference/python/PyPassStatement.mdx index c70ec5e8d..b25d0d9af 100644 --- a/docs/api-reference/python/PyPassStatement.mdx +++ b/docs/api-reference/python/PyPassStatement.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -49,11 +49,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyPassStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyPassStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -165,7 +165,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -188,7 +188,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyPassStatement ] } description=""/> +CodeFlag[ PyPassStatement ] } description=""/> ### get_variable_usages @@ -219,7 +219,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PyString.mdx b/docs/api-reference/python/PyString.mdx index 80a1e072b..4509206e3 100644 --- a/docs/api-reference/python/PyString.mdx +++ b/docs/api-reference/python/PyString.mdx @@ -24,12 +24,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### content_nodes -Collection[ Expression [ Editable ], PyString ] } description=" +Collection[ Expression [ Editable ], PyString ] } description=" " /> ### expressions -list[ Expression [ Editable ]] } description="embedded expressions in the string, only applicable for templated or formatted strings" /> +list[ Expression [ Editable ]] } description="embedded expressions in the string, only applicable for templated or formatted strings" /> ### extended @@ -54,7 +54,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -68,19 +68,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -93,7 +93,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ### with_quotes @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -165,7 +165,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -188,7 +188,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyString ] } description=""/> +CodeFlag[ PyString ] } description=""/> ### get_variable_usages @@ -219,7 +219,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/python/PySymbol.mdx b/docs/api-reference/python/PySymbol.mdx index d7f8c384f..1854a2a9f 100644 --- a/docs/api-reference/python/PySymbol.mdx +++ b/docs/api-reference/python/PySymbol.mdx @@ -20,11 +20,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -PyCommentGroup | None } description="Retrieves the comment group associated with a Python symbol." /> +PyCommentGroup | None } description="Retrieves the comment group associated with a Python symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -32,7 +32,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> +list[ Editable ] } description="Returns a list of Editable nodes associated with this symbol, including extended symbols." /> ### extended_source @@ -57,11 +57,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### inline_comment -PyCommentGroup | None } description="Returns the inline comment group associated with this symbol." /> +PyCommentGroup | None } description="Returns the inline comment group associated with this symbol." /> ### is_exported @@ -83,19 +83,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -113,7 +113,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -153,12 +153,29 @@ Adds a new comment to the symbol. None } description=""/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -216,7 +233,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -239,7 +256,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -247,7 +264,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PySymbol ] } description=""/> +CodeFlag[ PySymbol ] } description=""/> ### get_import_string @@ -290,7 +307,7 @@ 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."/> +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."/> ### get_variable_usages @@ -313,7 +330,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -446,7 +463,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -486,6 +503,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -553,7 +593,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -581,7 +621,7 @@ Sets a comment for the Python symbol. /> PyCommentType , optional } + type={ <>PyCommentType , optional } description="Type of comment to add (e.g., single line," defaultValue="PyCommentType.SINGLE_LINE" /> @@ -639,36 +679,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/python/PyTryCatchStatement.mdx b/docs/api-reference/python/PyTryCatchStatement.mdx index e1c0aeda4..2c73c0bcd 100644 --- a/docs/api-reference/python/PyTryCatchStatement.mdx +++ b/docs/api-reference/python/PyTryCatchStatement.mdx @@ -24,20 +24,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### except_clauses -list[ PyCatchStatement [ PyTryCatchStatement ]] } description="The exception handlers." /> +list[ PyCatchStatement [ PyTryCatchStatement ]] } description="The exception handlers." /> ### extended @@ -62,11 +62,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### finalizer -BlockStatement | None } description="The code block executed regardless of if an exception is thrown or not" /> +BlockStatement | None } description="The code block executed regardless of if an exception is thrown or not" /> ### function_calls -list[ FunctionCall ] } description="Gets a list of all function calls contained within the try-catch statement." /> +list[ FunctionCall ] } description="Gets a list of all function calls contained within the try-catch statement." /> ### index @@ -78,11 +78,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ PyCodeBlock ] } description="Returns all CodeBlocks nested within this try-catch statement." /> +list[ PyCodeBlock ] } description="Returns all CodeBlocks nested within this try-catch statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyTryCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyTryCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -96,19 +96,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -126,7 +126,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -159,7 +159,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -217,7 +217,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -240,7 +240,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -248,7 +248,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyTryCatchStatement ] } description=""/> +CodeFlag[ PyTryCatchStatement ] } description=""/> ### get_variable_usages @@ -271,7 +271,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -369,7 +369,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -476,7 +476,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/python/PyUnionType.mdx b/docs/api-reference/python/PyUnionType.mdx index 78a95978f..58455b7fb 100644 --- a/docs/api-reference/python/PyUnionType.mdx +++ b/docs/api-reference/python/PyUnionType.mdx @@ -45,15 +45,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -137,7 +137,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -160,7 +160,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyUnionType ] } description=""/> +CodeFlag[ PyUnionType ] } description=""/> ### get_variable_usages @@ -191,7 +191,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -323,7 +323,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -394,7 +394,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/python/PyWhileStatement.mdx b/docs/api-reference/python/PyWhileStatement.mdx index 344cc6965..98c080678 100644 --- a/docs/api-reference/python/PyWhileStatement.mdx +++ b/docs/api-reference/python/PyWhileStatement.mdx @@ -29,19 +29,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### condition -Expression [ TSWhileStatement ] } description="The condition expression of the while loop." /> +Expression [ TSWhileStatement ] } description="The condition expression of the while loop." /> ### decorators -list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ PyDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -PyCommentGroup | None } description="Gets the function's docstring." /> +PyCommentGroup | None } description="Gets the function's docstring." /> ### else_statement -PyIfBlockStatement [ PyCodeBlock [ PyWhileStatement ]] | None } description="the statement that will run if the while loop completes, if any." /> +PyIfBlockStatement [ PyCodeBlock [ PyWhileStatement ]] | None } description="the statement that will run if the while loop completes, if any." /> ### extended @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the while statement and its else block." /> +list[ FunctionCall ] } description="Returns all function calls within the while statement and its else block." /> ### index @@ -78,11 +78,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ PyCodeBlock ] } description="Returns a list of all code blocks nested within the while statement." /> +list[ PyCodeBlock ] } description="Returns a list of all code blocks nested within the while statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ PyWhileStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ PyWhileStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -96,19 +96,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -126,7 +126,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -159,7 +159,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -217,7 +217,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -240,7 +240,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -248,7 +248,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ PyWhileStatement ] } description=""/> +CodeFlag[ PyWhileStatement ] } description=""/> ### get_variable_usages @@ -271,7 +271,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -369,7 +369,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -476,7 +476,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/JSXElement.mdx b/docs/api-reference/typescript/JSXElement.mdx index 9f9f6bcff..bf1820be3 100644 --- a/docs/api-reference/typescript/JSXElement.mdx +++ b/docs/api-reference/typescript/JSXElement.mdx @@ -20,11 +20,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### attributes -list[ JSXProp ] } description="Returns all JSXProp on this JSXElement, an alias for JSXElement.props." /> +list[ JSXProp ] } description="Returns all JSXProp on this JSXElement, an alias for JSXElement.props." /> ### expressions -list[ JSXExpression ] } description="Gets all JSX expressions within the JSX element." /> +list[ JSXExpression ] } description="Gets all JSX expressions within the JSX element." /> ### extended @@ -53,11 +53,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### jsx_elements -list[ JSXElement ] } description="Returns a list of JSX elements nested within the current element." /> +list[ JSXElement ] } description="Returns a list of JSX elements nested within the current element." /> ### name @@ -75,23 +75,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### props -list[ JSXProp ] } description="Retrieves all JSXProps (attributes) from a JSX element." /> +list[ JSXProp ] } description="Retrieves all JSXProps (attributes) from a JSX element." /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -137,7 +137,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -195,7 +195,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -218,7 +218,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -226,7 +226,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ JSXElement ] } description=""/> +CodeFlag[ JSXElement ] } description=""/> ### get_name @@ -234,7 +234,7 @@ 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."/> +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."/> ### get_prop @@ -251,7 +251,7 @@ Returns the JSXProp with the given name from the JSXElement. -JSXProp | None } description="The matching JSXProp object if found, None if not found."/> +JSXProp | None } description="The matching JSXProp object if found, None if not found."/> ### get_variable_usages @@ -274,7 +274,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -372,7 +372,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -496,7 +496,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/JSXExpression.mdx b/docs/api-reference/typescript/JSXExpression.mdx index dead88254..99d964836 100644 --- a/docs/api-reference/typescript/JSXExpression.mdx +++ b/docs/api-reference/typescript/JSXExpression.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -55,19 +55,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### statement -Editable [ JSXExpression ] | None } description="Returns the editable component of this JSX expression." /> +Editable [ JSXExpression ] | None } description="Returns the editable component of this JSX expression." /> ### ts_node @@ -84,7 +84,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -94,7 +94,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -152,7 +152,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -175,7 +175,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -183,7 +183,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ JSXExpression ] } description=""/> +CodeFlag[ JSXExpression ] } description=""/> ### get_variable_usages @@ -206,7 +206,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -304,7 +304,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -420,7 +420,15 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> + + +### unwrap +Removes the brackets from a JSX expression. + + + +None } description=""/> diff --git a/docs/api-reference/typescript/JSXProp.mdx b/docs/api-reference/typescript/JSXProp.mdx index 36a16000d..d864ec12e 100644 --- a/docs/api-reference/typescript/JSXProp.mdx +++ b/docs/api-reference/typescript/JSXProp.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### expression -JSXExpression | None } description="Retrieves the JSX expression associated with this JSX prop." /> +JSXExpression | None } description="Retrieves the JSX expression associated with this JSX prop." /> ### extended @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,11 +92,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -164,7 +164,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -187,7 +187,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ JSXProp ] } description=""/> +CodeFlag[ JSXProp ] } description=""/> ### get_name @@ -203,7 +203,7 @@ 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."/> +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."/> ### get_variable_usages @@ -226,7 +226,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -448,7 +448,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSArrayType.mdx b/docs/api-reference/typescript/TSArrayType.mdx index 045e7c769..6425067c6 100644 --- a/docs/api-reference/typescript/TSArrayType.mdx +++ b/docs/api-reference/typescript/TSArrayType.mdx @@ -48,7 +48,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -66,19 +66,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -101,7 +101,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -159,7 +159,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -182,7 +182,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -190,7 +190,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSArrayType ] } description=""/> +CodeFlag[ TSArrayType ] } description=""/> ### get_name @@ -198,7 +198,7 @@ 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."/> +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."/> ### get_variable_usages @@ -221,7 +221,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -319,7 +319,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -443,7 +443,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSAssignment.mdx b/docs/api-reference/typescript/TSAssignment.mdx index 75dba337d..a978d541f 100644 --- a/docs/api-reference/typescript/TSAssignment.mdx +++ b/docs/api-reference/typescript/TSAssignment.mdx @@ -32,15 +32,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -52,7 +52,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -77,7 +77,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### has_semicolon @@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_exported @@ -123,23 +123,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -157,15 +157,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -205,12 +205,29 @@ Adds a new comment to the symbol. None } description=""/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -268,7 +285,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -291,7 +308,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -299,7 +316,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSAssignment ] } description=""/> +CodeFlag[ TSAssignment ] } description=""/> ### from_named_expression @@ -334,7 +351,7 @@ Creates a MultiExpression object from a TypeScript named expression node. -MultiExpression [ TSAssignmentStatement , TSAssignment ] } description="A MultiExpression object containing the constructed assignments."/> +MultiExpression [ TSAssignmentStatement , TSAssignment ] } description="A MultiExpression object containing the constructed assignments."/> ### get_import_string @@ -377,7 +394,7 @@ 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."/> +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."/> ### get_variable_usages @@ -400,7 +417,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -504,7 +521,7 @@ 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."/> +list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> ### move_to_file @@ -541,7 +558,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -590,6 +607,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -657,7 +697,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -685,7 +725,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -777,36 +817,36 @@ Sets the value of an assignment expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSAssignmentStatement.mdx b/docs/api-reference/typescript/TSAssignmentStatement.mdx index f9519cb42..62aa9600c 100644 --- a/docs/api-reference/typescript/TSAssignmentStatement.mdx +++ b/docs/api-reference/typescript/TSAssignmentStatement.mdx @@ -30,7 +30,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignments -list[ Assignment ] } description=" +list[ Assignment ] } description=" " /> ### extended @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -64,16 +64,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### left -Expression [ Assignment ] } description=" +Expression [ Assignment ] } description=" " /> ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSAssignmentStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSAssignmentStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -87,23 +87,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ Assignment ] | None } description=" +Expression [ Assignment ] | None } description=" " /> ### source @@ -122,11 +122,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -194,7 +194,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -217,7 +217,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -225,7 +225,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSAssignmentStatement ] } description=""/> +CodeFlag[ TSAssignmentStatement ] } description=""/> ### get_variable_usages @@ -248,7 +248,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -346,7 +346,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -453,7 +453,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/typescript/TSAttribute.mdx b/docs/api-reference/typescript/TSAttribute.mdx index 2de080488..274a17ae8 100644 --- a/docs/api-reference/typescript/TSAttribute.mdx +++ b/docs/api-reference/typescript/TSAttribute.mdx @@ -30,12 +30,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignments -list[ Assignment ] } description=" +list[ Assignment ] } description=" " /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -64,7 +64,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -80,7 +80,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### left -Expression [ Assignment ] } description=" +Expression [ Assignment ] } description=" " /> ### name @@ -89,11 +89,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSAttribute ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSAttribute ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -107,23 +107,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -Expression [ Assignment ] | None } description=" +Expression [ Assignment ] | None } description=" " /> ### source @@ -142,11 +142,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -156,7 +156,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -214,7 +214,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -237,7 +237,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -245,7 +245,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSAttribute ] } description=""/> +CodeFlag[ TSAttribute ] } description=""/> ### get_name @@ -253,7 +253,7 @@ 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."/> +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."/> ### get_variable_usages @@ -276,7 +276,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -383,7 +383,7 @@ Returns local usages of a TypeScript attribute within its code block. -list[ Editable ] } description="A sorted list of unique Editable instances representing local usages of the attribute, ordered by their position in the source code."/> +list[ Editable ] } description="A sorted list of unique Editable instances representing local usages of the attribute, ordered by their position in the source code."/> ### parent_of_type @@ -391,7 +391,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -431,6 +431,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -498,7 +521,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -537,36 +560,36 @@ Sets the value of a node's assignment. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSBlockStatement.mdx b/docs/api-reference/typescript/TSBlockStatement.mdx index b59c4d5d8..50dfb6226 100644 --- a/docs/api-reference/typescript/TSBlockStatement.mdx +++ b/docs/api-reference/typescript/TSBlockStatement.mdx @@ -20,16 +20,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -54,7 +54,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -66,15 +66,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSBlockStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSBlockStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -88,19 +88,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -118,7 +118,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -151,7 +151,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -209,7 +209,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -232,7 +232,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -240,7 +240,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSBlockStatement ] } description=""/> +CodeFlag[ TSBlockStatement ] } description=""/> ### get_component @@ -257,7 +257,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSBlockStatement ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSBlockStatement ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -280,7 +280,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -378,7 +378,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -485,7 +485,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/TSCatchStatement.mdx b/docs/api-reference/typescript/TSCatchStatement.mdx index 8a7234d39..2825d4c59 100644 --- a/docs/api-reference/typescript/TSCatchStatement.mdx +++ b/docs/api-reference/typescript/TSCatchStatement.mdx @@ -25,20 +25,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ PyCatchStatement ] | None } description="The condition which triggers this clause" /> +Expression [ PyCatchStatement ] | None } description="The condition which triggers this clause" /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -63,7 +63,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -75,15 +75,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSCatchStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSCatchStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -97,19 +97,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -127,7 +127,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -160,7 +160,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -218,7 +218,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -241,7 +241,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -249,7 +249,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSCatchStatement ] } description=""/> +CodeFlag[ TSCatchStatement ] } description=""/> ### get_component @@ -266,7 +266,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSCatchStatement ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSCatchStatement ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -289,7 +289,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -387,7 +387,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -494,7 +494,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/TSChainedAttribute.mdx b/docs/api-reference/typescript/TSChainedAttribute.mdx index 6a17d0c5f..dc1fc06eb 100644 --- a/docs/api-reference/typescript/TSChainedAttribute.mdx +++ b/docs/api-reference/typescript/TSChainedAttribute.mdx @@ -54,7 +54,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of function calls associated with this chained attribute's object." /> +list[ FunctionCall ] } description="Returns a list of function calls associated with this chained attribute's object." /> ### node_type @@ -72,19 +72,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -97,7 +97,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -165,7 +165,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -188,7 +188,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSChainedAttribute ] } description=""/> +CodeFlag[ TSChainedAttribute ] } description=""/> ### get_variable_usages @@ -219,7 +219,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSClass.mdx b/docs/api-reference/typescript/TSClass.mdx index dd11a2c8a..14a70d7cd 100644 --- a/docs/api-reference/typescript/TSClass.mdx +++ b/docs/api-reference/typescript/TSClass.mdx @@ -30,7 +30,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### code_block @@ -38,11 +38,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### constructor -Function | None } description="Returns the constructor method for this class." /> +Function | None } description="Returns the constructor method for this class." /> ### constructor_keyword @@ -50,19 +50,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -74,7 +74,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### has_semicolon @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_decorated @@ -131,7 +131,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSClass ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSClass ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -139,7 +139,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_classes -list[ TSClass ] } description="Retrieves the nested classes defined within this class." /> +list[ TSClass ] } description="Retrieves the nested classes defined within this class." /> ### node_type @@ -148,7 +148,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , TSClass ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , TSClass ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -157,37 +157,37 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_class_names -list[ Name | ChainedAttribute ] } description="Returns a list of the parent class names that this class inherits from." /> +list[ Name | ChainedAttribute ] } description="Returns a list of the parent class names that this class inherits from." /> ### parent_classes -Parents[ Type , PyClass ] | None } description=" +Parents[ Type , PyClass ] | None } description=" " /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -205,12 +205,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -313,6 +313,23 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### add_source Adds source code to a class body. @@ -335,7 +352,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### attributes @@ -358,7 +375,7 @@ Retrieves all attributes from this Class including those from its superclasses u -list[ Attribute ] } description="A list of unique attributes from this class and its superclasses. If an attribute is defined in multiple classes, the first definition encountered is used."/> +list[ Attribute ] } description="A list of unique attributes from this class and its superclasses. If an attribute is defined in multiple classes, the first definition encountered is used."/> ### class_component_to_function_component @@ -432,7 +449,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -455,7 +472,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -463,7 +480,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSClass ] } description=""/> +CodeFlag[ TSClass ] } description=""/> ### get_attribute @@ -480,7 +497,7 @@ Returns a specific attribute by name. -Attribute | None } description="The matching attribute if found, None otherwise. If multiple attributes with the same name exist in the inheritance hierarchy, returns the first one found."/> +Attribute | None } description="The matching attribute if found, None otherwise. If multiple attributes with the same name exist in the inheritance hierarchy, returns the first one found."/> ### get_component @@ -497,7 +514,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSClass ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSClass ] | None } description="The matching JSX element if found, None otherwise."/> ### get_import_string @@ -549,7 +566,7 @@ Returns a specific method by name from the class or any of its superclasses. -Function | None } description="The method if found, None otherwise."/> +Function | None } description="The method if found, None otherwise."/> ### get_name @@ -557,7 +574,7 @@ 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."/> +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."/> ### get_nested_class @@ -574,7 +591,7 @@ Returns a nested class by name from the current class. -TSClass | None } description="The nested class if found, None otherwise."/> +TSClass | None } description="The nested class if found, None otherwise."/> ### get_parameter @@ -591,7 +608,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -608,7 +625,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -625,7 +642,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_parent_class @@ -642,7 +659,7 @@ Returns the parent class node with the specified name. -Editable | None } description="The matching parent class node, or None if no match is found."/> +Editable | None } description="The matching parent class node, or None if no match is found."/> ### get_variable_usages @@ -665,7 +682,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -763,7 +780,7 @@ Checks if the class inherits from a specified parent class. str | Class } + type={ <>str | Class } description="The parent class to check for. Can be specified either as a class name string or Class object." defaultValue="" /> @@ -813,7 +830,7 @@ Retrieves all methods that exist on this Class, including methods from superclas -list[ Function ] | MultiLineCollection [ Function , TSClass ] } description=""/> +list[ Function ] | MultiLineCollection [ Function , TSClass ] } description=""/> ### move_to_file @@ -850,7 +867,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -890,6 +907,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -957,7 +997,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -985,7 +1025,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -1102,7 +1142,7 @@ Returns all classes which subclass this class. -list[ Class ] } description="A list of Class objects that inherit from this class."/> +list[ Class ] } description="A list of Class objects that inherit from this class."/> ### superclasses @@ -1119,41 +1159,41 @@ Returns a list of all classes that this class extends, up to max_depth. -list[ Class | ExternalModule | Interface] } description="A list of all superclass symbols in MRO order, up to max_depth. Returns an empty list if the class has no parent classes."/> +list[ Class | ExternalModule | Interface] } description="A list of all superclass symbols in MRO order, up to max_depth. Returns an empty list if the class has no parent classes."/> ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSCodeBlock.mdx b/docs/api-reference/typescript/TSCodeBlock.mdx index 96621d023..030f450f4 100644 --- a/docs/api-reference/typescript/TSCodeBlock.mdx +++ b/docs/api-reference/typescript/TSCodeBlock.mdx @@ -20,19 +20,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### assignment_statements -list[ AssignmentStatement [ TSCodeBlock , Assignment ]] } description="Returns list of top level assignment statements in the code block." /> +list[ AssignmentStatement [ TSCodeBlock , Assignment ]] } description="Returns list of top level assignment statements in the code block." /> ### assignments -list[ Assignment [ Editable , TSCodeBlock ]] } description="Returns all assignments in the code block across all nesting levels." /> +list[ Assignment [ Editable , TSCodeBlock ]] } description="Returns all assignments in the code block across all nesting levels." /> ### attributes -list[ Attribute [ Editable , TSCodeBlock ]] } description="Returns a list of top level class attribute statements in the code block." /> +list[ Attribute [ Editable , TSCodeBlock ]] } description="Returns a list of top level class attribute statements in the code block." /> ### comments -list[ Comment [ Editable , TSCodeBlock ]] } description="Gets list of top level comments in the code block." /> +list[ Comment [ Editable , TSCodeBlock ]] } description="Gets list of top level comments in the code block." /> ### extended @@ -57,11 +57,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls in the code block." /> +list[ FunctionCall ] } description="Returns a list of all function calls in the code block." /> ### if_blocks -list[ IfBlockStatement [ TSCodeBlock ]] } description="Returns a list of top level if statements in the code block." /> +list[ IfBlockStatement [ TSCodeBlock ]] } description="Returns a list of top level if statements in the code block." /> ### level @@ -70,7 +70,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### local_var_assignments -list[ Assignment [ Editable , TSCodeBlock ]] } description="Returns all local variable assignment in the code block, for all nest levels." /> +list[ Assignment [ Editable , TSCodeBlock ]] } description="Returns all local variable assignment in the code block, for all nest levels." /> ### node_type @@ -84,28 +84,28 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_statements -list[ ReturnStatement [ TSCodeBlock ]] } description="Gets all return statements at the top level of the code block." /> +list[ ReturnStatement [ TSCodeBlock ]] } description="Gets all return statements at the top level of the code block." /> ### source @@ -113,11 +113,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### statements -MultiLineCollection [ Statement , TSCodeBlock ] } description="Gets a view of the top-level statements in the code block." /> +MultiLineCollection [ Statement , TSCodeBlock ] } description="Gets a view of the top-level statements in the code block." /> ### symbol_statements -list[ SymbolStatement ] } description="Returns list of top level symbol statements in the code block." /> +list[ SymbolStatement ] } description="Returns list of top level symbol statements in the code block." /> ### ts_node @@ -126,7 +126,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -136,7 +136,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -194,7 +194,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -217,7 +217,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -225,7 +225,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSCodeBlock ] } description=""/> +CodeFlag[ TSCodeBlock ] } description=""/> ### get_assignments @@ -242,7 +242,7 @@ Returns a list of assignments with the specified variable name. -list[ Assignment [ Editable , TSCodeBlock ]] } description="A list of Assignment objects that match the variable name."/> +list[ Assignment [ Editable , TSCodeBlock ]] } description="A list of Assignment objects that match the variable name."/> ### get_attributes @@ -259,7 +259,7 @@ Returns attributes from the code block, with the option to include or exclude pr -list[ Attribute [ Editable , TSCodeBlock ]] } description="A list of attribute statements matching the privacy criteria."/> +list[ Attribute [ Editable , TSCodeBlock ]] } description="A list of attribute statements matching the privacy criteria."/> ### get_comment @@ -276,7 +276,7 @@ Gets the first comment statement containing a specific text string. -Comment [ Editable , TSCodeBlock ] | None } description="The first comment statement containing the search text, or None if no matching comment is found."/> +Comment [ Editable , TSCodeBlock ] | None } description="The first comment statement containing the search text, or None if no matching comment is found."/> ### get_local_var_assignment @@ -293,7 +293,7 @@ Returns the first code statement that assigns a local variable with the specifie -Assignment [ Editable , TSCodeBlock ] | None } description="The first matching local variable assignment, or None if no match is found."/> +Assignment [ Editable , TSCodeBlock ] | None } description="The first matching local variable assignment, or None if no match is found."/> ### get_local_var_assignments @@ -316,7 +316,7 @@ Returns all instances of local variable assignments that match the specified var -list[ Assignment [ Editable , TSCodeBlock ]] } description="List of Assignment objects representing local variable assignments that match the specified name criteria."/> +list[ Assignment [ Editable , TSCodeBlock ]] } description="List of Assignment objects representing local variable assignments that match the specified name criteria."/> ### get_statements @@ -326,7 +326,7 @@ Returns all statements of a given type up to the specified block level. StatementType | None } + type={ <>StatementType | None } description="The type of statements to return. If None, returns all statement types." defaultValue="None" /> @@ -339,7 +339,7 @@ Returns all statements of a given type up to the specified block level. -list[ Statement [ TSCodeBlock ]] } description=""/> +list[ Statement [ TSCodeBlock ]] } description=""/> ### get_variable_usages @@ -362,7 +362,7 @@ Returns all instances of variable usages in a code block. -list[ Editable [ TSCodeBlock ]] } description="A sorted list of variable usage instances as Editable objects."/> +list[ Editable [ TSCodeBlock ]] } description="A sorted list of variable usage instances as Editable objects."/> ### indent @@ -382,6 +382,35 @@ Adjusts the indentation level of the entire code block. None } description=""/> +### insert_after +Inserts source code at the bottom of the code block. + + + +str } + description="The source code to insert." + defaultValue="" +/> +bool } + description="Whether to fix the indentation of the inserted code. Defaults to True." + defaultValue="True" +/> +bool } + description="Whether to add a newline before the inserted code. Defaults to True." + defaultValue="True" +/> + + + +None } description=""/> + + ### insert_before Inserts new source code at the top of the code block. @@ -412,7 +441,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -548,7 +577,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### unwrap diff --git a/docs/api-reference/typescript/TSComment.mdx b/docs/api-reference/typescript/TSComment.mdx index 9324d004f..0180104da 100644 --- a/docs/api-reference/typescript/TSComment.mdx +++ b/docs/api-reference/typescript/TSComment.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -53,11 +53,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns a list of nested code blocks within the statement." /> +list[ CodeBlock ] } description="Returns a list of nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSComment ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSComment ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -105,7 +105,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -115,7 +115,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### clean_comment @@ -207,7 +207,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -230,7 +230,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -238,7 +238,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSComment ] } description=""/> +CodeFlag[ TSComment ] } description=""/> ### generate_comment @@ -296,7 +296,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -394,7 +394,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -501,7 +501,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSCommentGroup.mdx b/docs/api-reference/typescript/TSCommentGroup.mdx index 39d9ae282..0c0ef3053 100644 --- a/docs/api-reference/typescript/TSCommentGroup.mdx +++ b/docs/api-reference/typescript/TSCommentGroup.mdx @@ -50,15 +50,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -72,15 +72,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### source @@ -88,7 +88,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### text @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -186,7 +186,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -209,7 +209,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -217,7 +217,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSCommentGroup ] } description=""/> +CodeFlag[ TSCommentGroup ] } description=""/> ### get_variable_usages @@ -240,7 +240,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -338,7 +338,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -439,7 +439,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/typescript/TSConditionalType.mdx b/docs/api-reference/typescript/TSConditionalType.mdx index 54e84002d..a5d7c7a05 100644 --- a/docs/api-reference/typescript/TSConditionalType.mdx +++ b/docs/api-reference/typescript/TSConditionalType.mdx @@ -24,12 +24,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative -TSType[ TSConditionalType ] } description=" +TSType[ TSConditionalType ] } description=" " /> ### consequence -TSType[ TSConditionalType ] } description=" +TSType[ TSConditionalType ] } description=" " /> ### extended @@ -55,11 +55,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### left -TSType[ TSConditionalType ] } description=" +TSType[ TSConditionalType ] } description=" " /> ### node_type @@ -74,23 +74,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### right -TSType[ TSConditionalType ] } description=" +TSType[ TSConditionalType ] } description=" " /> ### source @@ -104,7 +104,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -114,7 +114,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -172,7 +172,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -195,7 +195,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -203,7 +203,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSConditionalType ] } description=""/> +CodeFlag[ TSConditionalType ] } description=""/> ### get_variable_usages @@ -226,7 +226,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -431,7 +431,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSConfig.mdx b/docs/api-reference/typescript/TSConfig.mdx index 50f6427c9..4b234a1d8 100644 --- a/docs/api-reference/typescript/TSConfig.mdx +++ b/docs/api-reference/typescript/TSConfig.mdx @@ -18,7 +18,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### base_config -TSConfig | None } description="Returns the base TSConfig that this config inherits from." /> +TSConfig | None } description="Returns the base TSConfig that this config inherits from." /> ### base_url @@ -57,7 +57,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### references -list[ Directory | File ] } description="Returns a list of directories that this TypeScript configuration file depends on." /> +list[ Directory | File ] } description="Returns a list of directories that this TypeScript configuration file depends on." /> ### root_dir diff --git a/docs/api-reference/typescript/TSDecorator.mdx b/docs/api-reference/typescript/TSDecorator.mdx index 59f4c0b39..9baa4448b 100644 --- a/docs/api-reference/typescript/TSDecorator.mdx +++ b/docs/api-reference/typescript/TSDecorator.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call -FunctionCall | None } description="Retrieves the function call expression associated with the decorator." /> +FunctionCall | None } description="Retrieves the function call expression associated with the decorator." /> ### extended @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,7 +92,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -102,7 +102,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -160,7 +160,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -183,7 +183,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -191,7 +191,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSDecorator ] } description=""/> +CodeFlag[ TSDecorator ] } description=""/> ### get_name @@ -199,7 +199,7 @@ 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."/> +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."/> ### get_variable_usages @@ -222,7 +222,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -320,7 +320,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -444,7 +444,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSDict.mdx b/docs/api-reference/typescript/TSDict.mdx index b5eb9c37c..39dfe4a9d 100644 --- a/docs/api-reference/typescript/TSDict.mdx +++ b/docs/api-reference/typescript/TSDict.mdx @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -55,19 +55,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -80,12 +80,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### unpack -Unpack [ TSObjectType ] | None } description=" +Unpack [ TSObjectType ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -153,7 +153,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -176,7 +176,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSDict ] } description=""/> +CodeFlag[ TSDict ] } description=""/> ### get_variable_usages @@ -207,7 +207,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -412,7 +412,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSEnum.mdx b/docs/api-reference/typescript/TSEnum.mdx index f8d00a7da..37f4c6315 100644 --- a/docs/api-reference/typescript/TSEnum.mdx +++ b/docs/api-reference/typescript/TSEnum.mdx @@ -20,11 +20,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### attributes -list[ TSAttribute [ TSEnum , None]] } description="Property that retrieves the attributes of a TypeScript enum." /> +list[ TSAttribute [ TSEnum , None]] } description="Property that retrieves the attributes of a TypeScript enum." /> ### body -Expression [ TSEnum ] } description=" +Expression [ TSEnum ] } description=" " /> ### code_block @@ -34,23 +34,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -62,7 +62,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### has_semicolon @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_decorated @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSEnum ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSEnum ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -129,23 +129,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -163,7 +163,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -226,12 +226,29 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -289,7 +306,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -312,7 +329,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -320,7 +337,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSEnum ] } description=""/> +CodeFlag[ TSEnum ] } description=""/> ### get_attribute @@ -337,7 +354,7 @@ Returns an attribute from the TypeScript enum by its name. -TSAttribute | None } description="The attribute with the given name if it exists, None otherwise."/> +TSAttribute | None } description="The attribute with the given name if it exists, None otherwise."/> ### get_component @@ -354,7 +371,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSEnum ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSEnum ] | None } description="The matching JSX element if found, None otherwise."/> ### get_import_string @@ -397,7 +414,7 @@ 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."/> +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."/> ### get_variable_usages @@ -420,7 +437,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -553,7 +570,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -593,6 +610,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -660,7 +700,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -688,7 +728,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -793,36 +833,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSExport.mdx b/docs/api-reference/typescript/TSExport.mdx index 32a636cf6..4af9cdd10 100644 --- a/docs/api-reference/typescript/TSExport.mdx +++ b/docs/api-reference/typescript/TSExport.mdx @@ -20,19 +20,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### declared_symbol -TSSymbol | TSImport | None } description="Returns the symbol that was defined in this export." /> +TSSymbol | TSImport | None } description="Returns the symbol that was defined in this export." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### descendant_symbols -list[ Importable ] } description="Returns a list of all descendant symbols from this export's declared symbol." /> +list[ Importable ] } description="Returns a list of all descendant symbols from this export's declared symbol." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### export_statement @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### exported_symbol -Exportable | None } description="Returns the symbol, file, or import being exported from this export object." /> +Exportable | None } description="Returns the symbol, file, or import being exported from this export object." /> ### extended @@ -74,7 +74,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### is_exported @@ -104,23 +104,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_symbol -Exportable | None } description="Returns the Symbol, SourceFile or External module that this export resolves to." /> +Exportable | None } description="Returns the Symbol, SourceFile or External module that this export resolves to." /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -133,11 +133,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -147,7 +147,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -205,7 +205,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -228,7 +228,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -236,7 +236,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSExport ] } description=""/> +CodeFlag[ TSExport ] } description=""/> ### get_import_string @@ -279,7 +279,7 @@ 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."/> +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."/> ### get_variable_usages @@ -302,7 +302,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -490,7 +490,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -506,7 +506,7 @@ 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."/> +TSImport | None } description="The import object being re-exported, or None if this is not a re-export or no import was found."/> ### remove @@ -538,6 +538,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -605,7 +628,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -644,19 +667,19 @@ Sets the value of the node's value Expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### to_import_string @@ -669,19 +692,19 @@ Converts this export into its equivalent import string representation. ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSExpressionType.mdx b/docs/api-reference/typescript/TSExpressionType.mdx index 35b2f4fa0..f87150185 100644 --- a/docs/api-reference/typescript/TSExpressionType.mdx +++ b/docs/api-reference/typescript/TSExpressionType.mdx @@ -24,7 +24,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### expression -Expression [ TSExpressionType [ Editable ]] } description="The expression to evaluate that yields the type" /> +Expression [ TSExpressionType [ Editable ]] } description="The expression to evaluate that yields the type" /> ### extended @@ -53,7 +53,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -164,7 +164,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -187,7 +187,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSExpressionType ] } description=""/> +CodeFlag[ TSExpressionType ] } description=""/> ### get_name @@ -203,7 +203,7 @@ 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."/> +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."/> ### get_variable_usages @@ -226,7 +226,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -448,7 +448,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSFile.mdx b/docs/api-reference/typescript/TSFile.mdx index cbaa47c7b..4d6111058 100644 --- a/docs/api-reference/typescript/TSFile.mdx +++ b/docs/api-reference/typescript/TSFile.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### classes -list[ Class ] } description="Returns all Classes in the file." /> +list[ Class ] } description="Returns all Classes in the file." /> ### code_block @@ -33,31 +33,31 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### default_exports -list[ TSExport ] } description="Returns all default export symbols from the file." /> +list[ TSExport ] } description="Returns all default export symbols from the file." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### directory -Directory | None } description="Returns the directory that contains this file." /> +Directory | None } description="Returns the directory that contains this file." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### export_statements -list[ ExportStatement [ TSExport ]] } description="Returns a list of all export statements in the file." /> +list[ ExportStatement [ TSExport ]] } description="Returns a list of all export statements in the file." /> ### exported_name @@ -65,7 +65,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### exports -list[ TSExport ] } description="Returns all Export symbols in the file." /> +list[ TSExport ] } description="Returns all Export symbols in the file." /> ### extended @@ -103,15 +103,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### functions -list[ Function ] } description="Returns all Functions in the file." /> +list[ Function ] } description="Returns all Functions in the file." /> ### global_vars -list[ Assignment ] } description="Returns all GlobalVars in the file." /> +list[ Assignment ] } description="Returns all GlobalVars in the file." /> ### import_module_name @@ -119,23 +119,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### import_statements -list[ ImportStatement ] } description="Returns all ImportStatements in the file, where each import statement can contain" /> +list[ ImportStatement ] } description="Returns all ImportStatements in the file, where each import statement can contain" /> ### importers -list[ Import ] } description="Returns all imports that directly imports this file as a module." /> +list[ Import ] } description="Returns all imports that directly imports this file as a module." /> ### imports -list[ Import ] } description="List of all Imports in this file." /> +list[ Import ] } description="List of all Imports in this file." /> ### inbound_imports -list[ Import ] } description="Returns all imports that are importing symbols contained in this file." /> +list[ Import ] } description="Returns all imports that are importing symbols contained in this file." /> ### interfaces -list[ TSInterface ] } description="Returns all Interfaces in the file." /> +list[ TSInterface ] } description="Returns all Interfaces in the file." /> ### is_binary @@ -155,7 +155,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSFile ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSFile ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -163,7 +163,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### named_exports -list[ TSExport ] } description="Returns the named exports declared in the file." /> +list[ TSExport ] } description="Returns the named exports declared in the file." /> ### node_type @@ -181,15 +181,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### path @@ -203,7 +203,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -215,11 +215,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols_sorted_topologically -list[ Symbol ] } description="Returns all Symbols in the file, sorted topologically (parents first). Robust to" /> +list[ Symbol ] } description="Returns all Symbols in the file, sorted topologically (parents first). Robust to" /> ### ts_config -TSConfig | None } description=" +TSConfig | None } description=" " /> ### ts_node @@ -229,11 +229,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### types -list[ TSTypeAlias ] } description="Returns all type aliases in the file." /> +list[ TSTypeAlias ] } description="Returns all type aliases in the file." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -295,6 +295,29 @@ Adds import to the file from a string representation of an import statement. None } description=""/> +### add_symbol +Adds `symbol` to the file. + + + +Symbol } + description="The symbol to add to the file." + defaultValue="" +/> +bool, optional } + description="Whether to export the symbol. Defaults to True." + defaultValue="True" +/> + + + +Symbol | None } description="The existing symbol if it already exists in the file or None if it was added."/> + + ### add_symbol_from_source Adds a symbol to a file from a string representation. @@ -312,12 +335,47 @@ Adds a symbol to a file from a string representation. None } description="The symbol is added directly to the file's content."/> +### add_symbol_import +Adds an import to a file for a given symbol. + + + +Symbol } + description="The symbol to import." + defaultValue="" +/> +str | None } + description="Optional alias for the imported symbol. Defaults to None." + defaultValue="None" +/> +ImportType } + description="The type of import to use. Defaults to ImportType.UNKNOWN." + defaultValue="ImportType.UNKNOWN" +/> +bool } + description="Whether this is a type-only import. Defaults to False." + defaultValue="False" +/> + + + +Import | None } description="The existing import for the symbol or None if it was added."/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -375,7 +433,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_by_byte_range @@ -392,7 +450,7 @@ Finds all editable objects that overlap with the given byte range in the file. -list[ Editable ] } description="A list of all Editable objects that overlap with the given range."/> +list[ Editable ] } description="A list of all Editable objects that overlap with the given range."/> ### find_string_literals @@ -415,7 +473,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -423,7 +481,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSFile ] } description=""/> +CodeFlag[ TSFile ] } description=""/> ### get_class @@ -440,7 +498,7 @@ Returns a specific Class by full name. Returns None if not found. -Class | None } description="The matching Class object if found, None otherwise."/> +Class | None } description="The matching Class object if found, None otherwise."/> ### get_component @@ -457,7 +515,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSFile ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSFile ] | None } description="The matching JSX element if found, None otherwise."/> ### get_config @@ -465,7 +523,7 @@ Returns the nearest tsconfig.json applicable to this file. -TSConfig | None } description="The TypeScript configuration object if found, None otherwise."/> +TSConfig | None } description="The TypeScript configuration object if found, None otherwise."/> ### get_export @@ -482,7 +540,7 @@ Returns an export object with the specified name from the file. -TSExport | None } description="The export object if found, None otherwise."/> +TSExport | None } description="The export object if found, None otherwise."/> ### get_export_statement_for_path @@ -505,7 +563,7 @@ Gets the first export of specified type that contains the given path in single o -ExportStatement | None } description="The first matching export if found, None otherwise."/> +ExportStatement | None } description="The first matching export if found, None otherwise."/> ### get_extensions @@ -530,7 +588,7 @@ Returns a specific Function by name. -Function | None } description="The matching Function object if found, None otherwise."/> +Function | None } description="The matching Function object if found, None otherwise."/> ### get_global_var @@ -547,7 +605,7 @@ Returns a specific global var by name. Returns None if not found. -Assignment | None } description="The global variable if found, None otherwise."/> +Assignment | None } description="The global variable if found, None otherwise."/> ### get_import @@ -564,7 +622,7 @@ Returns the import with matching alias. Returns None if not found. -Import | None } description="The import statement with the matching alias if found, None otherwise."/> +Import | None } description="The import statement with the matching alias if found, None otherwise."/> ### get_import_string @@ -616,7 +674,7 @@ Retrieves a specific interface from the file by its name. -TSInterface | None } description="The interface with the specified name if found, None otherwise."/> +TSInterface | None } description="The interface with the specified name if found, None otherwise."/> ### get_name @@ -624,7 +682,7 @@ 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."/> +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."/> ### get_namespace @@ -641,7 +699,7 @@ Returns a specific namespace by name from the file's namespaces. -TSNamespace | None } description="The namespace with the specified name if found, None otherwise."/> +TSNamespace | None } description="The namespace with the specified name if found, None otherwise."/> ### get_symbol @@ -658,7 +716,7 @@ Gets a symbol by its name from the file. -Symbol | None } description="The found symbol, or None if not found."/> +Symbol | None } description="The found symbol, or None if not found."/> ### get_type @@ -675,7 +733,7 @@ Returns a specific Type by name from the file's types. -TSTypeAlias | None } description="The TypeScript type alias with the matching name, or None if not found."/> +TSTypeAlias | None } description="The TypeScript type alias with the matching name, or None if not found."/> ### get_variable_usages @@ -698,7 +756,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### has_export_statement_for_path @@ -836,7 +894,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -863,6 +921,29 @@ Removes unused exports from the file. None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -930,7 +1011,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring @@ -1010,19 +1091,19 @@ Determines if a TypeScript symbol can be added to this file based on its type an ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### symbols @@ -1030,24 +1111,41 @@ 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"/> +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"/> + + +### update_filepath +Updates the file path of the current file and all associated imports. + + + +str } + description="The new file path to move the file to." + defaultValue="" +/> + + + +None } description=""/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSForLoopStatement.mdx b/docs/api-reference/typescript/TSForLoopStatement.mdx index d9b4f562b..c5daade81 100644 --- a/docs/api-reference/typescript/TSForLoopStatement.mdx +++ b/docs/api-reference/typescript/TSForLoopStatement.mdx @@ -29,20 +29,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ TSForLoopStatement ] | None } description="The condition for the loop. Applicable for traditional for loops." /> +Expression [ TSForLoopStatement ] | None } description="The condition for the loop. Applicable for traditional for loops." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -67,11 +67,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Retrieves all function calls within a for loop statement." /> +list[ FunctionCall ] } description="Retrieves all function calls within a for loop statement." /> ### increment -Expression [ TSForLoopStatement ] | None } description="The increment expression. Applicable for traditional for loops." /> +Expression [ TSForLoopStatement ] | None } description="The increment expression. Applicable for traditional for loops." /> ### index @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### initializer -Expression [ TSForLoopStatement ] | None } description="The counter variable. Applicable for traditional for loops." /> +Expression [ TSForLoopStatement ] | None } description="The counter variable. Applicable for traditional for loops." /> ### is_decorated @@ -91,23 +91,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### item -Expression [ TSForLoopStatement ] | None } description="An item in the iterable object. Only applicable for `for...of` loops." /> +Expression [ TSForLoopStatement ] | None } description="An item in the iterable object. Only applicable for `for...of` loops." /> ### iterable -Expression [ TSForLoopStatement ] | None } description="The iterable that is being iterated over. Only applicable for `for...of` loops." /> +Expression [ TSForLoopStatement ] | None } description="The iterable that is being iterated over. Only applicable for `for...of` loops." /> ### jsx_elements -list[ JSXElement [ TSForLoopStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSForLoopStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSForLoopStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSForLoopStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -121,19 +121,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -151,7 +151,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -184,7 +184,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -242,7 +242,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -265,7 +265,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -273,7 +273,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSForLoopStatement ] } description=""/> +CodeFlag[ TSForLoopStatement ] } description=""/> ### get_component @@ -290,7 +290,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSForLoopStatement ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSForLoopStatement ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -313,7 +313,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -411,7 +411,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -518,7 +518,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/TSFunction.mdx b/docs/api-reference/typescript/TSFunction.mdx index 801dde000..9e2fd567a 100644 --- a/docs/api-reference/typescript/TSFunction.mdx +++ b/docs/api-reference/typescript/TSFunction.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 [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) @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### call_sites -list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> +list[ FunctionCall ] } description="Returns all call sites (invocations) of this callable in the codebase." /> ### code_block @@ -28,23 +28,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -81,7 +81,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the function and its parameters." /> +list[ FunctionCall ] } description="Gets all function calls within the function and its parameters." /> ### function_signature @@ -101,7 +101,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_anonymous @@ -157,7 +157,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSFunction ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSFunction ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -165,7 +165,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_functions -list[ Function ] } description="Returns a list of nested functions defined within this function's code block." /> +list[ Function ] } description="Returns a list of nested functions defined within this function's code block." /> ### node_type @@ -174,7 +174,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -SymbolGroup [ Parameter , TSFunction ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> +SymbolGroup [ Parameter , TSFunction ] | list[ Parameter ] } description="Retrieves all parameters of a callable symbol." /> ### parent @@ -183,32 +183,32 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_statements -list[ ReturnStatement ] } description="Returns a list of all return statements within this function's body." /> +list[ ReturnStatement ] } description="Returns a list of all return statements within this function's body." /> ### return_type -Type | Placeholder[ ExternalModule ] } description=" +Type | Placeholder [ ExternalModule ] } description=" " /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -226,12 +226,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -294,9 +294,26 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### add_statements Adds statements to the end of a function body. - + -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### arrow_to_named @@ -346,7 +363,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=""/> @@ -407,7 +424,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -430,7 +447,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -438,7 +455,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSFunction ] } description=""/> +CodeFlag[ TSFunction ] } description=""/> ### get_component @@ -455,7 +472,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSFunction ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSFunction ] | None } description="The matching JSX element if found, None otherwise."/> ### get_import_string @@ -498,7 +515,7 @@ 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."/> +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."/> ### get_parameter @@ -515,7 +532,7 @@ Gets a specific parameter from the callable's parameters list by name. -Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> +Parameter | None } description="The parameter with the specified name, or None if no parameter with that name exists or if there are no parameters."/> ### get_parameter_by_index @@ -532,7 +549,7 @@ Returns the parameter at the given index. -Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> +Parameter | None } description="The parameter at the specified index, or None if the parameter list is empty or the index does not exist."/> ### get_parameter_by_type @@ -549,7 +566,7 @@ Retrieves a parameter from the callable by its type. -Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> +Parameter | None } description="The parameter with the specified type, or None if no parameter is found or if the callable has no parameters."/> ### get_variable_usages @@ -572,7 +589,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -663,9 +680,32 @@ Inserts text before the current symbol node in the Abstract Syntax Tree. None } description=""/> +### insert_statements +Inserts lines of code into the function body at the specified index. + + + +str } + description="The code lines to insert into the function body." + defaultValue="" +/> +int, optional } + description="The position in the function body where the lines should be inserted. Defaults to 0." + defaultValue="0" +/> + + + +None } description=""/> + + ### is_valid_node Determines if a given tree-sitter node corresponds to a valid function type. - + -Editable | None } description=""/> +Editable | None } description=""/> ### prepend_statements Prepends the provided code to the beginning of the function body. - + None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### rename_local_variable Renames a local variable and all its usages within a function body. @@ -875,7 +938,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -903,7 +966,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -1025,36 +1088,36 @@ Sets the return type annotation for the function. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSFunctionType.mdx b/docs/api-reference/typescript/TSFunctionType.mdx index 602caac4f..87596020c 100644 --- a/docs/api-reference/typescript/TSFunctionType.mdx +++ b/docs/api-reference/typescript/TSFunctionType.mdx @@ -48,7 +48,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -62,7 +62,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -Collection[ TSParameter , TSFunctionType ] } description="Retrieves the parameters of a function type." /> +Collection[ TSParameter , TSFunctionType ] } description="Retrieves the parameters of a function type." /> ### parent @@ -71,23 +71,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### return_type -TSType[ TSFunctionType ] | TSReturnTypePlaceholder [ TSFunctionType ] } description="Return type of the function." /> +TSType[ TSFunctionType ] | TSReturnTypePlaceholder [ TSFunctionType ] } description="Return type of the function." /> ### source @@ -100,7 +100,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -110,7 +110,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### asyncify @@ -176,7 +176,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -199,7 +199,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -207,7 +207,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSFunctionType ] } description=""/> +CodeFlag[ TSFunctionType ] } description=""/> ### get_variable_usages @@ -230,7 +230,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -328,7 +328,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -435,7 +435,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSGenericType.mdx b/docs/api-reference/typescript/TSGenericType.mdx index d7f6d1837..f16791f0f 100644 --- a/docs/api-reference/typescript/TSGenericType.mdx +++ b/docs/api-reference/typescript/TSGenericType.mdx @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -62,7 +62,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parameters -Collection[ Type , TSGenericType ] } description="Retrieves the generic type parameters associated with this type." /> +Collection[ Type , TSGenericType ] } description="Retrieves the generic type parameters associated with this type." /> ### parent @@ -71,19 +71,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -164,7 +164,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -187,7 +187,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -195,7 +195,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSGenericType ] } description=""/> +CodeFlag[ TSGenericType ] } description=""/> ### get_name @@ -203,7 +203,7 @@ 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."/> +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."/> ### get_variable_usages @@ -226,7 +226,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -324,7 +324,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -448,7 +448,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSHasBlock.mdx b/docs/api-reference/typescript/TSHasBlock.mdx index 2dac7c97d..f92d113b5 100644 --- a/docs/api-reference/typescript/TSHasBlock.mdx +++ b/docs/api-reference/typescript/TSHasBlock.mdx @@ -30,11 +30,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -59,7 +59,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### is_decorated @@ -67,7 +67,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSHasBlock ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSHasBlock ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### node_type @@ -81,19 +81,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -106,7 +106,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -139,7 +139,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -197,7 +197,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -220,7 +220,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -228,7 +228,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSHasBlock ] } description=""/> +CodeFlag[ TSHasBlock ] } description=""/> ### get_component @@ -245,7 +245,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSHasBlock ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSHasBlock ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -268,7 +268,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -366,7 +366,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -473,7 +473,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/TSIfBlockStatement.mdx b/docs/api-reference/typescript/TSIfBlockStatement.mdx index 24168cc71..5df54c9d9 100644 --- a/docs/api-reference/typescript/TSIfBlockStatement.mdx +++ b/docs/api-reference/typescript/TSIfBlockStatement.mdx @@ -30,11 +30,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative_blocks -list[ IfBlockStatement ] } description="Returns a list of alternative if/elif/else blocks for the current block." /> +list[ IfBlockStatement ] } description="Returns a list of alternative if/elif/else blocks for the current block." /> ### condition -Expression [ PyIfBlockStatement ] | None } description="The condition expression for the if block. None if the block is an else block." /> +Expression [ PyIfBlockStatement ] | None } description="The condition expression for the if block. None if the block is an else block." /> ### consequence_block @@ -42,7 +42,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### else_statement -IfBlockStatement | None } description="Returns the else block within the if-statement." /> +IfBlockStatement | None } description="Returns the else block within the if-statement." /> ### extended @@ -67,7 +67,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the if block statement and its alternative blocks." /> +list[ FunctionCall ] } description="Returns all function calls within the if block statement and its alternative blocks." /> ### index @@ -87,11 +87,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested code blocks within an if/elif/else statement block." /> +list[ CodeBlock ] } description="Returns all nested code blocks within an if/elif/else statement block." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSIfBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSIfBlockStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -105,19 +105,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -135,7 +135,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -145,7 +145,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -188,7 +188,7 @@ Returns all elif blocks within the if block. -list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> +list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> ### find @@ -211,7 +211,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -234,7 +234,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -242,7 +242,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSIfBlockStatement ] } description=""/> +CodeFlag[ TSIfBlockStatement ] } description=""/> ### get_variable_usages @@ -265,7 +265,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -363,7 +363,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -479,7 +479,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSImport.mdx b/docs/api-reference/typescript/TSImport.mdx index 8803fdf99..6b53da13e 100644 --- a/docs/api-reference/typescript/TSImport.mdx +++ b/docs/api-reference/typescript/TSImport.mdx @@ -20,16 +20,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alias -Editable | None } description=" +Editable | None } description=" " /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -58,7 +58,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### from_file -SourceFile | None } description="Returns the SourceFile that an Import is importing from." /> +SourceFile | None } description="Returns the SourceFile that an Import is importing from." /> ### full_name @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### import_specifier @@ -83,11 +83,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### imported_exports -list[ Exportable ] } description="Returns the enumerated list of exports imported from a module import." /> +list[ Exportable ] } description="Returns the enumerated list of exports imported from a module import." /> ### imported_symbol -Symbol | ExternalModule | SourceFile | Import | None } description="Returns the symbol directly being imported, including an indirect import and an External" /> +Symbol | ExternalModule | SourceFile | Import | None } description="Returns the symbol directly being imported, including an indirect import and an External" /> ### is_exported @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### module -Editable | None } description=" +Editable | None } description=" " /> ### name @@ -122,23 +122,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_symbol -Symbol | ExternalModule | TSFile | None } description="Returns the resolved symbol that the import is referencing." /> +Symbol | ExternalModule | TSFile | None } description="Returns the resolved symbol that the import is referencing." /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -146,7 +146,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbol_name -Editable | None } description="The name of the symbol being imported. For instance import a as b has a symbol_name of a." /> +Editable | None } description="The name of the symbol being imported. For instance import a as b has a symbol_name of a." /> ### to_file @@ -164,7 +164,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -174,7 +174,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -232,7 +232,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -255,7 +255,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -263,7 +263,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSImport ] } description=""/> +CodeFlag[ TSImport ] } description=""/> ### get_import_string @@ -306,7 +306,7 @@ 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."/> +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."/> ### get_variable_usages @@ -329,7 +329,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -501,7 +501,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -619,7 +619,7 @@ Resolves an import statement to its target file and symbol. -ImportResolution[ TSFile ] | None } description="An ImportResolution object containing the resolved file and symbol, or None if the import could not be resolved (treated as an external module). The ImportResolution contains: - from_file: The file being imported from - symbol: The specific symbol being imported (None for module imports) - imports_file: True if importing the entire file/module"/> +ImportResolution[ TSFile ] | None } description="An ImportResolution object containing the resolved file and symbol, or None if the import could not be resolved (treated as an external module). The ImportResolution contains: - from_file: The file being imported from - symbol: The specific symbol being imported (None for module imports) - imports_file: True if importing the entire file/module"/> ### search @@ -648,7 +648,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_import_module @@ -704,36 +704,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSImportStatement.mdx b/docs/api-reference/typescript/TSImportStatement.mdx index ff9df1c64..33d8ccfb1 100644 --- a/docs/api-reference/typescript/TSImportStatement.mdx +++ b/docs/api-reference/typescript/TSImportStatement.mdx @@ -50,11 +50,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### imports -Collection[ Import , PyImportStatement ] } description="A collection of the individual imports this statement represents" /> +Collection[ Import , PyImportStatement ] } description="A collection of the individual imports this statement represents" /> ### index @@ -62,11 +62,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSImportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSImportStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -80,19 +80,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -110,7 +110,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -178,7 +178,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -201,7 +201,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSImportStatement ] } description=""/> +CodeFlag[ TSImportStatement ] } description=""/> ### get_variable_usages @@ -232,7 +232,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -330,7 +330,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSInterface.mdx b/docs/api-reference/typescript/TSInterface.mdx index fd0409ea9..a0ef4dc9b 100644 --- a/docs/api-reference/typescript/TSInterface.mdx +++ b/docs/api-reference/typescript/TSInterface.mdx @@ -25,7 +25,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### attributes -list[ TSAttribute ] } description="Retrieves the list of attributes defined in the TypeScript interface." /> +list[ TSAttribute ] } description="Retrieves the list of attributes defined in the TypeScript interface." /> ### code_block @@ -33,23 +33,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -61,7 +61,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -86,7 +86,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### has_semicolon @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_decorated @@ -110,7 +110,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSInterface ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSInterface ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -128,27 +128,27 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_interfaces -Parents[ Type , TSInterface ] | None } description="All the interfaces that this interface extends." /> +Parents[ Type , TSInterface ] | None } description="All the interfaces that this interface extends." /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -166,12 +166,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -234,12 +234,29 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -305,7 +322,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -328,7 +345,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -336,7 +353,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSInterface ] } description=""/> +CodeFlag[ TSInterface ] } description=""/> ### get_attribute @@ -344,7 +361,7 @@ Returns the attribute with the given name, if it exists. -Attribute | None } description=""/> +Attribute | None } description=""/> ### get_component @@ -361,7 +378,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSInterface ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSInterface ] | None } description="The matching JSX element if found, None otherwise."/> ### get_import_string @@ -404,7 +421,7 @@ 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."/> +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."/> ### get_variable_usages @@ -427,7 +444,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### implementations @@ -435,7 +452,7 @@ Returns all classes and interfaces that implement a given interface. -list[Interface | Class ] } description=""/> +list[Interface | Class ] } description=""/> ### insert_after @@ -568,7 +585,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -608,6 +625,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -675,7 +715,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -703,7 +743,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -808,36 +848,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSLabeledStatement.mdx b/docs/api-reference/typescript/TSLabeledStatement.mdx index 268be2e42..984eff892 100644 --- a/docs/api-reference/typescript/TSLabeledStatement.mdx +++ b/docs/api-reference/typescript/TSLabeledStatement.mdx @@ -36,7 +36,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### body -Expression | None } description=" +Expression | None } description=" " /> ### extended @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -82,11 +82,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ Editable ] } description="Returns all nested code blocks within the statement." /> +list[ Editable ] } description="Returns all nested code blocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSLabeledStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSLabeledStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -100,19 +100,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -140,7 +140,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -198,7 +198,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -221,7 +221,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -229,7 +229,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSLabeledStatement ] } description=""/> +CodeFlag[ TSLabeledStatement ] } description=""/> ### get_name @@ -237,7 +237,7 @@ 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."/> +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."/> ### get_variable_usages @@ -260,7 +260,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -358,7 +358,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -482,7 +482,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSLookupType.mdx b/docs/api-reference/typescript/TSLookupType.mdx index 932d8765c..80ed73d23 100644 --- a/docs/api-reference/typescript/TSLookupType.mdx +++ b/docs/api-reference/typescript/TSLookupType.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### lookup @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -92,12 +92,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -TSType[ TSLookupType ] } description=" +TSType[ TSLookupType ] } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -165,7 +165,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -188,7 +188,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSLookupType ] } description=""/> +CodeFlag[ TSLookupType ] } description=""/> ### get_variable_usages @@ -219,7 +219,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -424,7 +424,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSNamedType.mdx b/docs/api-reference/typescript/TSNamedType.mdx index c8296b9bb..1e3e5c33c 100644 --- a/docs/api-reference/typescript/TSNamedType.mdx +++ b/docs/api-reference/typescript/TSNamedType.mdx @@ -48,7 +48,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -66,19 +66,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -101,7 +101,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -159,7 +159,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -182,7 +182,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -190,7 +190,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSNamedType ] } description=""/> +CodeFlag[ TSNamedType ] } description=""/> ### get_name @@ -198,7 +198,7 @@ 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."/> +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."/> ### get_variable_usages @@ -221,7 +221,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -319,7 +319,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -443,7 +443,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name diff --git a/docs/api-reference/typescript/TSNamespace.mdx b/docs/api-reference/typescript/TSNamespace.mdx index 5c071667e..9d3d19adf 100644 --- a/docs/api-reference/typescript/TSNamespace.mdx +++ b/docs/api-reference/typescript/TSNamespace.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### classes -list[ TSClass ] } description="Get all classes defined in this namespace." /> +list[ TSClass ] } description="Get all classes defined in this namespace." /> ### code_block @@ -29,23 +29,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -57,7 +57,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -82,11 +82,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### functions -list[ TSFunction ] } description="Get all functions defined in this namespace." /> +list[ TSFunction ] } description="Get all functions defined in this namespace." /> ### has_semicolon @@ -94,7 +94,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_decorated @@ -110,7 +110,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSNamespace ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSNamespace ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -128,23 +128,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -157,7 +157,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Symbol ] } description="Returns all symbols defined within this namespace, including nested ones." /> +list[ Symbol ] } description="Returns all symbols defined within this namespace, including nested ones." /> ### ts_node @@ -166,7 +166,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -229,12 +229,29 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -292,7 +309,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -315,7 +332,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -323,7 +340,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSNamespace ] } description=""/> +CodeFlag[ TSNamespace ] } description=""/> ### get_class @@ -331,7 +348,7 @@ Get a class by name from this namespace. -TSClass | None } description=""/> +TSClass | None } description=""/> ### get_component @@ -348,7 +365,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSNamespace ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSNamespace ] | None } description="The matching JSX element if found, None otherwise."/> ### get_enum @@ -356,7 +373,7 @@ Get an enum by name from this namespace. -TSEnum | None } description=""/> +TSEnum | None } description=""/> ### get_function @@ -364,7 +381,7 @@ Get a function by name from this namespace. -TSFunction | None } description="The found function, or None if not found"/> +TSFunction | None } description="The found function, or None if not found"/> ### get_import_string @@ -407,7 +424,7 @@ Get an interface by name from this namespace. -TSInterface | None } description=""/> +TSInterface | None } description=""/> ### get_name @@ -415,7 +432,7 @@ 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."/> +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."/> ### get_namespace @@ -423,7 +440,7 @@ Get a namespace by name from this namespace. -TSNamespace | None } description="The found namespace, or None if not found"/> +TSNamespace | None } description="The found namespace, or None if not found"/> ### get_nested_namespaces @@ -431,7 +448,7 @@ Get all nested namespaces within this namespace. -list[ TSNamespace ] } description="List of all nested namespace objects"/> +list[ TSNamespace ] } description="List of all nested namespace objects"/> ### get_symbol @@ -439,7 +456,7 @@ Get a symbol by name from this namespace. -Symbol | None } description="The found symbol, or None if not found"/> +Symbol | None } description="The found symbol, or None if not found"/> ### get_type @@ -447,7 +464,7 @@ Get a type alias by name from this namespace. -TSTypeAlias | None } description=""/> +TSTypeAlias | None } description=""/> ### get_variable_usages @@ -470,7 +487,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -603,7 +620,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -727,7 +744,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -755,7 +772,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -860,36 +877,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSObjectType.mdx b/docs/api-reference/typescript/TSObjectType.mdx index f5cdac30b..3a5abc4ab 100644 --- a/docs/api-reference/typescript/TSObjectType.mdx +++ b/docs/api-reference/typescript/TSObjectType.mdx @@ -47,7 +47,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -61,19 +61,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -86,12 +86,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### unpack -Unpack [ TSObjectType ] | None } description=" +Unpack [ TSObjectType ] | None } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -101,7 +101,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -159,7 +159,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -182,7 +182,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -190,7 +190,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSObjectType ] } description=""/> +CodeFlag[ TSObjectType ] } description=""/> ### get_variable_usages @@ -213,7 +213,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -311,7 +311,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -418,7 +418,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSPair.mdx b/docs/api-reference/typescript/TSPair.mdx index fafc74f5c..87fe99077 100644 --- a/docs/api-reference/typescript/TSPair.mdx +++ b/docs/api-reference/typescript/TSPair.mdx @@ -50,7 +50,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### key @@ -73,15 +73,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### shorthand @@ -98,11 +98,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -112,7 +112,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -170,7 +170,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -193,7 +193,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -201,7 +201,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSPair ] } description=""/> +CodeFlag[ TSPair ] } description=""/> ### get_variable_usages @@ -224,7 +224,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -322,7 +322,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -429,7 +429,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_value diff --git a/docs/api-reference/typescript/TSParameter.mdx b/docs/api-reference/typescript/TSParameter.mdx index 3e696e1f7..6cb9c5ec7 100644 --- a/docs/api-reference/typescript/TSParameter.mdx +++ b/docs/api-reference/typescript/TSParameter.mdx @@ -22,7 +22,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### 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) +[Parameter](/api-reference/core/Parameter), [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) ## Attributes @@ -32,7 +32,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### extended @@ -61,7 +61,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### index @@ -99,19 +99,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -124,15 +124,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> +Type | TypePlaceholder [ PyParameter ] } description="The type annotation associated with this node" /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -142,7 +142,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### convert_to_interface @@ -208,7 +208,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -231,7 +231,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -239,7 +239,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSParameter ] } description=""/> +CodeFlag[ TSParameter ] } description=""/> ### get_name @@ -247,7 +247,7 @@ 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."/> +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."/> ### get_variable_usages @@ -270,7 +270,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -368,7 +368,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -498,7 +498,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_name @@ -554,36 +554,36 @@ Sets the value of the node's value Expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSQueryType.mdx b/docs/api-reference/typescript/TSQueryType.mdx index e8aec772c..1fc0bacda 100644 --- a/docs/api-reference/typescript/TSQueryType.mdx +++ b/docs/api-reference/typescript/TSQueryType.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -63,24 +63,24 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### query -TSType[ TSQueryType ] } description=" +TSType[ TSQueryType ] } description=" " /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -93,7 +93,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -161,7 +161,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -184,7 +184,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -192,7 +192,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSQueryType ] } description=""/> +CodeFlag[ TSQueryType ] } description=""/> ### get_variable_usages @@ -215,7 +215,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -420,7 +420,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSReadonlyType.mdx b/docs/api-reference/typescript/TSReadonlyType.mdx index 03e5c151b..a2dcab6ac 100644 --- a/docs/api-reference/typescript/TSReadonlyType.mdx +++ b/docs/api-reference/typescript/TSReadonlyType.mdx @@ -45,7 +45,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### name @@ -63,19 +63,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -88,12 +88,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type -TSType[ TSReadonlyType ] } description=" +TSType[ TSReadonlyType ] } description=" " /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -161,7 +161,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -184,7 +184,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -192,7 +192,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSReadonlyType ] } description=""/> +CodeFlag[ TSReadonlyType ] } description=""/> ### get_variable_usages @@ -215,7 +215,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -420,7 +420,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSString.mdx b/docs/api-reference/typescript/TSString.mdx index bbc2ab0ec..e69c0cc13 100644 --- a/docs/api-reference/typescript/TSString.mdx +++ b/docs/api-reference/typescript/TSString.mdx @@ -33,12 +33,12 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### content_nodes -Collection[ Expression [ Editable ], PyString ] } description=" +Collection[ Expression [ Editable ], PyString ] } description=" " /> ### expressions -list[ Expression [ Editable ]] } description="embedded expressions in the string, only applicable for templated or formatted strings" /> +list[ Expression [ Editable ]] } description="embedded expressions in the string, only applicable for templated or formatted strings" /> ### extended @@ -63,7 +63,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -77,19 +77,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -102,7 +102,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ### with_quotes @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -174,7 +174,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -197,7 +197,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -205,7 +205,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSString ] } description=""/> +CodeFlag[ TSString ] } description=""/> ### get_variable_usages @@ -228,7 +228,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -433,7 +433,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSSwitchCase.mdx b/docs/api-reference/typescript/TSSwitchCase.mdx index b2ef8b6a2..b59346cb2 100644 --- a/docs/api-reference/typescript/TSSwitchCase.mdx +++ b/docs/api-reference/typescript/TSSwitchCase.mdx @@ -24,16 +24,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### condition -Expression [ PyMatchCase ] | None } description="The condition which triggers this case" /> +Expression [ PyMatchCase ] | None } description="The condition which triggers this case" /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### default @@ -41,7 +41,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> +list[ FunctionCall ] } description="Gets all function calls within the statement's code block." /> ### index @@ -78,15 +78,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSSwitchCase ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSSwitchCase ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSSwitchCase ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSSwitchCase ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -100,19 +100,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -163,7 +163,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -221,7 +221,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -244,7 +244,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -252,7 +252,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSSwitchCase ] } description=""/> +CodeFlag[ TSSwitchCase ] } description=""/> ### get_component @@ -269,7 +269,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSSwitchCase ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSSwitchCase ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -292,7 +292,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -390,7 +390,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -497,7 +497,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/TSSwitchStatement.mdx b/docs/api-reference/typescript/TSSwitchStatement.mdx index 1092fc237..7f747f3c0 100644 --- a/docs/api-reference/typescript/TSSwitchStatement.mdx +++ b/docs/api-reference/typescript/TSSwitchStatement.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### cases -list[ SwitchCase ] } description=" +list[ SwitchCase ] } description=" " /> ### extended @@ -46,7 +46,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the switch statement." /> +list[ FunctionCall ] } description="Returns all function calls within the switch statement." /> ### index @@ -54,11 +54,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the switch statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the switch statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSSwitchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSSwitchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -72,19 +72,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -102,11 +102,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### value -Expression [ PyMatchStatement ] } description="The value to switch on" /> +Expression [ PyMatchStatement ] } description="The value to switch on" /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -116,7 +116,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -174,7 +174,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -197,7 +197,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -205,7 +205,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSSwitchStatement ] } description=""/> +CodeFlag[ TSSwitchStatement ] } description=""/> ### get_variable_usages @@ -228,7 +228,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -433,7 +433,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSSymbol.mdx b/docs/api-reference/typescript/TSSymbol.mdx index fb7164451..9251dfe41 100644 --- a/docs/api-reference/typescript/TSSymbol.mdx +++ b/docs/api-reference/typescript/TSSymbol.mdx @@ -29,15 +29,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -49,7 +49,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -74,7 +74,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### has_semicolon @@ -82,7 +82,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_exported @@ -108,23 +108,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -142,7 +142,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -182,12 +182,29 @@ Adds a new comment to the symbol. None } description=""/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -245,7 +262,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -268,7 +285,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -276,7 +293,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSSymbol ] } description=""/> +CodeFlag[ TSSymbol ] } description=""/> ### get_import_string @@ -319,7 +336,7 @@ 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."/> +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."/> ### get_variable_usages @@ -342,7 +359,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -475,7 +492,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -515,6 +532,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -582,7 +622,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -610,7 +650,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -674,36 +714,36 @@ Sets the name of a code element. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSTernaryExpression.mdx b/docs/api-reference/typescript/TSTernaryExpression.mdx index 62c5826d2..eccc4c40b 100644 --- a/docs/api-reference/typescript/TSTernaryExpression.mdx +++ b/docs/api-reference/typescript/TSTernaryExpression.mdx @@ -20,17 +20,17 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### alternative -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### condition -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### consequence -Expression [ PyConditionalExpression ] | None } description=" +Expression [ PyConditionalExpression ] | None } description=" " /> ### extended @@ -56,7 +56,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -70,19 +70,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -105,7 +105,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -163,7 +163,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -186,7 +186,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -194,7 +194,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSTernaryExpression ] } description=""/> +CodeFlag[ TSTernaryExpression ] } description=""/> ### get_variable_usages @@ -217,7 +217,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -315,7 +315,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -331,7 +331,7 @@ Simplifies a ternary expression based on a boolean condition. /> Editable | None, optional } + type={ <>Editable | None, optional } description="The node to be edited. Defaults to None." defaultValue="None" /> @@ -437,7 +437,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSTryCatchStatement.mdx b/docs/api-reference/typescript/TSTryCatchStatement.mdx index 5f4b1471c..c95e8126c 100644 --- a/docs/api-reference/typescript/TSTryCatchStatement.mdx +++ b/docs/api-reference/typescript/TSTryCatchStatement.mdx @@ -24,20 +24,20 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### catch -TSCatchStatement [ TSTryCatchStatement ] | None } description="The catch block." /> +TSCatchStatement [ TSTryCatchStatement ] | None } description="The catch block." /> ### code_block -CodeBlock | None } description=" +CodeBlock | None } description=" " /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -62,11 +62,11 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### finalizer -BlockStatement | None } description="The code block executed regardless of if an exception is thrown or not" /> +BlockStatement | None } description="The code block executed regardless of if an exception is thrown or not" /> ### function_calls -list[ FunctionCall ] } description="Gets all function calls within a try-catch-finally statement." /> +list[ FunctionCall ] } description="Gets all function calls within a try-catch-finally statement." /> ### index @@ -78,15 +78,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSTryCatchStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSTryCatchStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### nested_code_blocks -list[ TSCodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ TSCodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSTryCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSTryCatchStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -100,19 +100,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -163,7 +163,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -221,7 +221,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -244,7 +244,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -252,7 +252,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSTryCatchStatement ] } description=""/> +CodeFlag[ TSTryCatchStatement ] } description=""/> ### get_component @@ -269,7 +269,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSTryCatchStatement ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSTryCatchStatement ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -292,7 +292,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -390,7 +390,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -497,7 +497,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/api-reference/typescript/TSTypeAlias.mdx b/docs/api-reference/typescript/TSTypeAlias.mdx index 8f4cc1e0d..72e75799c 100644 --- a/docs/api-reference/typescript/TSTypeAlias.mdx +++ b/docs/api-reference/typescript/TSTypeAlias.mdx @@ -20,7 +20,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### attributes -list[ TSAttribute ] } description="Retrieves all attributes belonging to this type alias." /> +list[ TSAttribute ] } description="Retrieves all attributes belonging to this type alias." /> ### code_block @@ -29,23 +29,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### comment -TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> +TSCommentGroup | None } description="Retrieves the comment group associated with the symbol." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### dependencies -list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> +list[Union[ Symbol , Import ]] } description="Returns a list of symbols that this symbol depends on." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### export -Export | None } description="Returns the export object that exports this symbol." /> +Export | None } description="Returns the export object that exports this symbol." /> ### exported_name @@ -57,7 +57,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### extended_nodes -list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> +list[ Editable ] } description="Returns the list of nodes associated with this symbol including extended nodes." /> ### extended_source @@ -82,7 +82,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> +list[ FunctionCall ] } description="Returns all function calls within the code block and its decorators." /> ### has_semicolon @@ -90,7 +90,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### inline_comment -TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> +TSCommentGroup | None } description="Property that retrieves the inline comment group associated with the symbol." /> ### is_decorated @@ -106,7 +106,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSTypeAlias ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSTypeAlias ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### name @@ -124,23 +124,23 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### semicolon_node -Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> +Editable | None } description="Retrieves the semicolon node associated with a TypeScript symbol." /> ### source @@ -158,16 +158,16 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### type_parameters -TypeParameters[ Type , TSTypeAlias ] | None } description=" +TypeParameters[ Type , TSTypeAlias ] | None } description=" " /> ### value -Expression | None } description="Gets the value node of the object." /> +Expression | None } description="Gets the value node of the object." /> ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -230,12 +230,29 @@ Adds a decorator to a function or method. bool } description="True if the decorator was added, False if skipped."/> +### add_keyword +Insert a keyword in the appropriate place before this symbol if it doesn't already exist. + + + +str } + description="The keyword to be inserted. Must be a valid keyword in the language context." + defaultValue="" +/> + + + +None } description=""/> + + ### ancestors Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -293,7 +310,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -316,7 +333,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -324,7 +341,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSTypeAlias ] } description=""/> +CodeFlag[ TSTypeAlias ] } description=""/> ### get_attribute @@ -341,7 +358,7 @@ Retrieves a specific attribute from a TypeScript type alias by its name. -TSAttribute | None } description="The attribute with the specified name if found, None otherwise."/> +TSAttribute | None } description="The attribute with the specified name if found, None otherwise."/> ### get_component @@ -358,7 +375,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSTypeAlias ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSTypeAlias ] | None } description="The matching JSX element if found, None otherwise."/> ### get_import_string @@ -401,7 +418,7 @@ 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."/> +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."/> ### get_variable_usages @@ -424,7 +441,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -557,7 +574,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -597,6 +614,29 @@ Deletes this Node and its related extended nodes (e.g. decorators, comments). None } description=""/> +### rename +Renames a symbol and updates all its references in the codebase. + + + +str } + description="The new name for the symbol." + defaultValue="" +/> +int } + description="Priority of the edit operation. Defaults to 0." + defaultValue="0" +/> + + + +tuple[NodeId, NodeId] } description="A tuple containing the file node ID and the new node ID of the renamed symbol."/> + + ### replace Search and replace occurrences of text within this node's source and its extended nodes. @@ -664,7 +704,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_comment @@ -692,7 +732,7 @@ Sets a comment to the symbol. /> TSCommentType , optional } + type={ <>TSCommentType , optional } description="The style of comment to add." defaultValue="TSCommentType.DOUBLE_SLASH" /> @@ -814,36 +854,36 @@ Sets the value of the node's value Expression. ### symbol_usages Returns a list of symbols that use or import the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="The types of usages to search for. Defaults to any." defaultValue="None" /> -list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> +list[ Import | Symbol | Export ] } description="A list of symbols that use or import the exportable object."/> ### usages Returns a list of usages of the exportable object. - + UsageType | None } + type={ <>UsageType | None } description="Specifies which types of usages to include in the results. Default is any usages." defaultValue="None" /> -list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> +list[ Usage ] } description="A sorted list of Usage objects representing where this exportable is used, ordered by source location in reverse."/> diff --git a/docs/api-reference/typescript/TSUndefinedType.mdx b/docs/api-reference/typescript/TSUndefinedType.mdx index a1139c831..9270dc5a3 100644 --- a/docs/api-reference/typescript/TSUndefinedType.mdx +++ b/docs/api-reference/typescript/TSUndefinedType.mdx @@ -44,7 +44,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### node_type @@ -58,19 +58,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -93,7 +93,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -151,7 +151,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -174,7 +174,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -182,7 +182,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSUndefinedType ] } description=""/> +CodeFlag[ TSUndefinedType ] } description=""/> ### get_variable_usages @@ -205,7 +205,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -303,7 +303,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -410,7 +410,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> diff --git a/docs/api-reference/typescript/TSUnionType.mdx b/docs/api-reference/typescript/TSUnionType.mdx index 16fdea8c4..778a11041 100644 --- a/docs/api-reference/typescript/TSUnionType.mdx +++ b/docs/api-reference/typescript/TSUnionType.mdx @@ -45,15 +45,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> +list[ FunctionCall ] } description="Returns a list of all function calls contained within this expression." /> ### next_named_sibling -Editable | None } description="Returns the next named sibling of the last symbol in the group." /> +Editable | None } description="Returns the next named sibling of the last symbol in the group." /> ### next_sibling -Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> +Editable | None } description="Returns the next sibling of the last symbol in the symbol group." /> ### node_type @@ -67,19 +67,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### symbols -list[ Editable ] } description="Returns the list of symbols in the group." /> +list[ Editable ] } description="Returns the list of symbols in the group." /> ### ts_node @@ -96,7 +96,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -106,7 +106,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -137,7 +137,7 @@ Search for substrings in the given symbols that match `strings_to_match`. -list[ Editable ] } description="A list of Editable objects representing each match found."/> +list[ Editable ] } description="A list of Editable objects representing each match found."/> ### find_string_literals @@ -160,7 +160,7 @@ Search for string literals matching given strings in the SymbolGroup. -list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> +list[ Editable ] } description="List of Editable nodes representing the matching string literals found within the symbols."/> ### flag @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSUnionType ] } description=""/> +CodeFlag[ TSUnionType ] } description=""/> ### get_variable_usages @@ -191,7 +191,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### index @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -323,7 +323,7 @@ Removes an element from a Collection. Editable | None } + type={ <>Editable | None } description="The element to remove from the Collection. If None, delegates to parent class." defaultValue="" /> @@ -394,7 +394,7 @@ Searches for regex matches in the codebase. -list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> +list[ Editable ] } description="A list of Editable objects representing matched text nodes in the codebase."/> diff --git a/docs/api-reference/typescript/TSWhileStatement.mdx b/docs/api-reference/typescript/TSWhileStatement.mdx index ec8e35576..a775a19ad 100644 --- a/docs/api-reference/typescript/TSWhileStatement.mdx +++ b/docs/api-reference/typescript/TSWhileStatement.mdx @@ -33,15 +33,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### condition -Expression [ TSWhileStatement ] } description="The condition expression of the while loop." /> +Expression [ TSWhileStatement ] } description="The condition expression of the while loop." /> ### decorators -list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> +list[ TSDecorator ] } description="Returns a list of decorators associated with this symbol." /> ### docstring -TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> +TSCommentGroup | None } description="Retrieves the docstring of a function or class." /> ### extended @@ -66,7 +66,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### function_calls -list[ FunctionCall ] } description="Returns all function calls within the while statement block." /> +list[ FunctionCall ] } description="Returns all function calls within the while statement block." /> ### index @@ -78,15 +78,15 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### jsx_elements -list[ JSXElement [ TSWhileStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> +list[ JSXElement [ TSWhileStatement ]] } description="Returns a list of all JSX elements contained within this symbol." /> ### nested_code_blocks -list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> +list[ CodeBlock ] } description="Returns all nested CodeBlocks within the statement." /> ### nested_statements -list[ MultiLineCollection [ Statement [ TSWhileStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> +list[ MultiLineCollection [ Statement [ TSWhileStatement ], Editable ]] } description="Returns a list of statement collections within nested code blocks." /> ### node_type @@ -100,19 +100,19 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### parent_class -Class | None } description="Find the class this node is contained in" /> +Class | None } description="Find the class this node is contained in" /> ### parent_function -Function | None } description="Find the function this node is contained in" /> +Function | None } description="Find the function this node is contained in" /> ### parent_statement -Statement | None } description="Find the statement this node is contained in" /> +Statement | None } description="Find the statement this node is contained in" /> ### resolved_value -Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> +Expression | list[ Expression ] } description="Returns the resolved type of an Expression." /> ### source @@ -130,7 +130,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### variable_usages -list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> +list[ Editable ] } description="Returns Editables for all TreeSitter node instances of variable usages within this node's" /> ## Methods @@ -163,7 +163,7 @@ Find all ancestors of the node of the given type. Does not return itself -list[ Editable ] } description=""/> +list[ Editable ] } description=""/> ### edit @@ -221,7 +221,7 @@ Find and return matching nodes or substrings within an Editable instance. -list[ Editable ] } description="A list of Editable instances that match the search criteria."/> +list[ Editable ] } description="A list of Editable instances that match the search criteria."/> ### find_string_literals @@ -244,7 +244,7 @@ Returns a list of string literals within this node's source that match any of th -list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> +list[ Editable ] } description="A list of Editable objects representing the matching string literals."/> ### flag @@ -252,7 +252,7 @@ Adds a visual flag comment to the end of this Editable's source text. -CodeFlag[ TSWhileStatement ] } description=""/> +CodeFlag[ TSWhileStatement ] } description=""/> ### get_component @@ -269,7 +269,7 @@ Returns a specific JSX element from within this symbol's JSX elements. -JSXElement [ TSWhileStatement ] | None } description="The matching JSX element if found, None otherwise."/> +JSXElement [ TSWhileStatement ] | None } description="The matching JSX element if found, None otherwise."/> ### get_variable_usages @@ -292,7 +292,7 @@ Returns Editables for all TreeSitter nodes corresponding to instances of variabl -list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> +list[ Editable ] } description="List of Editable objects representing variable usage nodes matching the given name."/> ### insert_after @@ -390,7 +390,7 @@ Find the first ancestor of the node of the given type. Does not return itself -Editable | None } description=""/> +Editable | None } description=""/> ### reduce_condition @@ -497,7 +497,7 @@ Returns a list of all regex match of `regex_pattern`, similar to python's re.sea -list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> +list[ Editable ] } description="A list of Editable objects corresponding to the matches found."/> ### set_docstring diff --git a/docs/mint.json b/docs/mint.json index 74d27f063..b80ab355f 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -176,6 +176,7 @@ "api-reference/core/ExpressionStatement", "api-reference/core/ExternalModule", "api-reference/core/File", + "api-reference/core/FlagKwargs", "api-reference/core/ForLoopStatement", "api-reference/core/Function", "api-reference/core/FunctionCall", diff --git a/pyproject.toml b/pyproject.toml index 4e74fd2fa..e603bf90b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ dependencies = [ "wrapt<2.0.0,>=1.16.0", "pyright<2.0.0,>=1.1.372", "watchfiles<1.1.0,>=1.0.0", - "loguru<1.0.0,>=0.7.2", "rich<14.0.0,>=13.7.1", "pydantic<3.0.0,>=2.9.2", "docstring-parser<1.0,>=0.16", diff --git a/src/codegen/sdk/code_generation/doc_utils/generate_docs_json.py b/src/codegen/sdk/code_generation/doc_utils/generate_docs_json.py index d7d091248..1682fd010 100644 --- a/src/codegen/sdk/code_generation/doc_utils/generate_docs_json.py +++ b/src/codegen/sdk/code_generation/doc_utils/generate_docs_json.py @@ -1,6 +1,5 @@ from typing import Any -from loguru import logger from tqdm import tqdm from codegen.sdk.code_generation.doc_utils.parse_docstring import parse_docstring @@ -8,6 +7,7 @@ from codegen.sdk.code_generation.doc_utils.utils import create_path, get_langauge, get_type, get_type_str, has_documentation, is_settter, replace_multiple_types from codegen.sdk.core.class_definition import Class from codegen.sdk.core.codebase import Codebase +from codegen.sdk.core.placeholder.placeholder_type import TypePlaceholder ATTRIBUTES_TO_IGNORE = ["G", "node_id", "angular"] @@ -52,30 +52,33 @@ def process_method(method, cls, cls_doc, seen_methods): return if not method.docstring: - logger.info(f"Method {cls.name}.{method.name} does not have a docstring") - return + raise ValueError(f"Method {cls.name}.{method.name} does not have a docstring") method_path = create_path(method, cls) parameters = [] parsed = parse_docstring(method.docstring.source) if parsed is None: - raise ValueError(f"Method {cls.name}.{method.name} does not have a docstring") + raise ValueError(f"Method {cls.name}.{method.name} docstring does not exist or has incorrect format.") # Update parameter types for param, parsed_param in zip(method.parameters[1:], parsed["arguments"]): if param.name == parsed_param.name: + if isinstance(param.type, TypePlaceholder): + resolved_types = [] + else: + resolved_types = param.type.resolved_types + parsed_param.type = replace_multiple_types( - codebase=codebase, input_str=parsed_param.type, resolved_types=param.type.resolved_types, parent_class=cls, parent_symbol=method, types_cache=types_cache + codebase=codebase, input_str=parsed_param.type, resolved_types=resolved_types, parent_class=cls, parent_symbol=method, types_cache=types_cache ) if param.default: parsed_param.default = param.default parameters.append(parsed_param) # Update return type - from codegen.sdk.python.placeholder.placeholder_return_type import PyReturnTypePlaceholder - if not isinstance(method.return_type, PyReturnTypePlaceholder): + if not isinstance(method.return_type, TypePlaceholder): return_type = replace_multiple_types( codebase=codebase, input_str=method.return_type.source, resolved_types=method.return_type.resolved_types, parent_class=cls, parent_symbol=method, types_cache=types_cache ) @@ -111,7 +114,11 @@ def process_attribute(attr, cls, cls_doc, seen_methods): description = attr.docstring(cls) attr_return_type = [] if r_type := get_type_str(attr): - r_type_source = replace_multiple_types(codebase=codebase, input_str=r_type.source, resolved_types=r_type.resolved_types, parent_class=cls, parent_symbol=attr, types_cache=types_cache) + if isinstance(r_type, TypePlaceholder): + resolved_types = [] + else: + resolved_types = r_type.resolved_types + r_type_source = replace_multiple_types(codebase=codebase, input_str=r_type.source, resolved_types=resolved_types, parent_class=cls, parent_symbol=attr, types_cache=types_cache) attr_return_type.append(r_type_source) attr_cache[original_attr_path] = {"description": description, "attr_return_type": attr_return_type} @@ -138,37 +145,27 @@ def process_attribute(attr, cls, cls_doc, seen_methods): documented_classes = [cls for cls in codebase.classes if has_documentation(cls)] for cls in tqdm(documented_classes): - try: - cls_doc = process_class_doc(cls) - codegen_sdk_docs.classes.append(cls_doc) - seen_methods = set() - - # Process methods - for method in cls.methods(max_depth=None, private=False, magic=False): - try: - method_doc = process_method(method, cls, cls_doc, seen_methods) - if not method_doc: - continue - seen_methods.add(method_doc.name) - cls_doc.methods.append(method_doc) - except Exception as e: - logger.info(f"Failed to parse method: {method} - {e}") - - # Process attributes - for attr in cls.attributes(max_depth=None, private=False): - if attr.name in ATTRIBUTES_TO_IGNORE: - continue - try: - attr_doc = process_attribute(attr, cls, cls_doc, seen_methods) - if not attr_doc: - continue - seen_methods.add(attr_doc.name) - cls_doc.attributes.append(attr_doc) - except Exception as e: - logger.info(f"Failed to parse attribute: {attr} - {e}") - - except Exception as e: - logger.error(f"Error processing class {cls.name}: {e}") - continue + cls_doc = process_class_doc(cls) + codegen_sdk_docs.classes.append(cls_doc) + seen_methods = set() + + # Process methods + for method in cls.methods(max_depth=None, private=False, magic=False): + method_doc = process_method(method, cls, cls_doc, seen_methods) + if not method_doc: + continue + seen_methods.add(method_doc.name) + cls_doc.methods.append(method_doc) + + # Process attributes + for attr in cls.attributes(max_depth=None, private=False): + if attr.name in ATTRIBUTES_TO_IGNORE: + continue + + attr_doc = process_attribute(attr, cls, cls_doc, seen_methods) + if not attr_doc: + continue + seen_methods.add(attr_doc.name) + cls_doc.attributes.append(attr_doc) return codegen_sdk_docs diff --git a/src/codegen/sdk/code_generation/doc_utils/utils.py b/src/codegen/sdk/code_generation/doc_utils/utils.py index 2b4d36834..ab2ac5f1e 100644 --- a/src/codegen/sdk/code_generation/doc_utils/utils.py +++ b/src/codegen/sdk/code_generation/doc_utils/utils.py @@ -7,6 +7,7 @@ from codegen.sdk.core.detached_symbols.function_call import FunctionCall from codegen.sdk.core.expressions.type import Type from codegen.sdk.core.function import Function +from codegen.sdk.core.interfaces.callable import Callable from codegen.sdk.core.symbol import Symbol from codegen.sdk.enums import ProgrammingLanguage from codegen.sdk.python.statements.attribute import PyAttribute @@ -183,6 +184,22 @@ def has_documentation(c: Class): return any([dec.name == "ts_apidoc" or dec.name == "py_apidoc" or dec.name == "apidoc" for dec in c.decorators]) +def safe_get_class(codebase: Codebase, class_name: str) -> Class | None: + symbols = codebase.get_symbols(class_name) + if not symbols: + return None + + if len(symbols) == 1 and isinstance(symbols[0], Class): + return symbols[0] + + possible_classes = [s for s in symbols if isinstance(s, Class) and has_documentation(s)] + if not possible_classes: + return None + if len(possible_classes) == 1: + return possible_classes[0] + raise ValueError(f"Found {len(possible_classes)} classes with name {class_name}") + + def find_symbol(codebase: Codebase, symbol_name: str, resolved_types: list[Type], parent_class: Class, parent_symbol: Symbol, types_cache: dict): """Find the symbol in the codebase. @@ -201,35 +218,30 @@ def find_symbol(codebase: Codebase, symbol_name: str, resolved_types: list[Type] return f"<{create_path(parent_class)}>" if symbol_name in types_cache: return types_cache[symbol_name] - # if symbol_name in [resolved_type.value for resolved_type in resolved_types]: - # return symbol_name - - try: - trgt_symbol = None - cls_obj = codebase.get_class(symbol_name, optional=True) - if cls_obj: - trgt_symbol = cls_obj - - if not trgt_symbol: - if symbol := parent_symbol.file.get_symbol(symbol_name): - for resolved_type in symbol.resolved_types: - if isinstance(resolved_type, FunctionCall) and len(resolved_type.args) >= 2: - bound_arg = resolved_type.args[1] - bound_name = bound_arg.value - if cls_obj := codebase.get_class(bound_name, optional=True): - trgt_symbol = cls_obj - break - - elif symbol := codebase.get_symbol(symbol_name, optional=True): - if len(symbol.resolved_types) == 1: - trgt_symbol = symbol.resolved_types[0] - - if trgt_symbol and has_documentation(trgt_symbol): - trgt_path = f"<{create_path(trgt_symbol)}>" - types_cache[symbol_name] = trgt_path - return trgt_path - except Exception as e: - logger.warning(f"Unable to resolve {symbol_name}. Received error: {e}.") + + trgt_symbol = None + cls_obj = safe_get_class(codebase, symbol_name) + if cls_obj: + trgt_symbol = cls_obj + + if not trgt_symbol: + if symbol := parent_symbol.file.get_symbol(symbol_name): + for resolved_type in symbol.resolved_types: + if isinstance(resolved_type, FunctionCall) and len(resolved_type.args) >= 2: + bound_arg = resolved_type.args[1] + bound_name = bound_arg.value + if cls_obj := safe_get_class(codebase, bound_name): + trgt_symbol = cls_obj + break + + elif symbol := codebase.get_symbol(symbol_name, optional=True): + if len(symbol.resolved_types) == 1: + trgt_symbol = symbol.resolved_types[0] + + if trgt_symbol and isinstance(trgt_symbol, Callable) and has_documentation(trgt_symbol): + trgt_path = f"<{create_path(trgt_symbol)}>" + types_cache[symbol_name] = trgt_path + return trgt_path return symbol_name diff --git a/src/codegen/sdk/code_generation/mdx_docs_generation.py b/src/codegen/sdk/code_generation/mdx_docs_generation.py index 8a1ddb399..648a3b68e 100644 --- a/src/codegen/sdk/code_generation/mdx_docs_generation.py +++ b/src/codegen/sdk/code_generation/mdx_docs_generation.py @@ -197,7 +197,7 @@ def parse_link(type_string: str, href: bool = False) -> str: else: part = format_builtin_type_string(part) if href: - result.append(f'{part.strip()}') + result.append(f"{part.strip()}") else: result.append(part.strip()) diff --git a/src/codegen/sdk/codebase/flagging/enums.py b/src/codegen/sdk/codebase/flagging/enums.py index f89ad88f1..949f09ce5 100644 --- a/src/codegen/sdk/codebase/flagging/enums.py +++ b/src/codegen/sdk/codebase/flagging/enums.py @@ -23,6 +23,14 @@ class MessageType(IntFlag): @apidoc class FlagKwargs(TypedDict, total=False): + """Kwargs for the flag_instance method of the Codebase class. + + Attributes: + message: The message to be displayed in the diff preview or posted as a comment on the PR. + message_type: Where the message will be sent (CODEGEN, GITHUB, SLACK) + message_recipient: The recipient of the message. + """ + message: ReadOnly[str | None] message_type: ReadOnly[MessageType] message_recipient: ReadOnly[str | None] diff --git a/src/codegen/sdk/core/directory.py b/src/codegen/sdk/core/directory.py index 07c53d3f7..fc3ba9f99 100644 --- a/src/codegen/sdk/core/directory.py +++ b/src/codegen/sdk/core/directory.py @@ -195,7 +195,7 @@ def get_subdirectory(self, subdirectory_name: str) -> Self | None: """Get a subdirectory by its path relative to the directory.""" return self.items.get(subdirectory_name, None) - def remove(self): + def remove(self) -> None: """Remove the directory and all its files and subdirectories.""" for f in self.files: f.remove() diff --git a/src/codegen/sdk/core/expressions/parenthesized_expression.py b/src/codegen/sdk/core/expressions/parenthesized_expression.py index bf11454de..e4452a7c0 100644 --- a/src/codegen/sdk/core/expressions/parenthesized_expression.py +++ b/src/codegen/sdk/core/expressions/parenthesized_expression.py @@ -44,7 +44,7 @@ def function_calls(self) -> list[FunctionCall]: @writer @override - def unwrap(self, node: Expression | None = None): + def unwrap(self, node: Expression | None = None) -> None: """Removes the parentheses from a parenthesized expression node. Modifies the AST by removing the parentheses from a ParenthesizedExpression node, leaving only the inner expression. diff --git a/src/codegen/sdk/core/expressions/unpack.py b/src/codegen/sdk/core/expressions/unpack.py index c7a490f6c..8eb1c8a37 100644 --- a/src/codegen/sdk/core/expressions/unpack.py +++ b/src/codegen/sdk/core/expressions/unpack.py @@ -24,7 +24,7 @@ def __init__(self, ts_node, file_node_id, G, parent: Parent): super().__init__(ts_node, file_node_id, G, parent=parent) self._value_node = self.children[0] - def unwrap(self, node: Expression | None = None): + def unwrap(self, node: Expression | None = None) -> None: """Unwraps a node's content into its parent node. Unwraps the content of a node by removing its wrapping syntax and merging its content with its parent node. diff --git a/src/codegen/sdk/core/file.py b/src/codegen/sdk/core/file.py index 3f92531f1..e242636f4 100644 --- a/src/codegen/sdk/core/file.py +++ b/src/codegen/sdk/core/file.py @@ -839,7 +839,7 @@ def import_module_name(self) -> str: def get_import_module_name_for_file(cls, filepath: str, G: CodebaseGraph) -> str: ... @abstractmethod - def remove_unused_exports(self): + def remove_unused_exports(self) -> None: """Removes unused exports from the file. Removes all exports that have no usages by any other files in the codebase. This helps reduce unnecessary exports and maintain a cleaner API surface. @@ -883,7 +883,7 @@ def add_symbol_import( alias: str | None = None, import_type: ImportType = ImportType.UNKNOWN, is_type_import: bool = False, - ): + ) -> Import | None: """Adds an import to a file for a given symbol. This method adds an import statement to the file for a specified symbol. If an import for the @@ -896,7 +896,7 @@ def add_symbol_import( is_type_import (bool): Whether this is a type-only import. Defaults to False. Returns: - Import: The created or existing import for the symbol. + Import | None: The existing import for the symbol or None if it was added. """ imports = self.imports match = next((x for x in imports if x.imported_symbol == symbol), None) @@ -954,7 +954,7 @@ def add_symbol_from_source(self, source: str) -> None: self.insert_after("\n" + source) @writer - def add_symbol(self, symbol: Symbol, should_export: bool = True): + def add_symbol(self, symbol: Symbol, should_export: bool = True) -> Symbol | None: """Adds `symbol` to the file. Adds the given symbol to the file, optionally exporting it if applicable. If the symbol already exists in the file, returns the existing symbol. @@ -964,7 +964,7 @@ def add_symbol(self, symbol: Symbol, should_export: bool = True): should_export (bool, optional): Whether to export the symbol. Defaults to True. Returns: - Symbol: The added symbol, or the existing symbol if it already exists in the file. + Symbol | None: The existing symbol if it already exists in the file or None if it was added. Raises: ValueError: If the symbol type cannot be added to this file type. diff --git a/src/codegen/sdk/core/function.py b/src/codegen/sdk/core/function.py index a1151b405..349b4d705 100644 --- a/src/codegen/sdk/core/function.py +++ b/src/codegen/sdk/core/function.py @@ -281,7 +281,7 @@ def rename_local_variable(self, old_var_name: str, new_var_name: str, fuzzy_matc match.rename(new_name) @writer - def insert_statements(self, lines: str, index: int = 0): + def insert_statements(self, lines: str, index: int = 0) -> None: """Inserts lines of code into the function body at the specified index. Adds the provided lines as statements within the function's body at the given position. If index is 0, the lines will be prepended at the start of the function body. @@ -290,6 +290,9 @@ def insert_statements(self, lines: str, index: int = 0): lines (str): The code lines to insert into the function body. index (int, optional): The position in the function body where the lines should be inserted. Defaults to 0. + Returns: + None + Raises: ValueError: If the provided index is out of range for the function's statements. """ diff --git a/src/codegen/sdk/core/interfaces/unwrappable.py b/src/codegen/sdk/core/interfaces/unwrappable.py index 7fdee5157..341e3352f 100644 --- a/src/codegen/sdk/core/interfaces/unwrappable.py +++ b/src/codegen/sdk/core/interfaces/unwrappable.py @@ -17,7 +17,7 @@ class Unwrappable(Expression[Parent], Generic[Parent]): """ @abstractmethod - def unwrap(self, node: Expression | None = None): + def unwrap(self, node: Expression | None = None) -> None: """Unwrap this expression, removing parenthesis and other syntax elements while maintaining the function of the code. Args: diff --git a/src/codegen/sdk/core/interfaces/usable.py b/src/codegen/sdk/core/interfaces/usable.py index 6292fbbfb..58707f0cc 100644 --- a/src/codegen/sdk/core/interfaces/usable.py +++ b/src/codegen/sdk/core/interfaces/usable.py @@ -7,6 +7,7 @@ from codegen.sdk.core.dataclasses.usage import Usage, UsageType from codegen.sdk.core.interfaces.editable import Editable from codegen.sdk.core.interfaces.importable import Importable +from codegen.sdk.core.node_id_factory import NodeId from codegen.sdk.enums import EdgeType from codegen.shared.decorators.docs import apidoc @@ -73,7 +74,7 @@ def usages(self, usage_types: UsageType | None = None) -> list[Usage]: usages_to_return.append(usage) return sorted(dict.fromkeys(usages_to_return), key=lambda x: x.match.ts_node.start_byte if x.match else x.usage_symbol.ts_node.start_byte, reverse=True) - def rename(self, new_name: str, priority: int = 0): + def rename(self, new_name: str, priority: int = 0) -> tuple[NodeId, NodeId]: """Renames a symbol and updates all its references in the codebase. Args: diff --git a/src/codegen/sdk/core/statements/for_loop_statement.py b/src/codegen/sdk/core/statements/for_loop_statement.py index 63ab3d576..643d23f20 100644 --- a/src/codegen/sdk/core/statements/for_loop_statement.py +++ b/src/codegen/sdk/core/statements/for_loop_statement.py @@ -3,6 +3,7 @@ from abc import ABC from typing import TYPE_CHECKING, Generic, Self, TypeVar +from codegen.sdk.core.autocommit import reader from codegen.sdk.core.expressions import Expression from codegen.sdk.core.import_resolution import Import, WildcardImport from codegen.sdk.core.interfaces.chainable import Chainable @@ -11,7 +12,7 @@ from codegen.sdk.core.statements.statement import StatementType from codegen.sdk.core.symbol import Symbol from codegen.sdk.core.symbol_groups.collection import Collection -from codegen.shared.decorators.docs import apidoc +from codegen.shared.decorators.docs import apidoc, noapidoc if TYPE_CHECKING: from codegen.sdk.core.detached_symbols.code_block import CodeBlock @@ -32,6 +33,8 @@ class ForLoopStatement(BlockStatement[Parent], HasBlock, ABC, Generic[Parent]): item: Expression[Self] | None = None iterable: Expression[Self] + @noapidoc + @reader def resolve_name(self, name: str, start_byte: int | None = None) -> Symbol | Import | WildcardImport | None: if self.item and isinstance(self.iterable, Chainable): if start_byte is None or start_byte > self.iterable.end_byte: diff --git a/src/codegen/sdk/core/symbol.py b/src/codegen/sdk/core/symbol.py index c358f8a7a..b4761ecc3 100644 --- a/src/codegen/sdk/core/symbol.py +++ b/src/codegen/sdk/core/symbol.py @@ -382,7 +382,7 @@ def is_top_level(self) -> bool: return False @writer - def add_keyword(self, keyword: str): + def add_keyword(self, keyword: str) -> None: """Insert a keyword in the appropriate place before this symbol if it doesn't already exist. This method adds a keyword (e.g., 'public', 'async', 'static') in the syntactically appropriate diff --git a/src/codegen/sdk/typescript/detached_symbols/jsx/expression.py b/src/codegen/sdk/typescript/detached_symbols/jsx/expression.py index 4ea3d9d88..11b0bcfa3 100644 --- a/src/codegen/sdk/typescript/detached_symbols/jsx/expression.py +++ b/src/codegen/sdk/typescript/detached_symbols/jsx/expression.py @@ -55,7 +55,7 @@ def reduce_condition(self, bool_condition: bool, node: Editable) -> None: @writer @override - def unwrap(self, node: Expression | None = None): + def unwrap(self, node: Expression | None = None) -> None: """Removes the brackets from a JSX expression. diff --git a/src/codegen/sdk/typescript/file.py b/src/codegen/sdk/typescript/file.py index 4f48e0212..1c35299a9 100644 --- a/src/codegen/sdk/typescript/file.py +++ b/src/codegen/sdk/typescript/file.py @@ -398,7 +398,7 @@ def valid_import_names(self) -> dict[str, Symbol | TSImport]: #################################################################################################################### @mover - def update_filepath(self, new_filepath: str): + def update_filepath(self, new_filepath: str) -> None: """Updates the file path of the current file and all associated imports. Renames the current file to a new file path and updates all imports that reference this file to point to the new location. diff --git a/src/codegen/sdk/typescript/function.py b/src/codegen/sdk/typescript/function.py index d95f92a85..f7f164551 100644 --- a/src/codegen/sdk/typescript/function.py +++ b/src/codegen/sdk/typescript/function.py @@ -354,6 +354,18 @@ def arrow_to_named(self, name: str | None = None) -> None: @noapidoc @reader def resolve_name(self, name: str, start_byte: int | None = None) -> Symbol | Import | WildcardImport | None: + """Resolves the name of a symbol in the function. + + This method resolves the name of a symbol in the function. If the name is "this", it returns the parent class. + Otherwise, it calls the superclass method to resolve the name. + + Args: + name (str): The name of the symbol to resolve. + start_byte (int | None): The start byte of the symbol to resolve. + + Returns: + Symbol | Import | WildcardImport | None: The resolved symbol, import, or wildcard import, or None if not found. + """ if self.is_method: if name == "this": return self.parent_class diff --git a/tests/unit/codegen/sdk/code_generation/test_api_doc_generation.py b/tests/unit/codegen/sdk/code_generation/test_api_doc_generation.py index 247e264bd..aa1753837 100644 --- a/tests/unit/codegen/sdk/code_generation/test_api_doc_generation.py +++ b/tests/unit/codegen/sdk/code_generation/test_api_doc_generation.py @@ -1,6 +1,7 @@ import pytest from codegen.sdk.ai.helpers import count_tokens +from codegen.sdk.code_generation.doc_utils.generate_docs_json import generate_docs_json from codegen.sdk.code_generation.prompts.api_docs import get_codegen_sdk_codebase, get_codegen_sdk_docs from codegen.sdk.core.symbol import Symbol from codegen.sdk.enums import ProgrammingLanguage @@ -46,6 +47,13 @@ def test_api_doc_generation_sanity(codebase, language: ProgrammingLanguage) -> N # assert "InviteFactoryCreateParams" in docs # Canonicals aren't in docs +@pytest.mark.timeout(120) +def test_mdx_api_doc_generation_sanity(codebase) -> None: + docs_json = generate_docs_json(codebase, "HEAD") + + assert len(docs_json.classes) > 0 + + @pytest.mark.xdist_group("codegen") @pytest.mark.parametrize("language", [ProgrammingLanguage.PYTHON, ProgrammingLanguage.TYPESCRIPT]) def test_get_codegen_sdk_codebase(codebase, language) -> None: diff --git a/uv.lock b/uv.lock index d7df49d4c..7a4d001bd 100644 --- a/uv.lock +++ b/uv.lock @@ -358,7 +358,7 @@ name = "click" version = "8.1.8" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593 } wheels = [ @@ -367,6 +367,7 @@ wheels = [ [[package]] name = "codegen" +version = "0.5.3.dev23+g28194e2" source = { editable = "." } dependencies = [ { name = "anthropic" }, @@ -2554,7 +2555,7 @@ name = "tqdm" version = "4.67.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/a8/4b/29b4ef32e036bb34e4ab51796dd745cdba7ed47ad142a9f4a1eb8e0c744d/tqdm-4.67.1.tar.gz", hash = "sha256:f8aef9c52c08c13a65f30ea34f4e5aac3fd1a34959879d7e59e63027286627f2", size = 169737 } wheels = [