Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CG-10705: API to remove async from functions #936

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 21, 2025

This PR adds a new API method remove_async() to the Function class that allows removing the async keyword from functions.

Changes

  • Added a new method remove_async() to the Function class in src/codegen/sdk/core/function.py
  • The method checks if a function is async and removes the async keyword if present
  • The method handles whitespace properly to maintain code formatting

Usage

# Find an async function
async_function = codebase.find_function("my_async_function")

# Remove the async keyword
async_function.remove_async()

This complements the existing asyncify() method which adds the async keyword to functions.

Resolves CG-10705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants