diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index 4bb44ea1d..1ea8d4548 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -22,16 +22,16 @@ jobs: uses: ./.github/actions/setup-environment - name: Generate API reference - run: uv run python src/graph-sitter/gscli/cli.py generate docs + run: uv run python src/graph_sitter/gscli/cli.py generate docs - name: Generate System Prompt - run: uv run python src/graph-sitter/gscli/cli.py generate system-prompt + run: uv run python src/graph_sitter/gscli/cli.py generate system-prompt - name: Commit changes run: | git config --local user.email ${{ secrets.DOCS_USER_EMAIL }} git config --local user.name ${{ secrets.DOCS_USER_NAME }} - git add docs/ src/codegen/sdk/system-prompt.txt + git add docs/ src/graph_sitter/system-prompt.txt git diff --staged --quiet || git commit -m "docs: updated API reference" - name: Push changes diff --git a/README.md b/README.md index 86fad5318..bb0edbcf2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- +

@@ -13,7 +13,7 @@
[![PyPI](https://img.shields.io/badge/PyPi-codegen-gray?style=flat-square&color=blue)](https://pypi.org/project/codegen/) -[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com) +[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com) [![Slack Community](https://img.shields.io/badge/Slack-Join-4A154B?logo=slack&style=flat-square)](https://community.codegen.com) [![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file) [![Follow on X](https://img.shields.io/twitter/follow/codegen?style=social)](https://x.com/codegen) @@ -22,7 +22,7 @@
-[Codegen](https://docs.codegen.com) is a python library for manipulating codebases. +[Codegen](https://graph-sitter.com) is a python library for manipulating codebases. ```python from codegen import Codebase @@ -49,7 +49,7 @@ We support - macOS and Linux - macOS is supported - Linux is supported on x86_64 and aarch64 with glibc 2.34+ - - Windows is supported via WSL. See [here](https://docs.codegen.com/building-with-codegen/codegen-with-wsl) for more details. + - Windows is supported via WSL. See [here](https://graph-sitter.com/building-with-codegen/codegen-with-wsl) for more details. - Python, Typescript, Javascript and React codebases ``` @@ -73,7 +73,7 @@ gs notebook ## Usage -See [Getting Started](https://docs.codegen.com/introduction/getting-started) for a full tutorial. +See [Getting Started](https://graph-sitter.com/introduction/getting-started) for a full tutorial. ``` from codegen import Codebase @@ -91,8 +91,8 @@ If you run into additional issues not listed here, please [join our slack commun ## Resources -- [Docs](https://docs.codegen.com) -- [Getting Started](https://docs.codegen.com/introduction/getting-started) +- [Docs](https://graph-sitter.com) +- [Getting Started](https://graph-sitter.com/introduction/getting-started) - [Contributing](CONTRIBUTING.md) - [Contact Us](https://codegen.com/contact) diff --git a/codegen-examples/README.md b/codegen-examples/README.md index d13002076..6416792ea 100644 --- a/codegen-examples/README.md +++ b/codegen-examples/README.md @@ -1,6 +1,6 @@ # Codegen Examples -[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com) +[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com) This is a collection of examples using [Codegen](https://codegen.com). You can use these examples to learn how to use Codegen and build custom code transformations. @@ -8,7 +8,7 @@ This is a collection of examples using [Codegen](https://codegen.com). You can u We recommend using [`uv`](https://github.com/astral-sh/uv) with Python 3.13 for the best experience. -To install Codegen, please follow the [official installation guide](https://docs.codegen.com/introduction/installation). Once Codegen is installed, use these steps to run the examples in this repository: +To install Codegen, please follow the [official installation guide](https://graph-sitter.com/introduction/installation). Once Codegen is installed, use these steps to run the examples in this repository: Install the graph_sitter.cli globally @@ -32,7 +32,7 @@ Your environment is now ready to run example codemods. ### IDE Configuration (Optional) -To configure your IDE for optimal use with Codegen, follow our [IDE setup guide](https://docs.codegen.com/introduction/ide-usage#configuring-your-ide-interpreter). +To configure your IDE for optimal use with Codegen, follow our [IDE setup guide](https://graph-sitter.com/introduction/ide-usage#configuring-your-ide-interpreter). ## Examples @@ -46,10 +46,10 @@ To see a transformation, simply run the `run.py` script within the desired direc ## Learn More -- [Documentation](https://docs.codegen.com) -- [Getting Started Guide](https://docs.codegen.com/introduction/getting-started) -- [Tutorials](https://docs.codegen.com/tutorials/at-a-glance) -- [API Reference](https://docs.codegen.com/api-reference) +- [Documentation](https://graph-sitter.com) +- [Getting Started Guide](https://graph-sitter.com/introduction/getting-started) +- [Tutorials](https://graph-sitter.com/tutorials/at-a-glance) +- [API Reference](https://graph-sitter.com/api-reference) ## Contributing diff --git a/codegen-examples/examples/ai_impact_analysis/README.md b/codegen-examples/examples/ai_impact_analysis/README.md index e34e1a8af..e3847b7d5 100644 --- a/codegen-examples/examples/ai_impact_analysis/README.md +++ b/codegen-examples/examples/ai_impact_analysis/README.md @@ -116,8 +116,8 @@ After running the analysis, symbols in the codebase will have the following attr ## Learn More -- [Attributions](https://docs.codegen.com/tutorials/attributions) -- [Codegen Documentation](https://docs.codegen.com) +- [Attributions](https://graph-sitter.com/tutorials/attributions) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/ai_impact_analysis/dashboard/README.md b/codegen-examples/examples/ai_impact_analysis/dashboard/README.md index cde758b55..4acd07da4 100644 --- a/codegen-examples/examples/ai_impact_analysis/dashboard/README.md +++ b/codegen-examples/examples/ai_impact_analysis/dashboard/README.md @@ -78,8 +78,8 @@ The dashboard will display: ## Learn More -- [AI Impact Analysis Documentation](https://docs.codegen.com/tutorials/attributions) -- [Codegen Documentation](https://docs.codegen.com) +- [AI Impact Analysis Documentation](https://graph-sitter.com/tutorials/attributions) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/codegen-mcp-server/README.md b/codegen-examples/examples/codegen-mcp-server/README.md index f56558d11..79842029c 100644 --- a/codegen-examples/examples/codegen-mcp-server/README.md +++ b/codegen-examples/examples/codegen-mcp-server/README.md @@ -1,7 +1,7 @@ # Codegen MCP Server

- +

@@ -13,7 +13,7 @@
-[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com) +[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com) [![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)
diff --git a/codegen-examples/examples/codegen-mcp-server/llms-install.md b/codegen-examples/examples/codegen-mcp-server/llms-install.md index b01cdddcb..03d5312c7 100644 --- a/codegen-examples/examples/codegen-mcp-server/llms-install.md +++ b/codegen-examples/examples/codegen-mcp-server/llms-install.md @@ -4,7 +4,7 @@ Please read two things before trying to install this codegen MCP server: - This contains the instructions for setting up the mcp server -2. [Documentation Index for Agents](https://docs.codegen.com/llms.txt) +2. [Documentation Index for Agents](https://graph-sitter.com/llms.txt) - This contains a list of urls to the documentation for topics related to creating codegen codemods @@ -12,6 +12,6 @@ Please use a CURL command to retrieve the contents of the readme and documentati 1. curl -sL "https://raw.githubusercontent.com/codegen-sh/graph-sitter/refs/heads/develop/README.md" | cat -1. curl -sL "https://docs.codegen.com/llms.txt" | cat +1. curl -sL "https://graph-sitter.com/llms.txt" | cat This should give you all the context you need to successfully install and utilize the server. diff --git a/codegen-examples/examples/cyclomatic_complexity/README.md b/codegen-examples/examples/cyclomatic_complexity/README.md index 1115d8d9d..9c6c1239a 100644 --- a/codegen-examples/examples/cyclomatic_complexity/README.md +++ b/codegen-examples/examples/cyclomatic_complexity/README.md @@ -141,7 +141,7 @@ python run.py ## Learn More - [About Cyclomatic Complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/delete_dead_code/README.md b/codegen-examples/examples/delete_dead_code/README.md index 71afed02b..824715d3c 100644 --- a/codegen-examples/examples/delete_dead_code/README.md +++ b/codegen-examples/examples/delete_dead_code/README.md @@ -74,8 +74,8 @@ python run.py ## Learn More -- [Deleting Dead Code](https://docs.codegen.com/tutorials/deleting-dead-code) -- [Codegen Documentation](https://docs.codegen.com) +- [Deleting Dead Code](https://graph-sitter.com/tutorials/deleting-dead-code) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/dict_to_schema/README.md b/codegen-examples/examples/dict_to_schema/README.md index ee9f6d93a..b9c43135d 100644 --- a/codegen-examples/examples/dict_to_schema/README.md +++ b/codegen-examples/examples/dict_to_schema/README.md @@ -102,7 +102,7 @@ python run.py ## Learn More - [Pydantic Documentation](https://docs.pydantic.dev/) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/document_functions/README.md b/codegen-examples/examples/document_functions/README.md index 38db37e56..0fb09d855 100644 --- a/codegen-examples/examples/document_functions/README.md +++ b/codegen-examples/examples/document_functions/README.md @@ -92,8 +92,8 @@ The script provides detailed progress information: ## Learn More -- [Creating Documentation](https://docs.codegen.com/tutorials/creating-documentation#creating-documentation) -- [Codegen Documentation](https://docs.codegen.com) +- [Creating Documentation](https://graph-sitter.com/tutorials/creating-documentation#creating-documentation) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/flask_to_fastapi_migration/README.md b/codegen-examples/examples/flask_to_fastapi_migration/README.md index 0efbf3360..c787b38ed 100644 --- a/codegen-examples/examples/flask_to_fastapi_migration/README.md +++ b/codegen-examples/examples/flask_to_fastapi_migration/README.md @@ -1,8 +1,8 @@ # Flask to FastAPI Migration Example -[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/flask-to-fastapi) +[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/flask-to-fastapi) -This example demonstrates how to use Codegen to automatically migrate a Flask application to FastAPI. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/flask-to-fastapi). +This example demonstrates how to use Codegen to automatically migrate a Flask application to FastAPI. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/flask-to-fastapi). ## What This Example Does @@ -70,7 +70,7 @@ The script will process all Python files in the `repo-before` directory and appl ## Learn More -- [Full Tutorial](https://docs.codegen.com/tutorials/flask-to-fastapi) +- [Full Tutorial](https://graph-sitter.com/tutorials/flask-to-fastapi) - [Flask Documentation](https://flask.palletsprojects.com/) - [FastAPI Documentation](https://fastapi.tiangolo.com/) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) diff --git a/codegen-examples/examples/fragment_to_shorthand/README.md b/codegen-examples/examples/fragment_to_shorthand/README.md index 4e1534e46..ff303f743 100644 --- a/codegen-examples/examples/fragment_to_shorthand/README.md +++ b/codegen-examples/examples/fragment_to_shorthand/README.md @@ -65,8 +65,8 @@ The script will: - [React Fragments](https://react.dev/reference/react/Fragment) - [JSX Fragments](https://react.dev/reference/jsx#jsx-fragments) -- [Codegen Documentation](https://docs.codegen.com) -- [More on Codegen SDK jsx elements API](https://docs.codegen.com/api-reference/typescript/JSXElement#jsxelement) +- [Codegen Documentation](https://graph-sitter.com) +- [More on Codegen SDK jsx elements API](https://graph-sitter.com/api-reference/typescript/JSXElement#jsxelement) ## Contributing diff --git a/codegen-examples/examples/freezegun_to_timemachine_migration/README.md b/codegen-examples/examples/freezegun_to_timemachine_migration/README.md index 90c515ab2..5028b16c8 100644 --- a/codegen-examples/examples/freezegun_to_timemachine_migration/README.md +++ b/codegen-examples/examples/freezegun_to_timemachine_migration/README.md @@ -145,7 +145,7 @@ python run.py - [TimeMachine Documentation](https://github.com/adamchainz/time-machine) - [FreezeGun Documentation](https://github.com/spulec/freezegun) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/generate_training_data/README.md b/codegen-examples/examples/generate_training_data/README.md index 48d42ecac..7085cd22e 100644 --- a/codegen-examples/examples/generate_training_data/README.md +++ b/codegen-examples/examples/generate_training_data/README.md @@ -1,6 +1,6 @@ # Generate Codebase Pre-Training Data -[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/generate-training-data) +[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/generate-training-data) This example demonstrates how to use Codegen to generate training data for large-scale LLM pre-training by extracting function implementations along with their dependencies and usages. The approach is inspired by node2vec, leveraging code graphs for learning. @@ -87,6 +87,6 @@ The generated `training_data.json` follows this structure: ## Learn More -- [Full Tutorial](https://docs.codegen.com/tutorials/generate-training-data) -- [Code Model Pre-training](https://docs.codegen.com/concepts/code-model-training) -- [Codegen Documentation](https://docs.codegen.com) +- [Full Tutorial](https://graph-sitter.com/tutorials/generate-training-data) +- [Code Model Pre-training](https://graph-sitter.com/concepts/code-model-training) +- [Codegen Documentation](https://graph-sitter.com) diff --git a/codegen-examples/examples/github_checks/README.md b/codegen-examples/examples/github_checks/README.md index 605532669..6fed3dab6 100644 --- a/codegen-examples/examples/github_checks/README.md +++ b/codegen-examples/examples/github_checks/README.md @@ -102,8 +102,8 @@ The analysis results are posted as a markdown-formatted comment on the pull requ ## Learn More -- [Codegen Documentation](https://docs.codegen.com) -- [Detecting Import Loops](https://docs.codegen.com/blog/fixing-import-loops) +- [Codegen Documentation](https://graph-sitter.com) +- [Detecting Import Loops](https://graph-sitter.com/blog/fixing-import-loops) ## Contributing diff --git a/codegen-examples/examples/modal_repo_rag/README.md b/codegen-examples/examples/modal_repo_rag/README.md index 5209e7529..ede3c3514 100644 --- a/codegen-examples/examples/modal_repo_rag/README.md +++ b/codegen-examples/examples/modal_repo_rag/README.md @@ -1,7 +1,7 @@ # Codegen RAG Q&A API

- +

@@ -12,7 +12,7 @@
-[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com) +[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com) [![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)
@@ -115,6 +115,6 @@ Required environment variables: ## Learn More -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) - [Modal Documentation](https://modal.com/docs) -- [VectorIndex Tutorial](https://docs.codegen.com/building-with-codegen/semantic-code-search) +- [VectorIndex Tutorial](https://graph-sitter.com/building-with-codegen/semantic-code-search) diff --git a/codegen-examples/examples/modules_dependencies/README.md b/codegen-examples/examples/modules_dependencies/README.md index 2fde86e49..168d23491 100644 --- a/codegen-examples/examples/modules_dependencies/README.md +++ b/codegen-examples/examples/modules_dependencies/README.md @@ -134,8 +134,8 @@ You can customize the analysis by: - [NetworkX Documentation](https://networkx.org/) - [Python Import System](https://docs.python.org/3/reference/import.html) -- [Codegen Documentation](https://docs.codegen.com) -- [Graph visualization](https://docs.codegen.com/building-with-codegen/codebase-visualization) +- [Codegen Documentation](https://graph-sitter.com) +- [Graph visualization](https://graph-sitter.com/building-with-codegen/codebase-visualization) ## Contributing diff --git a/codegen-examples/examples/openapi_decorators/README.md b/codegen-examples/examples/openapi_decorators/README.md index f4e407a9e..f97183011 100644 --- a/codegen-examples/examples/openapi_decorators/README.md +++ b/codegen-examples/examples/openapi_decorators/README.md @@ -144,7 +144,7 @@ The script will: - [Flask-RESTx Documentation](https://flask-restx.readthedocs.io/) - [OpenAPI Specification](https://swagger.io/specification/) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/python2_to_python3/README.md b/codegen-examples/examples/python2_to_python3/README.md index 9d11f62ce..d15e51a6f 100644 --- a/codegen-examples/examples/python2_to_python3/README.md +++ b/codegen-examples/examples/python2_to_python3/README.md @@ -1,8 +1,8 @@ # Python 2 to Python 3 Migration Example -[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/python2-to-python3) +[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/python2-to-python3) -This example demonstrates how to use Codegen to automatically migrate Python 2 code to Python 3. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/python2-to-python3). +This example demonstrates how to use Codegen to automatically migrate Python 2 code to Python 3. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/python2-to-python3). ## What This Example Does @@ -94,7 +94,7 @@ The script will process all Python files in the `repo-before` directory and appl ## Learn More -- [Full Tutorial](https://docs.codegen.com/tutorials/python2-to-python3) +- [Full Tutorial](https://graph-sitter.com/tutorials/python2-to-python3) - [Python 3 Documentation](https://docs.python.org/3/) - [What's New in Python 3](https://docs.python.org/3/whatsnew/3.0.html) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) diff --git a/codegen-examples/examples/reexport_management/README.md b/codegen-examples/examples/reexport_management/README.md index 4ecc7f986..92c6d988d 100644 --- a/codegen-examples/examples/reexport_management/README.md +++ b/codegen-examples/examples/reexport_management/README.md @@ -115,9 +115,9 @@ The script will: - [TypeScript Modules](https://www.typescriptlang.org/docs/handbook/modules.html) - [Export/Import Documentation](https://www.typescriptlang.org/docs/handbook/modules.html#export) -- [Codegen Documentation](https://docs.codegen.com) -- [Tutorial on Analyzing and Organizing Re-exports](https://docs.codegen.com/tutorials/managing-typescript-exports) -- [More on exports ](https://docs.codegen.com/building-with-codegen/exports) +- [Codegen Documentation](https://graph-sitter.com) +- [Tutorial on Analyzing and Organizing Re-exports](https://graph-sitter.com/tutorials/managing-typescript-exports) +- [More on exports ](https://graph-sitter.com/building-with-codegen/exports) ## Contributing diff --git a/codegen-examples/examples/remove_default_exports/README.md b/codegen-examples/examples/remove_default_exports/README.md index 52009723e..9a5aad64e 100644 --- a/codegen-examples/examples/remove_default_exports/README.md +++ b/codegen-examples/examples/remove_default_exports/README.md @@ -65,7 +65,7 @@ python run.py ## Learn More - [TypeScript Documentation](https://www.typescriptlang.org/docs/) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/repo_analytics/README.md b/codegen-examples/examples/repo_analytics/README.md index 55e7a83a4..df0fe32eb 100644 --- a/codegen-examples/examples/repo_analytics/README.md +++ b/codegen-examples/examples/repo_analytics/README.md @@ -1,6 +1,6 @@ # Repository Analytics -This example demonstrates how to use Codegen to analyze repository metrics and generate comprehensive codebase analytics. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/codebase-analytics-dashboard). +This example demonstrates how to use Codegen to analyze repository metrics and generate comprehensive codebase analytics. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/codebase-analytics-dashboard). ## How the Analytics Script Works @@ -132,8 +132,8 @@ The script will output a detailed report including: ## Learn More -- [Analytics Tutorial](https://docs.codegen.com/tutorials/codebase-analytics-dashboard) -- [Codegen Documentation](https://docs.codegen.com) +- [Analytics Tutorial](https://graph-sitter.com/tutorials/codebase-analytics-dashboard) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/slack_chatbot/README.md b/codegen-examples/examples/slack_chatbot/README.md index e917abdfc..21ec87ee6 100644 --- a/codegen-examples/examples/slack_chatbot/README.md +++ b/codegen-examples/examples/slack_chatbot/README.md @@ -1,7 +1,7 @@ # Codegen Slack Bot

- +

@@ -12,7 +12,7 @@
-[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com) +[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com) [![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)
@@ -115,7 +115,7 @@ modal deploy api.py ## Learn More -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) - [Slack Bolt Python](https://slack.dev/bolt-python/concepts) - [Modal Documentation](https://modal.com/docs) -- [VectorIndex Tutorial](https://docs.codegen.com/building-with-codegen/semantic-code-search) +- [VectorIndex Tutorial](https://graph-sitter.com/building-with-codegen/semantic-code-search) diff --git a/codegen-examples/examples/sqlalchemy_1.6_to_2.0/README.md b/codegen-examples/examples/sqlalchemy_1.6_to_2.0/README.md index 6385eb110..24b8e4ee1 100644 --- a/codegen-examples/examples/sqlalchemy_1.6_to_2.0/README.md +++ b/codegen-examples/examples/sqlalchemy_1.6_to_2.0/README.md @@ -1,8 +1,8 @@ # SQLAlchemy 1.4 to 2.0 Migration Example -[![Documentation](https://img.shields.io/badge/docs-docs.codegen.com-blue)](https://docs.codegen.com/tutorials/sqlalchemy-1.4-to-2.0) +[![Documentation](https://img.shields.io/badge/docs-graph-sitter.com-blue)](https://graph-sitter.com/tutorials/sqlalchemy-1.4-to-2.0) -This example demonstrates how to use Codegen to automatically migrate SQLAlchemy 1.4 code to the new 2.0-style query interface. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/sqlalchemy-1.4-to-2.0). +This example demonstrates how to use Codegen to automatically migrate SQLAlchemy 1.4 code to the new 2.0-style query interface. For a complete walkthrough, check out our [tutorial](https://graph-sitter.com/tutorials/sqlalchemy-1.4-to-2.0). ## How the Migration Script Works @@ -94,10 +94,10 @@ python run.py ## Learn More -- [Full Tutorial](https://docs.codegen.com/tutorials/sqlalchemy-1.4-to-2.0) +- [Full Tutorial](https://graph-sitter.com/tutorials/sqlalchemy-1.4-to-2.0) - [SQLAlchemy Documentation](https://docs.sqlalchemy.org/en/20/) - [What's New in SQLAlchemy 2.0](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/sqlalchemy_soft_delete/README.md b/codegen-examples/examples/sqlalchemy_soft_delete/README.md index 52087e2e0..8650236c3 100644 --- a/codegen-examples/examples/sqlalchemy_soft_delete/README.md +++ b/codegen-examples/examples/sqlalchemy_soft_delete/README.md @@ -147,7 +147,7 @@ python run.py ## Learn More - [SQLAlchemy Documentation](https://docs.sqlalchemy.org/en/20/) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/sqlalchemy_type_annotations/README.md b/codegen-examples/examples/sqlalchemy_type_annotations/README.md index ea1df9940..6c64b7325 100644 --- a/codegen-examples/examples/sqlalchemy_type_annotations/README.md +++ b/codegen-examples/examples/sqlalchemy_type_annotations/README.md @@ -147,7 +147,7 @@ python run.py - [SQLAlchemy 2.0 Documentation](https://docs.sqlalchemy.org/en/20/) - [SQLAlchemy Type Annotations Guide](https://docs.sqlalchemy.org/en/20/orm/typing.html) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/symbol-attributions/README.md b/codegen-examples/examples/symbol-attributions/README.md index a44d73a69..501b0a393 100644 --- a/codegen-examples/examples/symbol-attributions/README.md +++ b/codegen-examples/examples/symbol-attributions/README.md @@ -84,8 +84,8 @@ The script will automatically: ## Learn More -- [Codegen Symbols](https://docs.codegen.com/api-reference/core/Symbol#symbol) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Symbols](https://graph-sitter.com/api-reference/core/Symbol#symbol) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/unittest_to_pytest/README.md b/codegen-examples/examples/unittest_to_pytest/README.md index 7503b58be..1a3cec119 100644 --- a/codegen-examples/examples/unittest_to_pytest/README.md +++ b/codegen-examples/examples/unittest_to_pytest/README.md @@ -105,10 +105,10 @@ The script will process all Python test files in the `repo-before` directory and ## Learn More -- [Full Tutorial](https://docs.codegen.com/tutorials/unittest-to-pytest) +- [Full Tutorial](https://graph-sitter.com/tutorials/unittest-to-pytest) - [pytest Documentation](https://docs.pytest.org/) - [unittest Documentation](https://docs.python.org/3/library/unittest.html) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/usesuspensequery_to_usesuspensequeries/README.md b/codegen-examples/examples/usesuspensequery_to_usesuspensequeries/README.md index 4ec033802..2d1b94210 100644 --- a/codegen-examples/examples/usesuspensequery_to_usesuspensequeries/README.md +++ b/codegen-examples/examples/usesuspensequery_to_usesuspensequeries/README.md @@ -114,7 +114,7 @@ The script will: - [React Query Documentation](https://tanstack.com/query/latest) - [useSuspenseQueries API](https://tanstack.com/query/latest/docs/react/reference/useSuspenseQueries) -- [Codegen Documentation](https://docs.codegen.com) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/codegen-examples/examples/visualize_codebases/README.md b/codegen-examples/examples/visualize_codebases/README.md index f8bdab75a..2db79e58f 100644 --- a/codegen-examples/examples/visualize_codebases/README.md +++ b/codegen-examples/examples/visualize_codebases/README.md @@ -167,8 +167,8 @@ After running a script, you'll get a graph object containing node and edge relat ## Learn More -- [Codebase Visualization Documentation](https://docs.codegen.com/tutorials/codebase-visualization) -- [Codegen Documentation](https://docs.codegen.com) +- [Codebase Visualization Documentation](https://graph-sitter.com/tutorials/codebase-visualization) +- [Codegen Documentation](https://graph-sitter.com) ## Contributing diff --git a/docs/agents/create-agent-run.mdx b/docs/agents/create-agent-run.mdx deleted file mode 100644 index e6af99b0c..000000000 --- a/docs/agents/create-agent-run.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: post /v1/organizations/{org_id}/agent/run ---- \ No newline at end of file diff --git a/docs/agents/get-agent-run.mdx b/docs/agents/get-agent-run.mdx deleted file mode 100644 index 5b9e68106..000000000 --- a/docs/agents/get-agent-run.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -openapi: get /v1/organizations/{org_id}/agent/run/{agent_run_id} ---- \ No newline at end of file diff --git a/docs/api-reference/core/Argument.mdx b/docs/api-reference/core/Argument.mdx index 83aab527d..1cc0c1ae8 100644 --- a/docs/api-reference/core/Argument.mdx +++ b/docs/api-reference/core/Argument.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_keyword Converts an unnamed argument to a named argument by adding a keyword. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -120,7 +120,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Argument ] } description=""/> @@ -209,7 +209,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -217,7 +217,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -330,7 +330,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -338,7 +338,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -346,7 +346,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -354,7 +354,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -362,7 +362,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Typeable](/api-reference/core/Typeable), [Symbol](/api-reference/core/Symbol), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -115,7 +115,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -157,7 +157,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Assignment ] } description=""/> @@ -269,7 +269,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -277,7 +277,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -396,7 +396,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -404,7 +404,7 @@ Check if this node is contained another node of the given class ### local_usages Retrieves all usages of the assigned variable within its code block scope. - + list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> @@ -412,7 +412,7 @@ Retrieves all usages of the assigned variable within its code block scope. ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -449,7 +449,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -457,7 +457,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an assignment expression by reducing it based on a boolean condition and updating all the usages. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_type_annotation Adds or updates a type annotation for the current assignment. - + set_value Sets the value of an assignment expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ AssignmentStatement ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -309,7 +309,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -333,7 +333,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -341,7 +341,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Usable](/api-reference/core/Usable), [AssignmentStatement](/api-reference/core/AssignmentStatement), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -127,7 +127,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Attribute ] } description=""/> @@ -239,7 +239,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -247,7 +247,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -360,7 +360,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -368,7 +368,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -376,7 +376,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -384,7 +384,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -392,7 +392,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of a node's assignment. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ AwaitExpression ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -395,7 +395,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ BinaryExpression ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a binary expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -130,7 +130,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ BlockStatement ] } description=""/> @@ -219,7 +219,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -332,7 +332,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -340,7 +340,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -348,7 +348,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -356,7 +356,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -364,7 +364,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Boolean ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Callable ] } description=""/> @@ -211,7 +211,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -219,7 +219,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -383,7 +383,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -391,7 +391,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -399,7 +399,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -407,7 +407,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -415,7 +415,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [BlockStatement](/api-reference/core/BlockStatement), [Statement](/api-reference/core/Statement), [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ CatchStatement ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ChainedAttribute ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Symbol](/api-reference/core/Symbol), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -147,7 +147,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_attribute Adds an attribute to a class from another class. - + add_attribute_from_source Adds an attribute to a class from raw source code, placing it in a specific location - + add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_source Add a block of source code to the bottom of a class definition. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -269,7 +269,7 @@ Find all ancestors of the node of the given type. Does not return itself ### attributes Retrieves all attributes from this Class including those from its superclasses up to a - + dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Class ] } description=""/> @@ -404,7 +404,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns a specific attribute by name. - + get_method Returns a specific method by name from the class or any of its superclasses. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -446,7 +446,7 @@ Returns the name node of the object. ### get_nested_class Returns a nested class by name from the current class. - + get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_parent_class Returns the parent class node with the specified name. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -650,7 +650,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_subclass_of Checks if the class inherits from a specified parent class. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -681,7 +681,7 @@ Check if this node is contained another node of the given class ### methods Retrieves all methods that exist on this Class, including methods from superclasses, with - + move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -747,7 +747,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -755,7 +755,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -763,7 +763,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + subclasses Returns all classes which subclass this class. - + superclasses Returns a list of all classes that this class extends, up to max_depth. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -115,7 +115,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -123,7 +123,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ CodeBlock ] } description=""/> @@ -212,7 +212,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_assignments Returns a list of assignments with the specified variable name. - + get_attributes Returns attributes from the code block, with the option to include or exclude private - + get_comment Gets the first comment statement containing a specific text string. - + get_local_var_assignment Returns the first code statement that assigns a local variable with the specified name. - + get_local_var_assignments Returns all instances of local variable assignments that match the specified variable - + get_statements Returns all statements of a given type up to the specified block level. - + get_variable_usages Returns all instances of variable usages in a code block. - + indent Adjusts the indentation level of the entire code block. - + insert_after Inserts source code at the bottom of the code block. - + insert_before Inserts new source code at the top of the code block. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -420,7 +420,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -428,7 +428,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -436,7 +436,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -444,7 +444,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -452,7 +452,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_variable_usages Renames all instances of variable usages in the code block. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + unwrap Extracts a code block from its parent wrapper container by removing the wrapping - + None } description=""/> @@ -588,7 +588,7 @@ Extracts a code block from its parent wrapper container by removing the wrapping ### wrap Wraps a code block with a statement and indents it. - + + ## Attributes @@ -65,7 +65,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### files Recursively iterate over all files in the codebase that are owned by the current code owner. - + Iterable[TFile] } description=""/> @@ -73,7 +73,7 @@ Recursively iterate over all files in the codebase that are owned by the current ### from_parser Create a list of CodeOwner objects from a CodeOwnersParser. - + get_class Get a class by name in files container. - + Class | None } description=""/> @@ -104,7 +104,7 @@ Get a class by name in files container. ### get_export Get an export by name in files container (supports only typescript). - + TSExport | None } description=""/> @@ -112,7 +112,7 @@ Get an export by name in files container (supports only typescript). ### get_function Get a function by name in files container. - + Function | None } description=""/> @@ -120,7 +120,7 @@ Get a function by name in files container. ### get_global_var Get a global variable by name in files container. - + Assignment | None } description=""/> @@ -128,7 +128,7 @@ Get a global variable by name in files container. ### get_import Get an import by name in files container. - + Import | None } description=""/> @@ -136,7 +136,7 @@ Get an import by name in files container. ### get_import_statement Get an import statement by name in files container. - + ImportStatement | None } description=""/> @@ -144,7 +144,7 @@ Get an import statement by name in files container. ### get_symbol Get a symbol by name in files container. - + Symbol | None } description=""/> diff --git a/docs/api-reference/core/Codebase.mdx b/docs/api-reference/core/Codebase.mdx index 7cc417782..ec7f11f4f 100644 --- a/docs/api-reference/core/Codebase.mdx +++ b/docs/api-reference/core/Codebase.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes @@ -89,7 +89,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ai Generates a response from the AI based on the provided prompt, target, and context. - + checkout Checks out a git branch or commit and syncs the codebase graph to the new state. - + commit Commits all staged changes to the codebase graph and synchronizes the graph with the filesystem if specified. - + create_directory Creates a directory at the specified path. - + create_file Creates a new file in the codebase with specified content. - + create_pr Creates a pull request from the current branch to the repository's default branch. - + create_pr_comment Create a comment on a pull request - + None } description=""/> @@ -265,7 +265,7 @@ Create a comment on a pull request ### create_pr_review_comment Create a review comment on a pull request. - + None } description=""/> @@ -273,7 +273,7 @@ Create a review comment on a pull request. ### 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."/> @@ -281,7 +281,7 @@ A list property that returns all files in the codebase. ### find_by_span Finds editable objects that overlap with the given source code span. - + from_files Creates a Codebase instance from multiple files. - + Codebase } description="A Codebase instance initialized with the provided files"/> @@ -306,7 +306,7 @@ Creates a Codebase instance from multiple files. ### from_repo Fetches a codebase from GitHub and returns a Codebase instance. - + from_string Creates a Codebase instance from a string of code. - + Codebase } description="A Codebase instance initialized with the provided code Example: >>> # Python code >>> code = "def add(a, b): return a + b" >>> codebase = Codebase.from_string(code, language="python") >>> # TypeScript code >>> code = "function add(a: number, b: number): number { return a + b; }" >>> codebase = Codebase.from_string(code, language="typescript")"/> @@ -367,7 +367,7 @@ Creates a Codebase instance from a string of code. ### get_class Returns a class that matches the given name. - + get_directory Returns Directory by `dir_path`, or full path to the directory from codebase root. - + get_file Retrieves a file from the codebase by its filepath. - + get_function Retrieves a function from the codebase by its name. - + get_modified_symbols_in_pr Get all modified symbols in a pull request - + tuple[str, dict[str, str], list[str], str] } description=""/> @@ -473,7 +473,7 @@ Get all modified symbols in a pull request ### get_relative_path Calculates a relative path from one file to another, removing the extension from the target file. - + get_symbol Returns a Symbol by name from the codebase. - + get_symbols Retrieves all symbols in the codebase that match the given symbol name. - + git_commit Stages + commits all 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=""/> @@ -624,7 +624,7 @@ Resets the codebase by ### set_ai_key Sets the OpenAI key for the current Codebase instance. - + None } description=""/> @@ -632,7 +632,7 @@ Sets the OpenAI key for the current Codebase instance. ### set_session_options Sets the session options for the current codebase. - + should_fix Returns True if the flag should be fixed based on the current mode and active group. - + visualize Visualizes a NetworkX graph or Plotly figure. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + edit_text Replace the text of a comment with new text. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Comment ] } description=""/> @@ -201,7 +201,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -314,7 +314,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -322,7 +322,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -330,7 +330,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -338,7 +338,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -346,7 +346,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + edit_text Replace the text content of a comment group with new text. - + find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ CommentGroup ] } description=""/> @@ -197,7 +197,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -310,7 +310,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -318,7 +318,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -334,7 +334,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -342,7 +342,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [BinaryExpression](/api-reference/core/BinaryExpression), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ComparisonExpression ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a binary expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Decorator ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Dict ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes @@ -77,7 +77,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### files Gets a list of all top level files in the directory. - + list[TFile] } description="A sorted list of source files in the codebase."/> @@ -85,7 +85,7 @@ Gets a list of all top level files in the directory. ### get_class Get a class by name in files container. - + Class | None } description=""/> @@ -93,7 +93,7 @@ Get a class by name in files container. ### get_export Get an export by name in files container (supports only typescript). - + TSExport | None } description=""/> @@ -101,7 +101,7 @@ Get an export by name in files container (supports only typescript). ### get_file Get a file by its name relative to the directory. - + TFile | None } description=""/> @@ -109,7 +109,7 @@ Get a file by its name relative to the directory. ### get_function Get a function by name in files container. - + Function | None } description=""/> @@ -117,7 +117,7 @@ Get a function by name in files container. ### get_global_var Get a global variable by name in files container. - + Assignment | None } description=""/> @@ -125,7 +125,7 @@ Get a global variable by name in files container. ### get_import Get an import by name in files container. - + Import | None } description=""/> @@ -133,7 +133,7 @@ Get an import by name in files container. ### get_import_statement Get an import statement by name in files container. - + ImportStatement | None } description=""/> @@ -141,7 +141,7 @@ Get an import statement by name in files container. ### get_subdirectory Get a subdirectory by its name (relative to the directory). - + Directory | None } description=""/> @@ -149,7 +149,7 @@ Get a subdirectory by its name (relative to the directory). ### get_symbol Get a symbol by name in files container. - + Symbol | None } description=""/> @@ -157,7 +157,7 @@ Get a symbol by name in files container. ### items Get a list of all files and subdirectories in the directory. - + list[ Directory | TFile] } description="A sorted list of files and subdirectories in the directory."/> @@ -165,7 +165,7 @@ Get a list of all files and subdirectories in the directory. ### remove Remove all the files in the files container. - + None } description=""/> @@ -173,7 +173,7 @@ Remove all the files in the files container. ### rename Rename the directory. - + None } description=""/> @@ -181,7 +181,7 @@ Rename the directory. ### subdirectories Get a list of all top level subdirectories in the directory. - + list[ Directory ] } description="A sorted list of subdirectories in the directory."/> @@ -189,7 +189,7 @@ Get a list of all top level subdirectories in the directory. ### update_filepath Update the filepath of the directory and its contained files. - + None } description=""/> diff --git a/docs/api-reference/core/Editable.mdx b/docs/api-reference/core/Editable.mdx index 6fdecc380..1b987bc16 100644 --- a/docs/api-reference/core/Editable.mdx +++ b/docs/api-reference/core/Editable.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes @@ -65,7 +65,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -73,7 +73,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Editable ] } description=""/> @@ -162,7 +162,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -275,7 +275,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -283,7 +283,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -291,7 +291,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -299,7 +299,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -307,7 +307,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -115,7 +115,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Export ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Returns the import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -270,7 +270,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased Determines if the Export object is aliased. - + bool } description="True if the exported symbol has a different name than the name it is exported as, False otherwise."/> @@ -383,7 +383,7 @@ Determines if the Export object is aliased. ### is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -391,7 +391,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_module_export Determines if the export is a module-level export. - + bool } description="True if the export is a module-level export, False otherwise."/> @@ -399,7 +399,7 @@ Determines if the export is a module-level export. ### is_named_export Determines if the export is named or default. - + bool } description="True if the export is named, False if it is default."/> @@ -407,7 +407,7 @@ Determines if the export is named or default. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -415,7 +415,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -423,7 +423,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -431,7 +431,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -439,7 +439,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExportStatement ] } description=""/> @@ -188,7 +188,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Exportable ] } description=""/> @@ -215,7 +215,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Returns the import string for a symbol. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -258,7 +258,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -371,7 +371,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -379,7 +379,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -387,7 +387,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -395,7 +395,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -403,7 +403,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Expression ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExpressionGroup ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExpressionStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -407,7 +407,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Callable](/api-reference/core/Callable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ExternalModule ] } description=""/> @@ -211,7 +211,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_import Creates an ExternalModule instance from an Import instance. - + get_import_string Returns the import string used to import this module. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -271,7 +271,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -435,7 +435,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -443,7 +443,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -451,7 +451,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -459,7 +459,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -467,7 +467,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -111,7 +111,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this file with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ File ] } description=""/> @@ -200,7 +200,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -313,7 +313,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -321,7 +321,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -337,7 +337,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parse Parses the file representation into the graph. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -362,7 +362,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -370,7 +370,7 @@ Removes the file from the file system and graph. ### rename Renames the file to the specified name, preserving the file extension. - + replace Replace occurrences of text in the file. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + update_filepath Updates the file path and inbound imports of a file. - + + ## Attributes diff --git a/docs/api-reference/core/ForLoopStatement.mdx b/docs/api-reference/core/ForLoopStatement.mdx index f1fa3be5a..5a5900185 100644 --- a/docs/api-reference/core/ForLoopStatement.mdx +++ b/docs/api-reference/core/ForLoopStatement.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 [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) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -138,7 +138,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ForLoopStatement ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -340,7 +340,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -348,7 +348,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -356,7 +356,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -364,7 +364,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -372,7 +372,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Callable](/api-reference/core/Callable), [Symbol](/api-reference/core/Symbol), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -171,7 +171,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_statements Adds statements to the end of a function body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -253,7 +253,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Modifies the function to be asynchronous. - + None } description=""/> @@ -261,7 +261,7 @@ Modifies the function to be asynchronous. ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Function ] } description=""/> @@ -373,7 +373,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -381,7 +381,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + insert_statements Inserts lines of code into the function body at the specified index. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -574,7 +574,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -582,7 +582,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -619,7 +619,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -627,7 +627,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### prepend_statements Prepends the provided code to the beginning of the function body. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -652,7 +652,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + rename_local_variable Renames a local variable and all its usages within a function body. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_return_type Sets the return type annotation for the function. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -127,7 +127,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Converts the function call to an async function call by wrapping it with 'await'. - + None } description=""/> @@ -135,7 +135,7 @@ Converts the function call to an async function call by wrapping it with 'await' ### convert_args_to_kwargs Converts positional arguments in a function call to keyword arguments. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ FunctionCall ] } description=""/> @@ -241,7 +241,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_usage Creates a FunctionCall object from an Editable instance that represents a function call. - + get_arg_by_index Returns the Argument with the given index from the function call's argument list. - + get_arg_by_parameter_name Returns an argument by its parameter name. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -306,7 +306,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -419,7 +419,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -427,7 +427,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -435,7 +435,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -443,7 +443,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -451,7 +451,7 @@ Reduces an editable to the following condition ### remove Removes a node and optionally its related extended nodes. - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_kwarg Set a keyword argument in a function call. - + set_name Sets the name of a code element. - + + ### Inherits from [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ GenericType ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -118,7 +118,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ HasBlock ] } description=""/> @@ -207,7 +207,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -320,7 +320,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -328,7 +328,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -336,7 +336,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -344,7 +344,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -352,7 +352,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ## Attributes @@ -29,7 +29,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -37,7 +37,7 @@ Returns the name node of the object. ### rename Sets the name of an object and updates all its usages. - + set_name Sets the name of a code element. - + + ## Attributes @@ -25,7 +25,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### set_value Sets the value of the node's value Expression. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -119,7 +119,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + elif_statements Returns all elif blocks within the if block. - + list[ IfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> @@ -162,7 +162,7 @@ Returns all elif blocks within the if block. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ IfBlockStatement ] } description=""/> @@ -216,7 +216,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -329,7 +329,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -337,7 +337,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -345,7 +345,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -353,7 +353,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a conditional block by reducing its condition to a boolean value. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -135,7 +135,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -143,7 +143,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Import ] } description=""/> @@ -255,7 +255,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -263,7 +263,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased_import Returns True if this import is aliased. - + bool } description="True if the import has an alias different from its original name, False otherwise."/> @@ -376,7 +376,7 @@ Returns True if this import is aliased. ### is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -384,7 +384,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_module_import Returns True if this import is importing an entire module/file. - + bool } description="True if this import represents a module/file import, False if it represents a symbol import."/> @@ -392,7 +392,7 @@ Returns True if this import is importing an entire module/file. ### is_reexport Returns true if the Import object is also an Export object. - + bool } description="True if the import is re-exported, False otherwise."/> @@ -400,7 +400,7 @@ Returns true if the Import object is also an Export object. ### is_symbol_import Returns True if this import is importing a symbol rather than a module. - + bool } description="True if this import is a symbol import, False if it is a module import."/> @@ -408,7 +408,7 @@ Returns True if this import is importing a symbol rather than a module. ### is_wildcard_import Returns True if the import symbol is a wildcard import. - + bool } description="True if this is a wildcard import, False otherwise."/> @@ -416,7 +416,7 @@ Returns True if the import symbol is a wildcard import. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -424,7 +424,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -432,7 +432,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -440,7 +440,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -448,7 +448,7 @@ Reduces an editable to the following condition ### remove Remove this import from the import statement. - + rename Renames the import symbol and updates all its usages throughout the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_import_module Sets the module of an import. - + set_import_symbol_alias Sets alias or name of an import at the declaration level. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ImportStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes diff --git a/docs/api-reference/core/Importable.mdx b/docs/api-reference/core/Importable.mdx index 0adedba8c..fda89a5d7 100644 --- a/docs/api-reference/core/Importable.mdx +++ b/docs/api-reference/core/Importable.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Importable ] } description=""/> @@ -199,7 +199,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -207,7 +207,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -320,7 +320,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -328,7 +328,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -336,7 +336,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -344,7 +344,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -352,7 +352,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Symbol](/api-reference/core/Symbol), [Editable](/api-reference/core/Editable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -188,7 +188,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + extends Returns True if the interface implements the given parent interface. - + bool } description=""/> @@ -254,7 +254,7 @@ Returns True if the interface implements the given parent interface. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Interface ] } description=""/> @@ -308,7 +308,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Returns the attribute with the given name, if it exists. - + Attribute | None } description=""/> @@ -316,7 +316,7 @@ Returns the attribute with the given name, if it exists. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -324,7 +324,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + implementations Returns all classes and interfaces that implement a given interface. - + list[ TSInterface | Class ] } description=""/> @@ -355,7 +355,7 @@ Returns all classes and interfaces that implement a given interface. ### insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -451,7 +451,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -459,7 +459,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -496,7 +496,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -504,7 +504,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -512,7 +512,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [SymbolGroup](/api-reference/core/SymbolGroup) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -91,7 +91,7 @@ Edit the source for this Collection instance. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ List ] } description=""/> @@ -145,7 +145,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -176,7 +176,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -184,7 +184,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -274,7 +274,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -282,7 +282,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -290,7 +290,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -306,7 +306,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes diff --git a/docs/api-reference/core/MultiExpression.mdx b/docs/api-reference/core/MultiExpression.mdx index cde892d2e..bc32a09bc 100644 --- a/docs/api-reference/core/MultiExpression.mdx +++ b/docs/api-reference/core/MultiExpression.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ MultiExpression ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -95,7 +95,7 @@ Edit the source for this Collection instance. ### find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ MultiLineCollection ] } description=""/> @@ -149,7 +149,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -180,7 +180,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -188,7 +188,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -278,7 +278,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -286,7 +286,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -294,7 +294,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -302,7 +302,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -310,7 +310,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Name ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ NamedType ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -184,7 +184,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ NoneType ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Number ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Pair ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -289,7 +289,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [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) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -115,7 +115,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Parameter ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -235,7 +235,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -348,7 +348,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -356,7 +356,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -364,7 +364,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -372,7 +372,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -380,7 +380,7 @@ Reduces an editable to the following condition ### remove Removes the parameter from the function definition and all its call sites. - + rename Renames a parameter in a function definition and updates all related references. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_type_annotation Sets the type annotation for this parameter. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Unwrappable](/api-reference/core/Unwrappable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ParenthesizedExpression ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -410,7 +410,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + unwrap Removes the parentheses from a parenthesized expression node. - + + @@ -19,7 +19,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Replaces the content of a placeholder node with new source code. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/core/PlaceholderType.mdx b/docs/api-reference/core/PlaceholderType.mdx index 9e8d18973..b8f90d039 100644 --- a/docs/api-reference/core/PlaceholderType.mdx +++ b/docs/api-reference/core/PlaceholderType.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PlaceholderType ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ RaiseStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ ReturnStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Usable](/api-reference/core/Usable), [HasBlock](/api-reference/core/HasBlock), [File](/api-reference/core/File), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [HasName](/api-reference/core/HasName) @@ -163,7 +163,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + add_import Adds an import to the file. - + add_symbol Adds `symbol` to the file. - + add_symbol_from_source Adds a symbol to a file from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -269,7 +269,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this file with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_by_byte_range Finds all editable objects that overlap with the given byte range in the file. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SourceFile ] } description=""/> @@ -398,7 +398,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Returns a specific Class by full name. Returns None if not found. - + get_function Returns a specific Function by name. - + get_global_var Returns a specific global var by name. Returns None if not found. - + get_import Returns the import with matching alias. Returns None if not found. - + get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -474,7 +474,7 @@ Returns the name node of the object. ### get_symbol Gets a symbol by its name from the file. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + has_import Returns True if the file has an import with the given alias. - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -621,7 +621,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -629,7 +629,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -637,7 +637,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -645,7 +645,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -653,7 +653,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -661,7 +661,7 @@ Removes the file from the file system and graph. ### remove_unused_exports Removes unused exports from the file. - + None } description=""/> @@ -669,7 +669,7 @@ Removes unused exports from the file. ### rename Renames a symbol and updates all its references in the codebase. - + replace Replace occurrences of text in the file. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + set_name Sets the name of a code element. - + symbol_can_be_added Checks if the file type supports adding the given symbol. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + symbols Returns all Symbols in the file, sorted by position in the file. - + list[ Symbol | Class | Function | Assignment | TSInterface ] } 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"/> @@ -838,7 +838,7 @@ Returns all Symbols in the file, sorted by position in the file. ### update_filepath Renames the file and updates all imports to point to the new location. - + usages Returns a list of usages of the exportable object. - + + ## Attributes diff --git a/docs/api-reference/core/Statement.mdx b/docs/api-reference/core/Statement.mdx index 2f84c7cc5..8a7af3a0f 100644 --- a/docs/api-reference/core/Statement.mdx +++ b/docs/api-reference/core/Statement.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Statement ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes diff --git a/docs/api-reference/core/String.mdx b/docs/api-reference/core/String.mdx index 74d45d964..1894674a0 100644 --- a/docs/api-reference/core/String.mdx +++ b/docs/api-reference/core/String.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ String ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -21,7 +21,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Edits the source code of this placeholder node. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/core/SubscriptExpression.mdx b/docs/api-reference/core/SubscriptExpression.mdx index 05904c59f..1d60421d9 100644 --- a/docs/api-reference/core/SubscriptExpression.mdx +++ b/docs/api-reference/core/SubscriptExpression.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SubscriptExpression ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -289,7 +289,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [BlockStatement](/api-reference/core/BlockStatement), [Statement](/api-reference/core/Statement), [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SwitchCase ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SwitchStatement ] } description=""/> @@ -188,7 +188,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -137,7 +137,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Symbol ] } description=""/> @@ -249,7 +249,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -257,7 +257,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -376,7 +376,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -384,7 +384,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -421,7 +421,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -429,7 +429,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -437,7 +437,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SymbolGroup ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -289,7 +289,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ SymbolStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TernaryExpression ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a ternary expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [BlockStatement](/api-reference/core/BlockStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TryCatchStatement ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [SymbolGroup](/api-reference/core/SymbolGroup) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -91,7 +91,7 @@ Edit the source for this Collection instance. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Tuple ] } description=""/> @@ -145,7 +145,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -176,7 +176,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -184,7 +184,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -274,7 +274,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -282,7 +282,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -290,7 +290,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -306,7 +306,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -99,7 +99,7 @@ Edit the source for this Collection instance. ### find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TupleType ] } description=""/> @@ -153,7 +153,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -184,7 +184,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -192,7 +192,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -282,7 +282,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -290,7 +290,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -306,7 +306,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -314,7 +314,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Type ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [HasBlock](/api-reference/core/HasBlock), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -188,7 +188,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TypeAlias ] } description=""/> @@ -300,7 +300,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_attribute Get attribute by name. - + Attribute | None } description=""/> @@ -308,7 +308,7 @@ Get attribute by name. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -316,7 +316,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -435,7 +435,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -443,7 +443,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -480,7 +480,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -488,7 +488,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -496,7 +496,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates the docstring for the current entity. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -21,7 +21,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Edits the type annotation of a placeholder node. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/core/Typeable.mdx b/docs/api-reference/core/Typeable.mdx index 71e5c2bb8..81cb9b838 100644 --- a/docs/api-reference/core/Typeable.mdx +++ b/docs/api-reference/core/Typeable.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 [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Typeable ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ UnaryExpression ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a unary expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -99,7 +99,7 @@ Edit the source for this Collection instance. ### find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ UnionType ] } description=""/> @@ -153,7 +153,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -184,7 +184,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -192,7 +192,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -282,7 +282,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -290,7 +290,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -306,7 +306,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -314,7 +314,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Unwrappable](/api-reference/core/Unwrappable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Unpack ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve Resolves the wrapper expression and returns the first concrete expression. - + Expression } description=""/> @@ -395,7 +395,7 @@ Resolves the wrapper expression and returns the first concrete expression. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + unwrap Unwraps a node's content into its parent node. - + + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Unwrappable ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + 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 910bd852b..e1873c0bc 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) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Usable ] } description=""/> @@ -199,7 +199,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | ChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -207,7 +207,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -320,7 +320,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -328,7 +328,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -336,7 +336,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -344,7 +344,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -352,7 +352,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ## Attributes diff --git a/docs/api-reference/core/UsageKind.mdx b/docs/api-reference/core/UsageKind.mdx index 2c716f1da..ce06d9c9a 100644 --- a/docs/api-reference/core/UsageKind.mdx +++ b/docs/api-reference/core/UsageKind.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes diff --git a/docs/api-reference/core/UsageType.mdx b/docs/api-reference/core/UsageType.mdx index a38a8ff12..9f8d24e5f 100644 --- a/docs/api-reference/core/UsageType.mdx +++ b/docs/api-reference/core/UsageType.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ## Attributes diff --git a/docs/api-reference/core/Value.mdx b/docs/api-reference/core/Value.mdx index 7d2fbacc6..d9a5287ee 100644 --- a/docs/api-reference/core/Value.mdx +++ b/docs/api-reference/core/Value.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ Value ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ WhileStatement ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates the docstring for the current entity. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [Statement](/api-reference/core/Statement), [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ WithStatement ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [PySymbol](/api-reference/python/PySymbol), [Assignment](/api-reference/core/Assignment), [Symbol](/api-reference/core/Symbol), [HasValue](/api-reference/core/HasValue), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -179,7 +179,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a Python symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ PyAssignment ] } description="The code flag object for tracking purposes"/> @@ -291,7 +291,7 @@ Flags a Python symbol by adding a flag comment and returning a CodeFlag. ### from_named_expression Creates a MultiExpression from a Python named expression. - + get_import_string Generates an import string for a Python symbol. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -369,7 +369,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -488,7 +488,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -496,7 +496,7 @@ Check if this node is contained another node of the given class ### local_usages Retrieves all usages of the assigned variable within its code block scope. - + list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> @@ -504,7 +504,7 @@ Retrieves all usages of the assigned variable within its code block scope. ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -541,7 +541,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -549,7 +549,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an assignment expression by reducing it based on a boolean condition and updating all the usages. - + remove Deletes this assignment and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_type_annotation Adds or updates a type annotation for the current assignment. - + set_value Sets the value of an assignment expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [AssignmentStatement](/api-reference/core/AssignmentStatement), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyAssignmentStatement ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_assignment Creates a PyAssignmentStatement instance from a TreeSitter assignment node. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -362,7 +362,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -370,7 +370,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -378,7 +378,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -386,7 +386,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -394,7 +394,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [PyAssignmentStatement](/api-reference/python/PyAssignmentStatement), [Attribute](/api-reference/core/Attribute), [AssignmentStatement](/api-reference/core/AssignmentStatement), [Usable](/api-reference/core/Usable), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -127,7 +127,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyAttribute ] } description=""/> @@ -239,7 +239,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### from_assignment Creates a PyAssignmentStatement instance from a TreeSitter assignment node. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -300,7 +300,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -413,7 +413,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -421,7 +421,7 @@ Check if this node is contained another node of the given class ### local_usages Returns all instances where this attribute is used within its parent code block. - + list[ Editable [ PyAttribute ]] } description="A sorted list of unique attribute references. Each reference is an Editable object representing a usage of this attribute."/> @@ -429,7 +429,7 @@ Returns all instances where this attribute is used within its parent code block. ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -437,7 +437,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -445,7 +445,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -453,7 +453,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of a node's assignment. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -130,7 +130,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyBlockStatement ] } description=""/> @@ -219,7 +219,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -332,7 +332,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -340,7 +340,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -348,7 +348,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -356,7 +356,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -364,7 +364,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyBreakStatement ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [CatchStatement](/api-reference/core/CatchStatement), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyCatchStatement ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [ChainedAttribute](/api-reference/core/ChainedAttribute), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyChainedAttribute ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [PySymbol](/api-reference/python/PySymbol), [Class](/api-reference/core/Class), [HasBlock](/api-reference/core/HasBlock), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -151,7 +151,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_attribute Adds an attribute to a class from another class. - + add_attribute_from_source Adds an attribute to a class from raw source code, placing it in a specific location - + add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_source Adds source code to the class definition. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -291,7 +291,7 @@ Find all ancestors of the node of the given type. Does not return itself ### attributes Retrieves all attributes from this Class including those from its superclasses up to a - + dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a Python symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ PyClass ] } description="The code flag object for tracking purposes"/> @@ -426,7 +426,7 @@ Flags a Python symbol by adding a flag comment and returning a CodeFlag. ### get_attribute Returns a specific attribute by name. - + get_import_string Generates an import string for a Python symbol. - + get_method Returns a specific method by name from the class or any of its superclasses. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -503,7 +503,7 @@ Returns the name node of the object. ### get_nested_class Returns a nested class by name from the current class. - + get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_parent_class Returns the parent class node with the specified name. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -707,7 +707,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_subclass_of Checks if the class inherits from a specified parent class. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -738,7 +738,7 @@ Check if this node is contained another node of the given class ### methods Retrieves all methods that exist on this Class, including methods from superclasses, with - + move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -804,7 +804,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -812,7 +812,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -820,7 +820,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_docstring Sets or updates a docstring for a Python function or class. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + subclasses Returns all classes which subclass this class. - + superclasses Returns a list of all classes that this class extends, up to max_depth. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [CodeBlock](/api-reference/core/CodeBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -127,7 +127,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyCodeBlock ] } description=""/> @@ -216,7 +216,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_assignments Returns a list of assignments with the specified variable name. - + get_attributes Returns attributes from the code block, with the option to include or exclude private - + get_comment Gets the first comment statement containing a specific text string. - + get_local_var_assignment Returns the first code statement that assigns a local variable with the specified name. - + get_local_var_assignments Returns all instances of local variable assignments that match the specified variable - + get_statements Returns all statements of a given type up to the specified block level. - + get_variable_usages Returns all instances of variable usages in a code block. - + get_with_statements Gets with statements at a specific block level. - + indent Adjusts the indentation level of the entire code block. - + insert_after Inserts source code at the bottom of the code block. - + insert_before Inserts new source code at the top of the code block. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -441,7 +441,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -449,7 +449,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -457,7 +457,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -465,7 +465,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -473,7 +473,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_variable_usages Renames all instances of variable usages in the code block. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + unwrap Extracts a code block from its parent wrapper container by removing the wrapping - + None } description=""/> @@ -609,7 +609,7 @@ Extracts a code block from its parent wrapper container by removing the wrapping ### wrap Wraps a code block with a statement and indents it. - + + ### Inherits from [Comment](/api-reference/core/Comment), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -103,7 +103,7 @@ Find all ancestors of the node of the given type. Does not return itself ### clean_comment Cleans a comment block by removing comment symbols, leading/trailing whitespace, and standardizing indentation. - + edit Replace the source of this `Editable` with `new_src`. - + edit_text Replace the text of a comment with new text. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyComment ] } description=""/> @@ -226,7 +226,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### generate_comment Converts text content into a Python comment block. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -374,7 +374,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -382,7 +382,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -390,7 +390,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -398,7 +398,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -406,7 +406,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [CommentGroup](/api-reference/core/CommentGroup), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + edit_text Replace the text content of a comment group with new text. - + find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyCommentGroup ] } description=""/> @@ -197,7 +197,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -310,7 +310,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -318,7 +318,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -334,7 +334,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -342,7 +342,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + to_google_docstring Convert a comment group into a Google-style docstring. - + + ## Attributes diff --git a/docs/api-reference/python/PyConditionalExpression.mdx b/docs/api-reference/python/PyConditionalExpression.mdx index 4caa1160c..9cdcadd53 100644 --- a/docs/api-reference/python/PyConditionalExpression.mdx +++ b/docs/api-reference/python/PyConditionalExpression.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [TernaryExpression](/api-reference/core/TernaryExpression), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyConditionalExpression ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a ternary expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Decorator](/api-reference/core/Decorator), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyDecorator ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [SourceFile](/api-reference/core/SourceFile), [HasBlock](/api-reference/core/HasBlock), [Usable](/api-reference/core/Usable), [File](/api-reference/core/File), [Expression](/api-reference/core/Expression), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [HasName](/api-reference/core/HasName) @@ -167,7 +167,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + add_import Adds an import to the file. - + add_symbol Adds `symbol` to the file. - + add_symbol_from_source Adds a symbol to a file from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -273,7 +273,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this file with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_by_byte_range Finds all editable objects that overlap with the given byte range in the file. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyFile ] } description=""/> @@ -402,7 +402,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Returns a specific Class by full name. Returns None if not found. - + get_extensions Returns the file extensions associated with Python files. - + list[str] } description="A list containing '.py' as the only Python file extension."/> @@ -427,7 +427,7 @@ Returns the file extensions associated with Python files. ### get_function Returns a specific Function by name. - + get_global_var Returns a specific global var by name. Returns None if not found. - + get_import Returns the import with matching alias. Returns None if not found. - + get_import_insert_index Determines the index position where a new import statement should be inserted in a Python file. - + get_import_string Generates an import string for a symbol. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -538,7 +538,7 @@ Returns the name node of the object. ### get_symbol Gets a symbol by its name from the file. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + has_import Returns True if the file has an import with the given alias. - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -685,7 +685,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -693,7 +693,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -701,7 +701,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -709,7 +709,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -717,7 +717,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -725,7 +725,7 @@ Removes the file from the file system and graph. ### rename Renames a symbol and updates all its references in the codebase. - + replace Replace occurrences of text in the file. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + set_name Sets the name of a code element. - + symbol_can_be_added Checks if a Python symbol can be added to this Python source file. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + symbols Returns all Symbols in the file, sorted by position in the file. - + list[ PySymbol | PyClass | PyFunction | PyAssignment | Interface ] } 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"/> @@ -912,7 +912,7 @@ Returns all Symbols in the file, sorted by position in the file. ### update_filepath Renames the file and updates all imports to point to the new location. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [ForLoopStatement](/api-reference/core/ForLoopStatement), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -138,7 +138,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyForLoopStatement ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -340,7 +340,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -348,7 +348,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -356,7 +356,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -364,7 +364,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -372,7 +372,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [PySymbol](/api-reference/python/PySymbol), [Function](/api-reference/core/Function), [HasBlock](/api-reference/core/HasBlock), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -187,7 +187,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_statements Adds statements to the end of a function body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -287,7 +287,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Modifies the function to be asynchronous. - + None } description=""/> @@ -295,7 +295,7 @@ Modifies the function to be asynchronous. ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a Python symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ PyFunction ] } description="The code flag object for tracking purposes"/> @@ -407,7 +407,7 @@ Flags a Python symbol by adding a flag comment and returning a CodeFlag. ### get_import_string Generates an import string for a Python symbol. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -450,7 +450,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + insert_statements Inserts lines of code into the function body at the specified index. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -643,7 +643,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -651,7 +651,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -688,7 +688,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -696,7 +696,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### prepend_statements Prepends statements to the start of the function body. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -721,7 +721,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + rename_local_variable Renames a local variable and all its usages within a function body. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_docstring Sets or updates a docstring for a Python function or class. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_return_type Sets or modifies the return type annotation of a function. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyNamedType](/api-reference/python/PyNamedType), [GenericType](/api-reference/core/GenericType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyGenericType ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -118,7 +118,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyHasBlock ] } description=""/> @@ -207,7 +207,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -320,7 +320,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -328,7 +328,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -336,7 +336,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -344,7 +344,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -352,7 +352,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [IfBlockStatement](/api-reference/core/IfBlockStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -119,7 +119,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + elif_statements Returns all elif blocks within the if block. - + list[ PyIfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> @@ -162,7 +162,7 @@ Returns all elif blocks within the if block. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyIfBlockStatement ] } description=""/> @@ -216,7 +216,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -329,7 +329,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -337,7 +337,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -345,7 +345,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -353,7 +353,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a conditional block by reducing its condition to a boolean value. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Import](/api-reference/core/Import), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -135,7 +135,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -143,7 +143,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyImport ] } description=""/> @@ -255,7 +255,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates an import string for a Python import statement. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -298,7 +298,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased_import Returns True if this import is aliased. - + bool } description="True if the import has an alias different from its original name, False otherwise."/> @@ -411,7 +411,7 @@ Returns True if this import is aliased. ### is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -419,7 +419,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_module_import Determines if the import is a module-level or wildcard import. - + bool } description="True if the import is a module-level or wildcard import, False otherwise."/> @@ -427,7 +427,7 @@ Determines if the import is a module-level or wildcard import. ### is_reexport Returns true if the Import object is also an Export object. - + bool } description="True if the import is re-exported, False otherwise."/> @@ -435,7 +435,7 @@ Returns true if the Import object is also an Export object. ### is_symbol_import Returns True if this import is importing a symbol rather than a module. - + bool } description="True if this import is a symbol import, False if it is a module import."/> @@ -443,7 +443,7 @@ Returns True if this import is importing a symbol rather than a module. ### is_wildcard_import Returns True if the import symbol is a wildcard import. - + bool } description="True if this is a wildcard import, False otherwise."/> @@ -451,7 +451,7 @@ Returns True if the import symbol is a wildcard import. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -459,7 +459,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -467,7 +467,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -475,7 +475,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -483,7 +483,7 @@ Reduces an editable to the following condition ### remove Remove this import from the import statement. - + rename Renames the import symbol and updates all its usages throughout the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_import_module Sets the module of an import. - + set_import_symbol_alias Sets alias or name of an import at the declaration level. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [ImportStatement](/api-reference/core/ImportStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyImportStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [SwitchCase](/api-reference/core/SwitchCase), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyMatchCase ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -336,7 +336,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -344,7 +344,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -352,7 +352,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -360,7 +360,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -368,7 +368,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [SwitchStatement](/api-reference/core/SwitchStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyMatchStatement ] } description=""/> @@ -188,7 +188,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyNamedType ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -184,7 +184,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [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) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_trailing_comment Add a trailing comment to a parameter in a function signature. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -132,7 +132,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyParameter ] } description=""/> @@ -244,7 +244,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | PyChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -252,7 +252,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -365,7 +365,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -373,7 +373,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -381,7 +381,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -389,7 +389,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -397,7 +397,7 @@ Reduces an editable to the following condition ### remove Removes the parameter from the function definition and all its call sites. - + rename Renames a parameter in a function definition and updates all related references. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_type_annotation Sets the type annotation of a parameter. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyPassStatement ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -21,7 +21,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Edits or creates a return type annotation for a method or function. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/python/PyString.mdx b/docs/api-reference/python/PyString.mdx index 0a3b980f8..87794660e 100644 --- a/docs/api-reference/python/PyString.mdx +++ b/docs/api-reference/python/PyString.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [String](/api-reference/core/String), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyString ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Symbol](/api-reference/core/Symbol), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -159,7 +159,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a Python symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ PySymbol ] } description="The code flag object for tracking purposes"/> @@ -271,7 +271,7 @@ Flags a Python symbol by adding a flag comment and returning a CodeFlag. ### get_import_string Generates an import string for a Python symbol. - + get_name Returns the name node of the object. - + Name | PyChainedAttribute | 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."/> @@ -314,7 +314,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -433,7 +433,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -441,7 +441,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -478,7 +478,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -486,7 +486,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -494,7 +494,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment for the Python symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [PyBlockStatement](/api-reference/python/PyBlockStatement), [TryCatchStatement](/api-reference/core/TryCatchStatement), [PyHasBlock](/api-reference/python/PyHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -138,7 +138,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyTryCatchStatement ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -340,7 +340,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -348,7 +348,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -356,7 +356,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -364,7 +364,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -372,7 +372,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [UnionType](/api-reference/core/UnionType), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -99,7 +99,7 @@ Edit the source for this Collection instance. ### find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyUnionType ] } description=""/> @@ -153,7 +153,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -184,7 +184,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -192,7 +192,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -282,7 +282,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -290,7 +290,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -306,7 +306,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -314,7 +314,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [PyHasBlock](/api-reference/python/PyHasBlock), [WhileStatement](/api-reference/core/WhileStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -138,7 +138,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ PyWhileStatement ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -340,7 +340,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -348,7 +348,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -356,7 +356,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -364,7 +364,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -372,7 +372,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a Python function or class. - + + ### Inherits from [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -95,7 +95,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_prop Adds a new prop to a JSXElement. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -126,7 +126,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ JSXElement ] } description=""/> @@ -215,7 +215,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -223,7 +223,7 @@ Returns the name node of the object. ### get_prop Returns the JSXProp with the given name from the JSXElement. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -353,7 +353,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -361,7 +361,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -369,7 +369,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -377,7 +377,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -385,7 +385,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a JSXElement by modifying both opening and closing tags. - + wrap Wraps the current JSXElement with the provided opening and closing tags, properly handling indentation. - + + ### Inherits from [Unwrappable](/api-reference/core/Unwrappable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ JSXExpression ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a JSX expression by reducing it based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + 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 c592aaf16..61542db09 100644 --- a/docs/api-reference/typescript/JSXProp.mdx +++ b/docs/api-reference/typescript/JSXProp.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ JSXProp ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -192,7 +192,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after a JSX prop in a TypeScript/JSX file. - + insert_before Insert a new source code string before a JSX prop in a React component. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -305,7 +305,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -313,7 +313,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -329,7 +329,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -337,7 +337,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [TSNamedType](/api-reference/typescript/TSNamedType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSArrayType ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -184,7 +184,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [TSSymbol](/api-reference/typescript/TSSymbol), [Assignment](/api-reference/core/Assignment), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [HasValue](/api-reference/core/HasValue), [Typeable](/api-reference/core/Typeable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -139,7 +139,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -199,7 +199,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSAssignment ] } description="The code flag object for tracking purposes"/> @@ -311,7 +311,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### from_named_expression Creates a MultiExpression object from a TypeScript named expression node. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -389,7 +389,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -508,7 +508,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -516,7 +516,7 @@ Check if this node is contained another node of the given class ### local_usages Retrieves all usages of the assigned variable within its code block scope. - + list[ Editable [ Statement ]] } description="A sorted list of statement nodes where the variable is used."/> @@ -524,7 +524,7 @@ Retrieves all usages of the assigned variable within its code block scope. ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -561,7 +561,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -569,7 +569,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies an assignment expression by reducing it based on a boolean condition and updating all the usages. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment for an assignment node. - + set_name Sets the name of a code element. - + set_type_annotation Adds or updates a type annotation for the current assignment. - + set_value Sets the value of an assignment expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [AssignmentStatement](/api-reference/core/AssignmentStatement), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSAssignmentStatement ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -309,7 +309,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -317,7 +317,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -333,7 +333,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -341,7 +341,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [TSAssignmentStatement](/api-reference/typescript/TSAssignmentStatement), [Attribute](/api-reference/core/Attribute), [AssignmentStatement](/api-reference/core/AssignmentStatement), [Usable](/api-reference/core/Usable), [HasValue](/api-reference/core/HasValue), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -127,7 +127,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSAttribute ] } description=""/> @@ -239,7 +239,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -247,7 +247,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -360,7 +360,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -368,7 +368,7 @@ Check if this node is contained another node of the given class ### local_usages Returns local usages of a TypeScript attribute within its code block. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -393,7 +393,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -401,7 +401,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -409,7 +409,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of a node's assignment. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -103,7 +103,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -134,7 +134,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSBlockStatement ] } description=""/> @@ -223,7 +223,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -353,7 +353,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -361,7 +361,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -369,7 +369,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -377,7 +377,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -385,7 +385,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [CatchStatement](/api-reference/core/CatchStatement), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -138,7 +138,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSCatchStatement ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -357,7 +357,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -365,7 +365,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -373,7 +373,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -381,7 +381,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -389,7 +389,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [ChainedAttribute](/api-reference/core/ChainedAttribute), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSChainedAttribute ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [Class](/api-reference/core/Class), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -179,7 +179,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_attribute Adds an attribute to a class from another class. - + add_attribute_from_source Adds a class attribute from source code to a TypeScript/JavaScript class. - + add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_source Adds source code to a class body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -319,7 +319,7 @@ Find all ancestors of the node of the given type. Does not return itself ### attributes Retrieves all attributes from this Class including those from its superclasses up to a - + class_component_to_function_component Converts a class component to a function component. - + None } description=""/> @@ -350,7 +350,7 @@ Converts a class component to a function component. ### convert_props_to_interface Converts React component props to TypeScript interfaces. - + None } description=""/> @@ -358,7 +358,7 @@ Converts React component props to TypeScript interfaces. ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSClass ] } description="The code flag object for tracking purposes"/> @@ -470,7 +470,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_attribute Returns a specific attribute by name. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_method Returns a specific method by name from the class or any of its superclasses. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -564,7 +564,7 @@ Returns the name node of the object. ### get_nested_class Returns a nested class by name from the current class. - + get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_parent_class Returns the parent class node with the specified name. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -768,7 +768,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_subclass_of Checks if the class inherits from a specified parent class. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -799,7 +799,7 @@ Check if this node is contained another node of the given class ### methods Retrieves all methods that exist on this Class, including methods from superclasses, with - + move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -865,7 +865,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -873,7 +873,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -881,7 +881,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + subclasses Returns all classes which subclass this class. - + superclasses Returns a list of all classes that this class extends, up to max_depth. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [CodeBlock](/api-reference/core/CodeBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -115,7 +115,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -123,7 +123,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSCodeBlock ] } description=""/> @@ -212,7 +212,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_assignments Returns a list of assignments with the specified variable name. - + get_attributes Returns attributes from the code block, with the option to include or exclude private - + get_comment Gets the first comment statement containing a specific text string. - + get_local_var_assignment Returns the first code statement that assigns a local variable with the specified name. - + get_local_var_assignments Returns all instances of local variable assignments that match the specified variable - + get_statements Returns all statements of a given type up to the specified block level. - + get_variable_usages Returns all instances of variable usages in a code block. - + indent Adjusts the indentation level of the entire code block. - + insert_after Inserts source code at the bottom of the code block. - + insert_before Inserts new source code at the top of the code block. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -420,7 +420,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -428,7 +428,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -436,7 +436,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -444,7 +444,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -452,7 +452,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename_variable_usages Renames all instances of variable usages in the code block. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + unwrap Unwraps a code block by removing its opening and closing braces. - + None } description=""/> @@ -588,7 +588,7 @@ Unwraps a code block by removing its opening and closing braces. ### wrap Wraps a code block with a statement and indents it. - + + ### Inherits from [Comment](/api-reference/core/Comment), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### clean_comment Cleans comment markers and whitespace from a comment string. - + edit Replace the source of this `Editable` with `new_src`. - + edit_text Replace the text of a comment with new text. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSComment ] } description=""/> @@ -222,7 +222,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### generate_comment Generates a TypeScript comment block from the given text content. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -370,7 +370,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -378,7 +378,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -386,7 +386,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -394,7 +394,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -402,7 +402,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [CommentGroup](/api-reference/core/CommentGroup), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this node with new text. - + edit_text Replace the text content of a comment group with new text. - + find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSCommentGroup ] } description=""/> @@ -197,7 +197,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -310,7 +310,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -318,7 +318,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -326,7 +326,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -334,7 +334,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -342,7 +342,7 @@ Reduces an editable to the following condition ### remove Removes this node and its related extended nodes from the codebase. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ## Attributes diff --git a/docs/api-reference/typescript/TSConditionalType.mdx b/docs/api-reference/typescript/TSConditionalType.mdx index a17f2fdaf..5edeeb05c 100644 --- a/docs/api-reference/typescript/TSConditionalType.mdx +++ b/docs/api-reference/typescript/TSConditionalType.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSConditionalType ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ## Attributes @@ -69,7 +69,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### resolve_base_url Resolves an import path with the base url. - + str } description=""/> @@ -77,7 +77,7 @@ Resolves an import path with the base url. ### translate_absolute_path Translates an absolute path to an import path using the tsconfig paths. - + translate_import_path Translates an import path to an absolute path using the tsconfig paths. - + + ### Inherits from [Decorator](/api-reference/core/Decorator), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSDecorator ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Dict](/api-reference/core/Dict), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSDict ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -147,7 +147,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -230,7 +230,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSEnum ] } description="The code flag object for tracking purposes"/> @@ -342,7 +342,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_attribute Returns an attribute from the TypeScript enum by its name. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -419,7 +419,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -538,7 +538,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -546,7 +546,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -583,7 +583,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -591,7 +591,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -599,7 +599,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasValue](/api-reference/core/HasValue), [Export](/api-reference/core/Export), [Editable](/api-reference/core/Editable), [Exportable](/api-reference/core/Exportable), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -123,7 +123,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -131,7 +131,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSExport ] } description=""/> @@ -243,7 +243,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Returns the import string for this export. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -286,7 +286,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased Determines if the Export object is aliased. - + bool } description="True if the exported symbol has a different name than the name it is exported as, False otherwise."/> @@ -399,7 +399,7 @@ Determines if the Export object is aliased. ### is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -407,7 +407,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_default_export Determines if an export is the default export for a file. - + bool } description="True if this is a default export, False otherwise."/> @@ -415,7 +415,7 @@ Determines if an export is the default export for a file. ### is_default_symbol_export Returns True if this is exporting a default symbol, as opposed to a default object export. - + is_module_export Determines if the export is exporting a module rather than a symbol. - + bool } description="True if the export represents a module export, False otherwise."/> @@ -440,7 +440,7 @@ Determines if the export is exporting a module rather than a symbol. ### is_named_export Determines whether this export is a named export. - + bool } description="True if this is a named export, False if it is a default export."/> @@ -448,7 +448,7 @@ Determines whether this export is a named export. ### is_reexport Returns whether the export is re-exporting an import or export. - + is_type_export Determines if this export is exclusively exporting a type. - + bool } description="True if this is a type-only export, False otherwise."/> @@ -473,7 +473,7 @@ Determines if this export is exclusively exporting a type. ### is_wildcard_export Determines if the export is a wildcard export. - + bool } description="True if the export is a wildcard export (e.g. 'export * from "./module"'), False otherwise."/> @@ -481,7 +481,7 @@ Determines if the export is a wildcard export. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -489,7 +489,7 @@ Check if this node is contained another node of the given class ### make_non_default Converts the export to a named export. - + None } description=""/> @@ -497,7 +497,7 @@ Converts the export to a named export. ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -505,7 +505,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -513,7 +513,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -521,7 +521,7 @@ Reduces an editable to the following condition ### reexport_symbol Returns the import object that is re-exporting this symbol. - + TSImport | None } description="The import object being re-exported, or None if this is not a re-export or no import was found."/> @@ -529,7 +529,7 @@ Returns the import object that is re-exporting this symbol. ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + to_import_string Converts this export into its equivalent import string representation. - + str } description="The import string representation of this export. Examples: - For `export { foo } from './bar'` -> `import { foo } from './bar'` - For `export * from './bar'` -> `import * as _namespace from './bar'` - For `export { default as foo } from './bar'` -> `import foo from './bar'`"/> @@ -710,7 +710,7 @@ Converts this export into its equivalent import string representation. ### usages Returns a list of usages of the exportable object. - + + ### Inherits from [TSNamedType](/api-reference/typescript/TSNamedType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSExpressionType ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [TSHasBlock](/api-reference/typescript/TSHasBlock), [SourceFile](/api-reference/core/SourceFile), [Usable](/api-reference/core/Usable), [HasBlock](/api-reference/core/HasBlock), [File](/api-reference/core/File), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable), [HasName](/api-reference/core/HasName) @@ -219,7 +219,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + add_export_to_symbol Adds an export keyword to a symbol in a TypeScript file. - + add_import Adds an import to the file. - + add_symbol Adds `symbol` to the file. - + add_symbol_from_source Adds a symbol to a file from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -342,7 +342,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this file with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_by_byte_range Finds all editable objects that overlap with the given byte range in the file. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSFile ] } description=""/> @@ -471,7 +471,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_class Returns a specific Class by full name. Returns None if not found. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_config Returns the nearest tsconfig.json applicable to this file. - + TSConfig | None } description="The TypeScript configuration object if found, None otherwise."/> @@ -513,7 +513,7 @@ Returns the nearest tsconfig.json applicable to this file. ### get_export Returns an export object with the specified name from the file. - + get_export_statement_for_path Gets the first export of specified type that contains the given path in single or double quotes. - + get_extensions Returns a list of file extensions that this class can parse. - + list[str] } description="A list of file extensions including '.tsx', '.ts', '.jsx', and '.js'."/> @@ -561,7 +561,7 @@ Returns a list of file extensions that this class can parse. ### get_function Returns a specific Function by name. - + get_global_var Returns a specific global var by name. Returns None if not found. - + get_import Returns the import with matching alias. Returns None if not found. - + get_import_string Generates and returns an import statement for the file. - + get_interface Retrieves a specific interface from the file by its name. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -672,7 +672,7 @@ Returns the name node of the object. ### get_namespace Returns a specific namespace by name from the file's namespaces. - + get_symbol Gets a symbol by its name from the file. - + get_type Returns a specific Type by name from the file's types. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + has_export_statement_for_path Checks if the file has exports of specified type that contains the given path in single or double quotes. - + has_import Returns True if the file has an import with the given alias. - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -876,7 +876,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -884,7 +884,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -892,7 +892,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -900,7 +900,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -908,7 +908,7 @@ Reduces an editable to the following condition ### remove Removes the file from the file system and graph. - + None } description=""/> @@ -916,7 +916,7 @@ Removes the file from the file system and graph. ### remove_unused_exports Removes unused exports from the file. - + None } description=""/> @@ -924,7 +924,7 @@ Removes unused exports from the file. ### rename Renames a symbol and updates all its references in the codebase. - + replace Replace occurrences of text in the file. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + set_name Sets the name of a code element. - + symbol_can_be_added Determines if a TypeScript symbol can be added to this file based on its type and JSX compatibility. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + symbols Returns all Symbols in the file, sorted by position in the file. - + list[ TSSymbol | TSClass | TSFunction | TSAssignment | TSInterface ] } 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"/> @@ -1117,7 +1117,7 @@ Returns all Symbols in the file, sorted by position in the file. ### update_filepath Updates the file path of the current file and all associated imports. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [ForLoopStatement](/api-reference/core/ForLoopStatement), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -127,7 +127,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -158,7 +158,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSForLoopStatement ] } description=""/> @@ -247,7 +247,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -377,7 +377,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -385,7 +385,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -393,7 +393,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -401,7 +401,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -409,7 +409,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [Function](/api-reference/core/Function), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Callable](/api-reference/core/Callable), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -219,7 +219,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_statements Adds statements to the end of a function body. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -319,7 +319,7 @@ Find all ancestors of the node of the given type. Does not return itself ### arrow_to_named Converts an arrow function to a named function in TypeScript/JavaScript. - + asyncify Modifies the function to be asynchronous, if it is not already. - + None } description=""/> @@ -344,7 +344,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=""/> @@ -352,7 +352,7 @@ Converts React component props to TypeScript interfaces. ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSFunction ] } description="The code flag object for tracking purposes"/> @@ -464,7 +464,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -524,7 +524,7 @@ Returns the name node of the object. ### get_parameter Gets a specific parameter from the callable's parameters list by name. - + get_parameter_by_index Returns the parameter at the given index. - + get_parameter_by_type Retrieves a parameter from the callable by its type. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + insert_statements Inserts lines of code into the function body at the specified index. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -717,7 +717,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_valid_node Determines if a given tree-sitter node corresponds to a valid function type. - + is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -742,7 +742,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -779,7 +779,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -787,7 +787,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### prepend_statements Prepends the provided code to the beginning of the function body. - + reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -812,7 +812,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + rename_local_variable Renames a local variable and all its usages within a function body. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_return_type Sets the return type annotation for the function. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### asyncify Modifies the function type to be asynchronous by wrapping its return type in a Promise. - + None } description=""/> @@ -99,7 +99,7 @@ Modifies the function type to be asynchronous by wrapping its return type in a P ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSFunctionType ] } description=""/> @@ -188,7 +188,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [GenericType](/api-reference/core/GenericType), [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSGenericType ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -188,7 +188,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasBlock](/api-reference/core/HasBlock), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -122,7 +122,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSHasBlock ] } description=""/> @@ -211,7 +211,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -341,7 +341,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -349,7 +349,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -357,7 +357,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -365,7 +365,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -373,7 +373,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [IfBlockStatement](/api-reference/core/IfBlockStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -119,7 +119,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + elif_statements Returns all elif blocks within the if block. - + list[ TSIfBlockStatement ] } description="A list of elif block statements. Empty list if no elif blocks exist."/> @@ -162,7 +162,7 @@ Returns all elif blocks within the if block. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSIfBlockStatement ] } description=""/> @@ -216,7 +216,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -329,7 +329,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -337,7 +337,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -345,7 +345,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -353,7 +353,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a conditional block by reducing its condition to a boolean value. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [Import](/api-reference/core/Import), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName) @@ -159,7 +159,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -167,7 +167,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSImport ] } description=""/> @@ -279,7 +279,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_import_string Generates an import string for an import statement. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -322,7 +322,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_aliased_import Returns True if this import is aliased. - + bool } description="True if the import has an alias different from its original name, False otherwise."/> @@ -435,7 +435,7 @@ Returns True if this import is aliased. ### is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -443,7 +443,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_default_import Determines whether the import is a default export import. - + is_module_import Determines if an import represents a module-level import. - + is_reexport Returns true if the Import object is also an Export object. - + bool } description="True if the import is re-exported, False otherwise."/> @@ -485,7 +485,7 @@ Returns true if the Import object is also an Export object. ### is_symbol_import Returns True if this import is importing a symbol rather than a module. - + bool } description="True if this import is a symbol import, False if it is a module import."/> @@ -493,7 +493,7 @@ Returns True if this import is importing a symbol rather than a module. ### is_type_import Checks if an import is a type import. - + bool } description="True if the import is a type import, False otherwise."/> @@ -501,7 +501,7 @@ Checks if an import is a type import. ### is_wildcard_import Returns True if the import symbol is a wildcard import. - + bool } description="True if this is a wildcard import, False otherwise."/> @@ -509,7 +509,7 @@ Returns True if the import symbol is a wildcard import. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -517,7 +517,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -525,7 +525,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -533,7 +533,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -541,7 +541,7 @@ Reduces an editable to the following condition ### remove Remove this import from the import statement. - + rename Renames the import symbol and updates all its usages throughout the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve_import Resolves an import statement to its target file and symbol. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_import_module Sets the module of an import. - + set_import_symbol_alias Sets alias or name of an import at the declaration level. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [ImportStatement](/api-reference/core/ImportStatement), [Statement](/api-reference/core/Statement), [Editable](/api-reference/core/Editable), [Expression](/api-reference/core/Expression) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSImportStatement ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [Interface](/api-reference/core/Interface), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -151,7 +151,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -234,7 +234,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + extends Returns True if the interface implements the given parent interface. - + bool } description=""/> @@ -300,7 +300,7 @@ Returns True if the interface implements the given parent interface. ### find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSInterface ] } description="The code flag object for tracking purposes"/> @@ -354,7 +354,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_attribute Returns the attribute with the given name, if it exists. - + TSAttribute | None } description=""/> @@ -362,7 +362,7 @@ Returns the attribute with the given name, if it exists. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -422,7 +422,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + implementations Returns all classes and interfaces that implement a given interface. - + list[ TSInterface | TSClass ] } description=""/> @@ -453,7 +453,7 @@ Returns all classes and interfaces that implement a given interface. ### insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -549,7 +549,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -557,7 +557,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -594,7 +594,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -602,7 +602,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -610,7 +610,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [HasName](/api-reference/core/HasName), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -99,7 +99,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -107,7 +107,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSLabeledStatement ] } description=""/> @@ -196,7 +196,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | None } description="The name node of the object. Can be a Name node for simple names, a ChainedAttribute for names with namespaces (e.g., a.b), or None if the object has no name."/> @@ -204,7 +204,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -317,7 +317,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -325,7 +325,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -333,7 +333,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -341,7 +341,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -349,7 +349,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSLookupType ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [NamedType](/api-reference/core/NamedType), [HasName](/api-reference/core/HasName), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSNamedType ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -184,7 +184,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Sets the name of an object and updates all its usages. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + + ### Inherits from [HasName](/api-reference/core/HasName), [TSHasBlock](/api-reference/typescript/TSHasBlock), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable) @@ -155,7 +155,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + add_symbol Adds a new symbol to the namespace, optionally exporting it if applicable. If the symbol already exists in the namespace, returns the existing symbol. - + TSSymbol | None } description="The existing symbol if it already exists in the file or None if it was added."/> @@ -238,7 +238,7 @@ Adds a new symbol to the namespace, optionally exporting it if applicable. If th ### add_symbol_from_source Adds a symbol to a namespace from a string representation. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -263,7 +263,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSNamespace ] } description="The code flag object for tracking purposes"/> @@ -375,7 +375,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_class Get a class by name from this namespace. - + TSClass | None } description=""/> @@ -383,7 +383,7 @@ Get a class by name from this namespace. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_enum Get an enum by name from this namespace. - + TSEnum | None } description=""/> @@ -408,7 +408,7 @@ Get an enum by name from this namespace. ### get_function Get a function by name from this namespace. - + TSFunction | None } description=""/> @@ -416,7 +416,7 @@ Get a function by name from this namespace. ### get_import_string Generates the appropriate import string for a symbol. - + get_interface Get an interface by name from this namespace. - + TSInterface | None } description=""/> @@ -459,7 +459,7 @@ Get an interface by name from this namespace. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -467,7 +467,7 @@ Returns the name node of the object. ### get_namespace Get a namespace by name from this namespace. - + TSNamespace | None } description="The found namespace, or None if not found"/> @@ -475,7 +475,7 @@ Get a namespace by name from this namespace. ### get_nested_namespaces Get all nested namespaces within this namespace. - + list[ TSNamespace ] } description="List of all nested namespace objects"/> @@ -483,7 +483,7 @@ Get all nested namespaces within this namespace. ### get_symbol Get an exported or private symbol by name from this namespace. Returns only exported symbols by default. - + TSSymbol | None } description="The found symbol, or None if not found"/> @@ -491,7 +491,7 @@ Get an exported or private symbol by name from this namespace. Returns only expo ### get_type Get a type alias by name from this namespace. - + TSTypeAlias | None } description=""/> @@ -499,7 +499,7 @@ Get a type alias by name from this namespace. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -618,7 +618,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -626,7 +626,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -663,7 +663,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -671,7 +671,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -679,7 +679,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + remove_symbol Removes a symbol from the namespace by name. - + TSSymbol | None } description=""/> @@ -716,7 +716,7 @@ Removes a symbol from the namespace by name. ### rename Sets the name of an object and updates all its usages. - + rename_symbol Renames a symbol within the namespace. - + None } description=""/> @@ -741,7 +741,7 @@ Renames a symbol within the namespace. ### replace Search and replace occurrences of text within this node's source and its extended nodes. - + resolve_attribute Resolves an attribute access on the namespace. - + TSSymbol | None } description=""/> @@ -790,7 +790,7 @@ Resolves an attribute access on the namespace. ### resolve_import Resolves an import name to a symbol within this namespace. - + TSSymbol | None } description=""/> @@ -798,7 +798,7 @@ Resolves an import name to a symbol within this namespace. ### search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [TSDict](/api-reference/typescript/TSDict), [Expression](/api-reference/core/Expression), [Dict](/api-reference/core/Dict), [Editable](/api-reference/core/Editable) @@ -75,7 +75,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -83,7 +83,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSObjectType ] } description=""/> @@ -172,7 +172,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -285,7 +285,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -293,7 +293,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -301,7 +301,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -317,7 +317,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Pair](/api-reference/core/Pair), [HasValue](/api-reference/core/HasValue), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSPair ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -325,7 +325,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_value Sets the value of the node's value Expression. - + + ### Inherits from [Parameter](/api-reference/core/Parameter), [HasValue](/api-reference/core/HasValue), [Expression](/api-reference/core/Expression), [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) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -119,7 +119,7 @@ Find all ancestors of the node of the given type. Does not return itself ### convert_to_interface Converts a parameter's inline type definition to an interface. - + None } description=""/> @@ -127,7 +127,7 @@ Converts a parameter's inline type definition to an interface. ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSParameter ] } description=""/> @@ -239,7 +239,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -247,7 +247,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -360,7 +360,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -368,7 +368,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -376,7 +376,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -384,7 +384,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -392,7 +392,7 @@ Reduces an editable to the following condition ### remove Removes the parameter from the function definition and all its call sites. - + rename Renames a parameter in a function definition and updates all related references. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_name Sets the name of a code element. - + set_type_annotation Sets the type annotation for this parameter. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSQueryType ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -289,7 +289,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -79,7 +79,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -87,7 +87,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSReadonlyType ] } description=""/> @@ -176,7 +176,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -289,7 +289,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -297,7 +297,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -321,7 +321,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Placeholder](/api-reference/core/Placeholder) @@ -21,7 +21,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### edit Modifies the return type annotation of a function. - + remove Removes this element from its parent container. - + None } description=""/> diff --git a/docs/api-reference/typescript/TSString.mdx b/docs/api-reference/typescript/TSString.mdx index 589936bfb..436a0abfe 100644 --- a/docs/api-reference/typescript/TSString.mdx +++ b/docs/api-reference/typescript/TSString.mdx @@ -11,7 +11,7 @@ import {HorizontalDivider} from '/snippets/HorizontalDivider.mdx'; import {GithubLinkNote} from '/snippets/GithubLinkNote.mdx'; import {Attribute} from '/snippets/Attribute.mdx'; - + ### Inherits from [String](/api-reference/core/String), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -87,7 +87,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -95,7 +95,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSString ] } description=""/> @@ -184,7 +184,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -297,7 +297,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -305,7 +305,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -313,7 +313,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -321,7 +321,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -329,7 +329,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [SwitchCase](/api-reference/core/SwitchCase), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -142,7 +142,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSSwitchCase ] } description=""/> @@ -231,7 +231,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -361,7 +361,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -369,7 +369,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -377,7 +377,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -385,7 +385,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -393,7 +393,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [SwitchStatement](/api-reference/core/SwitchStatement), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -91,7 +91,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -99,7 +99,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSSwitchStatement ] } description=""/> @@ -188,7 +188,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -301,7 +301,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -309,7 +309,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -325,7 +325,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -333,7 +333,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Usable](/api-reference/core/Usable), [Importable](/api-reference/core/Importable), [Expression](/api-reference/core/Expression), [HasName](/api-reference/core/HasName), [Editable](/api-reference/core/Editable) @@ -119,7 +119,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -179,7 +179,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSSymbol ] } description="The code flag object for tracking purposes"/> @@ -291,7 +291,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -334,7 +334,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -453,7 +453,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -461,7 +461,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -498,7 +498,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -506,7 +506,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -514,7 +514,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [TernaryExpression](/api-reference/core/TernaryExpression), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSTernaryExpression ] } description=""/> @@ -180,7 +180,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -293,7 +293,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -301,7 +301,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -309,7 +309,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -317,7 +317,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Simplifies a ternary expression based on a boolean condition. - + remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [TSBlockStatement](/api-reference/typescript/TSBlockStatement), [TryCatchStatement](/api-reference/core/TryCatchStatement), [TSHasBlock](/api-reference/typescript/TSHasBlock), [BlockStatement](/api-reference/core/BlockStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -111,7 +111,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -142,7 +142,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSTryCatchStatement ] } description=""/> @@ -231,7 +231,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -361,7 +361,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -369,7 +369,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -377,7 +377,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -385,7 +385,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -393,7 +393,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [TypeAlias](/api-reference/core/TypeAlias), [TSSymbol](/api-reference/typescript/TSSymbol), [HasBlock](/api-reference/core/HasBlock), [HasValue](/api-reference/core/HasValue), [Exportable](/api-reference/core/Exportable), [Symbol](/api-reference/core/Symbol), [Expression](/api-reference/core/Expression), [Usable](/api-reference/core/Usable), [Editable](/api-reference/core/Editable), [Importable](/api-reference/core/Importable), [HasName](/api-reference/core/HasName) @@ -151,7 +151,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_comment Adds a new comment to the symbol. - + add_decorator Adds a decorator to a function or method. - + add_keyword Insert a keyword in the appropriate place before this symbol if it doesn't already exist. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -234,7 +234,7 @@ Find all ancestors of the node of the given type. Does not return itself ### dependencies Returns a list of symbols that this symbol depends on. - + edit Replace the source of this node with new_src. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. - + CodeFlag[ TSTypeAlias ] } description="The code flag object for tracking purposes"/> @@ -346,7 +346,7 @@ Flags a TypeScript symbol by adding a flag comment and returning a CodeFlag. ### get_attribute Retrieves a specific attribute from a TypeScript type alias by its name. - + get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_import_string Generates the appropriate import string for a symbol. - + get_name Returns the name node of the object. - + Name | TSChainedAttribute | 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."/> @@ -423,7 +423,7 @@ Returns the name node of the object. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before the current symbol node in the Abstract Syntax Tree. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -542,7 +542,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -550,7 +550,7 @@ Check if this node is contained another node of the given class ### move_to_file Moves the given symbol to a new file and updates its imports and references. - + parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -587,7 +587,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -595,7 +595,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -603,7 +603,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + rename Renames a symbol and updates all its references in the codebase. - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_comment Sets a comment to the symbol. - + set_docstring Sets or updates a docstring for a code element. - + set_inline_comment Sets an inline comment to the symbol. - + set_name Sets the name of a code element. - + set_value Sets the value of the node's value Expression. - + symbol_usages Returns a list of symbols that use or import the exportable object. - + usages Returns a list of usages of the exportable object. - + + ### Inherits from [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -71,7 +71,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -79,7 +79,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSUndefinedType ] } description=""/> @@ -168,7 +168,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -281,7 +281,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -289,7 +289,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -297,7 +297,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -305,7 +305,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -313,7 +313,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + + ### Inherits from [UnionType](/api-reference/core/UnionType), [Type](/api-reference/core/Type), [Expression](/api-reference/core/Expression), [SymbolGroup](/api-reference/core/SymbolGroup), [Editable](/api-reference/core/Editable) @@ -83,7 +83,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -91,7 +91,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Edit the source for this Collection instance. - + None } description=""/> @@ -99,7 +99,7 @@ Edit the source for this Collection instance. ### find Search for substrings in the given symbols that match `strings_to_match`. - + find_string_literals Search for string literals matching given strings in the SymbolGroup. - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSUnionType ] } description=""/> @@ -153,7 +153,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + index Return the index of the first occurrence of value. - + int } description=""/> @@ -184,7 +184,7 @@ Return the index of the first occurrence of value. ### insert Adds `value` to the container that this node represents - + None } description=""/> @@ -192,7 +192,7 @@ Adds `value` to the container that this node represents ### insert_after Inserts source code after this node in the codebase. - + insert_before Inserts source code before this symbol group. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -282,7 +282,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -290,7 +290,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -298,7 +298,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -306,7 +306,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -314,7 +314,7 @@ Reduces an editable to the following condition ### remove Removes an element from a Collection. - + replace Replaces all instances of a string with a new string in all symbols within the group. - + search Searches for regex matches in the codebase. - + + ### Inherits from [TSHasBlock](/api-reference/typescript/TSHasBlock), [WhileStatement](/api-reference/core/WhileStatement), [HasBlock](/api-reference/core/HasBlock), [Statement](/api-reference/core/Statement), [Expression](/api-reference/core/Expression), [Editable](/api-reference/core/Editable) @@ -107,7 +107,7 @@ import {Attribute} from '/snippets/Attribute.mdx'; ### add_decorator Adds a decorator to a function or method. - + ancestors Find all ancestors of the node of the given type. Does not return itself - + list[ Editable ] } description=""/> @@ -138,7 +138,7 @@ Find all ancestors of the node of the given type. Does not return itself ### edit Replace the source of this `Editable` with `new_src`. - + find Find and return matching nodes or substrings within an Editable instance. - + find_string_literals Returns a list of string literals within this node's source that match any of the given - + flag Adds a visual flag comment to the end of this Editable's source text. - + CodeFlag[ TSWhileStatement ] } description=""/> @@ -227,7 +227,7 @@ Adds a visual flag comment to the end of this Editable's source text. ### get_component Returns a specific JSX element from within this symbol's JSX elements. - + get_variable_usages Returns Editables for all TreeSitter nodes corresponding to instances of variable usage - + insert_after Inserts code after this node. - + insert_before Inserts text before this node's source with optional indentation and newline handling. - + is_child_of Checks if this node is a descendant of the given editable instance in the AST. - + bool } description=""/> @@ -357,7 +357,7 @@ Checks if this node is a descendant of the given editable instance in the AST. ### is_wrapped_in Check if this node is contained another node of the given class - + bool } description=""/> @@ -365,7 +365,7 @@ Check if this node is contained another node of the given class ### parent_of_type Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -373,7 +373,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### parent_of_types Find the first ancestor of the node of the given type. Does not return itself - + Editable | None } description=""/> @@ -381,7 +381,7 @@ Find the first ancestor of the node of the given type. Does not return itself ### reduce_condition Reduces an editable to the following condition - + None } description=""/> @@ -389,7 +389,7 @@ Reduces an editable to the following condition ### remove Deletes this Node and its related extended nodes (e.g. decorators, comments). - + replace Search and replace occurrences of text within this node's source and its extended nodes. - + search Returns a list of all regex match of `regex_pattern`, similar to python's re.search(). - + set_docstring Sets or updates a docstring for a code element. - + - You can manage repository access granularly through the GitHub App settings. - - - - Click here to install the Codegen GitHub App and grant necessary permissions. - - - - Ensure the agent has access to the specific repositories it needs to work on. - diff --git a/docs/integrations/linear.mdx b/docs/integrations/linear.mdx deleted file mode 100644 index 687d74cb6..000000000 --- a/docs/integrations/linear.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: "Linear Integration" -sidebarTitle: "Linear" -icon: "pencil" ---- - -Integrate Codegen with your Linear workspace to allow agents to interact with issues, manage projects, and keep your team updated. - - - -## Installation - -Connect your Linear workspace to Codegen to enable agent interactions. - - - Authorize Codegen to access your Linear workspace via the API settings. - - - - API access allows agents to interact with issues and projects according to - your permissions in Linear. - - -## Capabilities - -The Linear integration provides read and write access, enabling agents to manage tasks effectively: - -- **Read Access:** Fetch issue details, read comments, view project status, list team members. -- **Write Access:** Update issue status (e.g., to "In Progress", "Done"), add comments, link GitHub PRs to issues, create new issues, assign tasks. - -## How Agents Use Linear - -Agents use the Linear integration to streamline project management: - -- **Track Work:** Automatically update the status of issues they are working on. -- **Link Code:** Connect implemented changes (GitHub PRs) directly to the relevant Linear issue. -- **Provide Updates:** Post comments on issues with progress reports, results, or questions. -- **Create Tasks:** Generate new issues for follow-up work, bugs discovered, or sub-tasks. diff --git a/docs/integrations/sandboxes.mdx b/docs/integrations/sandboxes.mdx deleted file mode 100644 index 4ae38ea4a..000000000 --- a/docs/integrations/sandboxes.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: "Code Execution Sandboxes" -sidebarTitle: "Sandboxes" -icon: "box" ---- - -Codegen agents operate within secure, isolated sandbox environments where they can safely execute code, install dependencies, and run commands without affecting your local machine or production systems. - -## Capabilities - -Each sandbox provides a controlled environment with: - -- **File System Access:** Read, write, and modify files within the sandbox's temporary file system. -- **Terminal Access:** Execute shell commands (`bash`, `sh`, etc.) to run scripts, linters, formatters, build tools, and other necessary commands. -- **Process Execution:** Run code in various languages (Python, Node.js, etc., depending on the sandbox image). -- **Networking:** Controlled network access for tasks like installing packages or fetching data (can be restricted). - -## How Agents Use Sandboxes - -Agents utilize sandboxes for a variety of tasks: - -- **Testing Code:** Running unit tests, integration tests, or linters against the code they've written or modified. -- **Verifying Changes:** Executing the code to ensure it runs correctly before committing. -- **Installing Dependencies:** Using package managers (`pip`, `npm`, `yarn`) to install necessary libraries. -- **Running Tools:** Executing build scripts, code formatters, or other development utilities. - -## Configuration - -Sandboxes are typically configured per-agent run or defined within your Codegen settings. You often don't need to manage them directly, but advanced configurations might allow specifying Docker images or environment variables. - - - Sandboxes are ephemeral; their state is not typically persisted between agent - runs unless specifically configured for caching or stateful operations. - diff --git a/docs/integrations/slack.mdx b/docs/integrations/slack.mdx deleted file mode 100644 index 0ab5253dc..000000000 --- a/docs/integrations/slack.mdx +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: "Slack Integration" -sidebarTitle: "Slack" -icon: "slack" ---- - -Connect Codegen to your Slack workspace to enable seamless communication between agents and your team. - -## Capabilities - -The Slack integration allows agents to interact within your designated channels: - -- **Send Messages:** Post updates, ask questions, report results, and notify team members. -- **Read Messages:** (Optional) Agents can be configured to read messages in specific channels to gather context or respond to requests (requires careful permission setup). -- **User Mentions:** Tag specific users or groups for notifications. - -## How Agents Use Slack - -Agents use Slack primarily for communication and notifications: - -- **Progress Updates:** Informing a channel or user when a task starts, encounters an issue, or is completed. -- **Requesting Feedback:** Asking for clarification or input on a specific implementation detail or ambiguity. -- **Sharing Results:** Posting links to created PRs, summaries of changes, or errors encountered. -- **Notifications:** Alerting the team about build failures, successful deployments, or critical issues identified. - -## Installation - -Add the Codegen Slack App to your workspace to enable agent communication. - - - Install the Codegen app from the Slack App Directory and choose the channels - it can access. - - - - Configure channel access carefully to ensure agents communicate in the - appropriate places. - diff --git a/docs/integrations/web-search.mdx b/docs/integrations/web-search.mdx deleted file mode 100644 index 66466dc5d..000000000 --- a/docs/integrations/web-search.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "Web Search Integration" -sidebarTitle: "Web Search" -icon: "globe" ---- - -Connect Codegen to web search capabilities powered by exa to enable agents to search and retrieve information from the internet. - -## Capabilities - -Our web search integration, powered by exa, provides agents with the ability to search and understand web content: - -- **Real-time Search:** Access up-to-date information from across the internet. -- **Content Analysis:** Parse and extract relevant information from web pages. -- **Source Verification:** Evaluate and cite reliable sources for information. -- **Context Integration:** Incorporate web-sourced information into responses and solutions. - -## How Agents Use Web Search - -Agents utilize web search capabilities to: - -- **Research Solutions:** Find documentation, examples, and best practices for implementing features. -- **Stay Current:** Access the latest information about technologies, APIs, and development trends. -- **Verify Information:** Cross-reference facts and documentation from authoritative sources. -- **Gather Context:** Research domain-specific knowledge needed to better understand and solve problems. - -## Implementation - -Web search is automatically available to agents when needed, powered by exa's advanced search capabilities. - - - Discover how exa powers our web search capabilities with state-of-the-art - search technology. - - - - Agents automatically determine when to leverage web search to enhance their - responses and solutions with current, relevant information. - diff --git a/docs/introduction/capabilities.mdx b/docs/introduction/capabilities.mdx deleted file mode 100644 index d53b2a8de..000000000 --- a/docs/introduction/capabilities.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: "Agent Capabilities" -sidebarTitle: "Capabilities" -icon: "gear" -iconType: "solid" ---- - -Codegen agents come equipped with a versatile set of tools and capabilities designed to seamlessly integrate into your development workflow and automate a wide range of tasks. - -## Integrated Tool Suites - -Our agents have deep integrations with the tools your team already uses: - - - - Manage repositories, review PRs, comment on issues, create branches, commit - code, and more. - - - Update ticket statuses, add comments, link PRs, create new issues based on - findings, and manage project boards. - - - Send notifications, ask for clarification, report progress, and interact - directly with your team. - - - -## Core Features - -Beyond specific tool integrations, Codegen agents possess fundamental capabilities: - - - - Safely run code, install dependencies, and test changes in an isolated - environment. - - - Access up-to-date information, research libraries, find documentation, and - learn about new technologies. - - - - - These capabilities allow Codegen agents to handle complex tasks that require - interacting with multiple systems, just like a human developer. - diff --git a/docs/introduction/getting-started.mdx b/docs/introduction/getting-started.mdx index 321f740e0..37cf05599 100644 --- a/docs/introduction/getting-started.mdx +++ b/docs/introduction/getting-started.mdx @@ -62,8 +62,8 @@ Here are some common patterns for code navigation in Codegen: - Iterate over all [Functions](/api-reference/core/Function) with [Codebase.functions](/api-reference/core/Codebase#functions) - View class inheritance with [Class.superclasses](/api-reference/core/Class#superclasses) - View function usages with [Function.usages](/api-reference/core/Function#usages) -- View inheritance hierarchies with [inheritance APIs](https://docs.codegen.com/building-with-codegen/class-api#working-with-inheritance) -- Identify recursive functions by looking at [FunctionCalls](https://docs.codegen.com/building-with-codegen/function-calls-and-callsites) +- View inheritance hierarchies with [inheritance APIs](https://graph-sitter.com/building-with-codegen/class-api#working-with-inheritance) +- Identify recursive functions by looking at [FunctionCalls](https://graph-sitter.com/building-with-codegen/function-calls-and-callsites) - View function call-sites with [Function.call_sites](/api-reference/core/Function#call-sites) ```python diff --git a/docs/introduction/ide-usage.mdx b/docs/introduction/ide-usage.mdx index 62574847c..e4105b984 100644 --- a/docs/introduction/ide-usage.mdx +++ b/docs/introduction/ide-usage.mdx @@ -94,7 +94,7 @@ Command: uv --directory /codegen-sdk/src/graph_sit If you use Cursor you'll be able to configure the IDE to index the Codegen docs. To do so go to `Settings` > `Features` > `Docs` and then click on `Add new docs`. We recommend using this url to index the API reference: ``` -https://docs.codegen.com/api-reference/index +https://graph-sitter.com/api-reference/index ``` diff --git a/docs/introduction/installation.mdx b/docs/introduction/installation.mdx index 74c099046..32562b33c 100644 --- a/docs/introduction/installation.mdx +++ b/docs/introduction/installation.mdx @@ -12,7 +12,7 @@ Install and set up Codegen in your development environment. - macOS and Linux - macOS is supported - Linux is supported on x86_64 and aarch64 with glibc 2.34+ - - Windows is supported via WSL. See [here](https://docs.codegen.com/building-with-codegen/codegen-with-wsl) for more details. + - Windows is supported via WSL. See [here](https://graph-sitter.com/building-with-codegen/codegen-with-wsl) for more details. - Python, Typescript, Javascript and React codebases ## Prerequisites diff --git a/docs/introduction/prompting.mdx b/docs/introduction/prompting.mdx deleted file mode 100644 index 06f3b608d..000000000 --- a/docs/introduction/prompting.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "Effective Prompting" -sidebarTitle: "Prompting" -icon: "lightbulb" -iconType: "solid" ---- - -To get the best results from Codegen, treat it like a skilled teammate: provide clear, specific instructions and sufficient context. Vague requests lead to ambiguous outcomes. - - - Codegen is based on Anthropic's Claude 3.7. You can prompt it similarly to - ChatGPT or other LLM-based assistants - - -## The Core Principle: Specificity - -Instead of "Fix the user service," try: - -> In the `my-web-app` repo (PR #42), refactor the `UserService` class in `src/services/user.ts` to use the `UserRepository` pattern shown in `ProductService`/`ProductRepository`. - -If there are specific implementation details you want included, make sure to specify. For example: - -> Ensure all tests in `tests/services/user.test.ts` pass and add new tests for the repository with 90%+ coverage. Update the diagram in `docs/architecture/user-service.md`. - -## Elements of a Strong Prompt - -1. **Scope:** What repository, branch, or files are involved? (e.g., `my-web-app` repo, `PR #42`, `src/services/user.ts`) -2. **Goal:** What is the high-level objective? (e.g., Refactor `UserService`, improve testability) -3. **Tasks:** What specific actions should the agent take? Use a numbered or bulleted list for clarity. (e.g., Extract logic to `UserRepository`, use dependency injection, update tests, update diagram) -4. **Context/Patterns:** Are there existing patterns, examples, or documentation to reference? (e.g., `ProductService`, `ProductRepository`) -5. **Success Criteria:** How will you know the task is done correctly? (e.g., Tests pass, 90%+ coverage, diagram updated) - - - Clear, detailed prompts empower Codegen agents to deliver accurate results - faster, significantly streamlining your workflow. - diff --git a/docs/mint.json b/docs/mint.json index 1012d3bf1..0c01f4d2c 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -12,7 +12,7 @@ "og:site_name": "Codegen", "og:title": "Codegen - Manipulate Code at Scale", "og:description": "A scriptable interface to a powerful, multi-lingual language server built on top of Tree-sitter.", - "og:url": "https://docs.codegen.com", + "og:url": "https://graph-sitter.com", "og:locale": "en_US", "og:logo": "https://i.imgur.com/f4OVOqI.png", "article:publisher": "Codegen, Inc.", @@ -60,10 +60,6 @@ { "name": "Changelog", "url": "/changelog" - }, - { - "name": "codegen", - "url": "/gen" } ], "navigation": [ @@ -175,15 +171,6 @@ "blog/fixing-import-loops" ] }, - { - "group": "codegen", - "pages": [ - "gen/introduction", - "gen/capabilities", - "gen/integrations", - "gen/faq" - ] - }, { "group": "API Reference", "pages": [ diff --git a/examples.md b/examples.md index 04c8616f5..5f26cae3f 100644 --- a/examples.md +++ b/examples.md @@ -4,4 +4,4 @@ For practical examples of using Codegen in real-world scenarios, please visit ou [github.com/codegen-sh/graph-sitter-examples](https://github.com/codegen-sh/graph-sitter-examples) -For docs and tutorials, please visit [docs.codegen.com](https://docs.codegen.com) +For docs and tutorials, please visit [graph-sitter.com](https://graph-sitter.com) diff --git a/hatch.toml b/hatch.toml index cc13e2841..b0fd7a1cb 100644 --- a/hatch.toml +++ b/hatch.toml @@ -83,10 +83,10 @@ packages = ["src/graph_sitter"] Homepage = "https://www.codegen.com/" Repository = "https://github.com/codegen-sh/graph-sitter" Download = "https://github.com/codegen-sh/graph-sitter/archive/{commit_hash}.zip" -Changelog = "https://docs.codegen.com/changelog/changelog" +Changelog = "https://graph-sitter.com/changelog/changelog" Releasenotes = "https://github.com/codegen-sh/graph-sitter/releases" Issues = "https://github.com/codegen-sh/graph-sitter/issues" -Documentation = "https://docs.codegen.com" +Documentation = "https://graph-sitter.com" Playground = "https://www.codegen.sh/" [build.targets.wheel.hooks.custom] diff --git a/src/graph_sitter/cli/mcp/resources/system_prompt.py b/src/graph_sitter/cli/mcp/resources/system_prompt.py index 804580889..ebfabe83c 100644 --- a/src/graph_sitter/cli/mcp/resources/system_prompt.py +++ b/src/graph_sitter/cli/mcp/resources/system_prompt.py @@ -232,8 +232,8 @@ def baz(): - Iterate over all [Functions](/api-reference/core/Function) with [Codebase.functions](/api-reference/core/Codebase#functions) - View class inheritance with [Class.superclasses](/api-reference/core/Class#superclasses) - View function usages with [Function.usages](/api-reference/core/Function#usages) -- View inheritance hierarchies with [inheritance APIs](https://docs.codegen.com/building-with-codegen/class-api#working-with-inheritance) -- Identify recursive functions by looking at [FunctionCalls](https://docs.codegen.com/building-with-codegen/function-calls-and-callsites) +- View inheritance hierarchies with [inheritance APIs](https://graph-sitter.com/building-with-codegen/class-api#working-with-inheritance) +- Identify recursive functions by looking at [FunctionCalls](https://graph-sitter.com/building-with-codegen/function-calls-and-callsites) - View function call-sites with [Function.call_sites](/api-reference/core/Function#call-sites) ```python diff --git a/src/graph_sitter/cli/utils/notebooks.py b/src/graph_sitter/cli/utils/notebooks.py index e04a16067..7cf355fd3 100644 --- a/src/graph_sitter/cli/utils/notebooks.py +++ b/src/graph_sitter/cli/utils/notebooks.py @@ -25,11 +25,11 @@ "cell_type": "markdown", "source": """# Codegen Demo: FastAPI -Welcome to [Codegen](https://docs.codegen.com)! +Welcome to [Codegen](https://graph-sitter.com)! This demo notebook will walk you through some features of Codegen applied to [FastAPI](https://github.com/fastapi/fastapi). -See the [getting started](https://docs.codegen.com/introduction/getting-started) guide to learn more.""".strip(), +See the [getting started](https://graph-sitter.com/introduction/getting-started) guide to learn more.""".strip(), }, { "cell_type": "code", @@ -49,9 +49,9 @@ Let's do a quick codebase analysis! -- Grab codebase content with [codebase.functions](https://docs.codegen.com/building-with-codegen/symbol-api) et al. -- View inheritance hierarchies with [inhertance APIs](https://docs.codegen.com/building-with-codegen/class-api#working-with-inheritance) -- Identify recursive functions by looking at [FunctionCalls](https://docs.codegen.com/building-with-codegen/function-calls-and-callsites)""".strip(), +- Grab codebase content with [codebase.functions](https://graph-sitter.com/building-with-codegen/symbol-api) et al. +- View inheritance hierarchies with [inhertance APIs](https://graph-sitter.com/building-with-codegen/class-api#working-with-inheritance) +- Identify recursive functions by looking at [FunctionCalls](https://graph-sitter.com/building-with-codegen/function-calls-and-callsites)""".strip(), }, { "cell_type": "code", @@ -112,7 +112,7 @@ Lets split up the largest test files into separate modules for better organization. -This uses Codegen's [codebase.move_to_file(...)](https://docs.codegen.com/building-with-codegen/moving-symbols), which will: +This uses Codegen's [codebase.move_to_file(...)](https://graph-sitter.com/building-with-codegen/moving-symbols), which will: - update all imports - (optionally) move depenencies - do so very fast ⚡️ @@ -170,7 +170,7 @@ Reset your codebase to it's initial state, discarding all changes -Learn more in [commit and reset](https://docs.codegen.com/building-with-codegen/commit-and-reset).""".strip(), +Learn more in [commit and reset](https://graph-sitter.com/building-with-codegen/commit-and-reset).""".strip(), }, { "cell_type": "code", diff --git a/src/graph_sitter/system-prompt.txt b/src/graph_sitter/system-prompt.txt index c2cf17072..e9c643c65 100644 --- a/src/graph_sitter/system-prompt.txt +++ b/src/graph_sitter/system-prompt.txt @@ -216,8 +216,8 @@ Here are some common patterns for code navigation in Codegen: - Iterate over all [Functions](/api-reference/core/Function) with [Codebase.functions](/api-reference/core/Codebase#functions) - View class inheritance with [Class.superclasses](/api-reference/core/Class#superclasses) - View function usages with [Function.usages](/api-reference/core/Function#usages) -- View inheritance hierarchies with [inheritance APIs](https://docs.codegen.com/building-with-codegen/class-api#working-with-inheritance) -- Identify recursive functions by looking at [FunctionCalls](https://docs.codegen.com/building-with-codegen/function-calls-and-callsites) +- View inheritance hierarchies with [inheritance APIs](https://graph-sitter.com/building-with-codegen/class-api#working-with-inheritance) +- Identify recursive functions by looking at [FunctionCalls](https://graph-sitter.com/building-with-codegen/function-calls-and-callsites) - View function call-sites with [Function.call_sites](/api-reference/core/Function#call-sites) ```python @@ -510,7 +510,7 @@ Install and set up Codegen in your development environment. - macOS and Linux - macOS is supported - Linux is supported on x86_64 and aarch64 with glibc 2.34+ - - Windows is supported via WSL. See [here](https://docs.codegen.com/building-with-codegen/codegen-with-wsl) for more details. + - Windows is supported via WSL. See [here](https://graph-sitter.com/building-with-codegen/codegen-with-wsl) for more details. - Python, Typescript, Javascript and React codebases ## Prerequisites @@ -719,7 +719,7 @@ Command: uv --directory /codegen-sdk/src/graph_sit If you use Cursor you'll be able to configure the IDE to index the Codegen docs. To do so go to `Settings` > `Features` > `Docs` and then click on `Add new docs`. We recommend using this url to index the API reference: ``` -https://docs.codegen.com/api-reference/index +https://graph-sitter.com/api-reference/index ``` diff --git a/src/gsbuild/README.md b/src/gsbuild/README.md index f2a4c9a02..c65e131a7 100644 --- a/src/gsbuild/README.md +++ b/src/gsbuild/README.md @@ -1,3 +1,3 @@ -# Codegen GS Build +# GS Build -A codegen module that builds the codegen SDK. +A build hook to generate the **init**.py file. diff --git a/tests/unit/cli/commands/update/data/response.json b/tests/unit/cli/commands/update/data/response.json index 82fdf1fca..0ceb29a38 100644 --- a/tests/unit/cli/commands/update/data/response.json +++ b/tests/unit/cli/commands/update/data/response.json @@ -21,7 +21,7 @@ "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], - "description": "
\n\n

\n \n \n \n

\n\n

\n Scriptable interface to a powerful, multi-lingual language server.\n

\n\n
\n\n[![PyPI](https://img.shields.io/badge/PyPi-graph-sitter-gray?style=flat-square&color=blue)](https://pypi.org/project/codegen/)\n[![Documentation](https://img.shields.io/badge/Docs-docs.codegen.com-purple?style=flat-square)](https://docs.codegen.com)\n[![Slack Community](https://img.shields.io/badge/Slack-Join-4A154B?logo=slack&style=flat-square)](https://community.codegen.com)\n[![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)\n[![Follow on X](https://img.shields.io/twitter/follow/codegen?style=social)](https://x.com/codegen)\n\n
\n\n
\n\n[Codegen](https://docs.codegen.com) is a python library for manipulating codebases.\n\n```python\nfrom graph_sitter import Codebase\n\n# Codegen builds a complete graph connecting\n# functions, classes, imports and their relationships\ncodebase = Codebase(\"./\")\n\n# Work with code without dealing with syntax trees or parsing\nfor function in codebase.functions:\n # Comprehensive static analysis for references, dependencies, etc.\n if not function.usages:\n # Auto-handles references and imports to maintain correctness\n function.move_to_file(\"deprecated.py\")\n```\n\nWrite code that transforms code. Codegen combines the parsing power of [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) with the graph algorithms of [rustworkx](https://github.com/Qiskit/rustworkx) to enable scriptable, multi-language code manipulation at scale.\n\n## Installation and Usage\n\nWe support\n\n- Running Codegen in Python 3.12 – 3.13 (recommended: Python 3.13)\n- macOS and Linux\n - macOS is supported on Apple Silicon\n - Linux is supported on x86_64 and aarch64 with glibc 2.34+\n - Windows is not supported\n- Python, Typescript, Javascript and React codebases\n\n```\n# Install inside existing project\nuv pip install codegen\n\n# Install global CLI\nuv tool install codegen\n\n# Create a codemod for a given repo\ncd path/to/repo\ngs init\ngs create test-function\n\n# Run the codemod\ngs run test-function\n\n# Create an isolated venv with codegen => open jupyter\ngs notebook\n```\n\n## Usage\n\nSee [Getting Started](https://docs.codegen.com/introduction/getting-started) for a full tutorial.\n\n```\nfrom graph_sitter import Codebase\n```\n\n## Resources\n\n- [Docs](https://docs.codegen.com)\n- [Getting Started](https://docs.codegen.com/introduction/getting-started)\n- [Contributing](CONTRIBUTING.md)\n- [Contact Us](https://codegen.com/contact)\n\n## Why Codegen?\n\nSoftware development is fundamentally programmatic. Refactoring a codebase, enforcing patterns, or analyzing control flow - these are all operations that can (and should) be expressed as programs themselves.\n\nWe built Codegen backwards from real-world refactors performed on enterprise codebases. Instead of starting with theoretical abstractions, we focused on creating APIs that match how developers actually think about code changes:\n\n- **Natural mental model**: Write transforms that read like your thought process - \"move this function\", \"rename this variable\", \"add this parameter\". No more wrestling with ASTs or manual import management.\n\n- **Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code.\n\n- **Built for advanced intelligences**: As AI developers become more sophisticated, they need expressive yet precise tools to manipulate code. Codegen provides a programmatic interface that both humans and AI can use to express complex transformations through code itself.\n\n## Contributing\n\nPlease see our [Contributing Guide](CONTRIBUTING.md) for instructions on how to set up the development environment and submit contributions.\n\n## Enterprise\n\nFor more information on enterprise engagements, please [contact us](https://codegen.com/contact) or [request a demo](https://codegen.com/request-demo).\n", + "description": "
\n\n

\n \n \n \n

\n\n

\n Scriptable interface to a powerful, multi-lingual language server.\n

\n\n
\n\n[![PyPI](https://img.shields.io/badge/PyPi-graph-sitter-gray?style=flat-square&color=blue)](https://pypi.org/project/codegen/)\n[![Documentation](https://img.shields.io/badge/Docs-graph-sitter.com-purple?style=flat-square)](https://graph-sitter.com)\n[![Slack Community](https://img.shields.io/badge/Slack-Join-4A154B?logo=slack&style=flat-square)](https://community.codegen.com)\n[![License](https://img.shields.io/badge/Code%20License-Apache%202.0-gray?&color=gray)](https://github.com/codegen-sh/graph-sitter/tree/develop?tab=Apache-2.0-1-ov-file)\n[![Follow on X](https://img.shields.io/twitter/follow/codegen?style=social)](https://x.com/codegen)\n\n
\n\n
\n\n[Codegen](https://graph-sitter.com) is a python library for manipulating codebases.\n\n```python\nfrom graph_sitter import Codebase\n\n# Codegen builds a complete graph connecting\n# functions, classes, imports and their relationships\ncodebase = Codebase(\"./\")\n\n# Work with code without dealing with syntax trees or parsing\nfor function in codebase.functions:\n # Comprehensive static analysis for references, dependencies, etc.\n if not function.usages:\n # Auto-handles references and imports to maintain correctness\n function.move_to_file(\"deprecated.py\")\n```\n\nWrite code that transforms code. Codegen combines the parsing power of [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) with the graph algorithms of [rustworkx](https://github.com/Qiskit/rustworkx) to enable scriptable, multi-language code manipulation at scale.\n\n## Installation and Usage\n\nWe support\n\n- Running Codegen in Python 3.12 – 3.13 (recommended: Python 3.13)\n- macOS and Linux\n - macOS is supported on Apple Silicon\n - Linux is supported on x86_64 and aarch64 with glibc 2.34+\n - Windows is not supported\n- Python, Typescript, Javascript and React codebases\n\n```\n# Install inside existing project\nuv pip install codegen\n\n# Install global CLI\nuv tool install codegen\n\n# Create a codemod for a given repo\ncd path/to/repo\ngs init\ngs create test-function\n\n# Run the codemod\ngs run test-function\n\n# Create an isolated venv with codegen => open jupyter\ngs notebook\n```\n\n## Usage\n\nSee [Getting Started](https://graph-sitter.com/introduction/getting-started) for a full tutorial.\n\n```\nfrom graph_sitter import Codebase\n```\n\n## Resources\n\n- [Docs](https://graph-sitter.com)\n- [Getting Started](https://graph-sitter.com/introduction/getting-started)\n- [Contributing](CONTRIBUTING.md)\n- [Contact Us](https://codegen.com/contact)\n\n## Why Codegen?\n\nSoftware development is fundamentally programmatic. Refactoring a codebase, enforcing patterns, or analyzing control flow - these are all operations that can (and should) be expressed as programs themselves.\n\nWe built Codegen backwards from real-world refactors performed on enterprise codebases. Instead of starting with theoretical abstractions, we focused on creating APIs that match how developers actually think about code changes:\n\n- **Natural mental model**: Write transforms that read like your thought process - \"move this function\", \"rename this variable\", \"add this parameter\". No more wrestling with ASTs or manual import management.\n\n- **Battle-tested on complex codebases**: Handle Python, TypeScript, and React codebases with millions of lines of code.\n\n- **Built for advanced intelligences**: As AI developers become more sophisticated, they need expressive yet precise tools to manipulate code. Codegen provides a programmatic interface that both humans and AI can use to express complex transformations through code itself.\n\n## Contributing\n\nPlease see our [Contributing Guide](CONTRIBUTING.md) for instructions on how to set up the development environment and submit contributions.\n\n## Enterprise\n\nFor more information on enterprise engagements, please [contact us](https://codegen.com/contact) or [request a demo](https://codegen.com/request-demo).\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": null, @@ -39,8 +39,8 @@ "platform": null, "project_url": "https://pypi.org/project/codegen/", "project_urls": { - "Changelog": "https://docs.codegen.com/changelog/changelog", - "Documentation": "https://docs.codegen.com", + "Changelog": "https://graph-sitter.com/changelog/changelog", + "Documentation": "https://graph-sitter.com", "Download": "https://github.com/codegen-sh/graph-sitter/archive/6c3817beda90af0ff1e7c77ad0b3783bf532fb3a.zip", "Homepage": "https://www.codegen.com/", "Issues": "https://github.com/codegen-sh/graph-sitter/issues",