Skip to content

Conversation

@codegen-sh
Copy link
Contributor

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

Description

This PR fixes the cloud parse failure due to TSCodeBlock missing the end_byte_for_condition_block attribute.

Problem

The error occurs during dependency resolution in the resolve_name method in codegen/sdk/core/expressions/name.py. When resolving names in conditional blocks, it tries to access end_byte_for_condition_block on a TSCodeBlock object, but this attribute is not implemented for TSCodeBlock.

The error message is:

AttributeError: 'TSCodeBlock' object has no attribute 'end_byte_for_condition_block'

Solution

Added the end_byte_for_condition_block property to TSCodeBlock class, which simply returns the end_byte value, matching the default implementation in the ConditionalBlock interface.

Related Linear Issue

https://linear.app/codegen-sh/issue/CG-12125/fix-tscodeblock-missing-end-byte-for-condition-block-attribute

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


codegen-bot seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tkfoss tkfoss closed this Mar 14, 2025
@tkfoss tkfoss deleted the gen/6c6fc90e-0959-45d3-a077-31965066447c branch March 19, 2025 21:49
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.

3 participants