Skip to content

feat(backend): Add 'method' type annotation support for PyBuilder#4267

Open
carloea2 wants to merge 8 commits intoapache:mainfrom
carloea2:fix/encodable-string-annotation-path
Open

feat(backend): Add 'method' type annotation support for PyBuilder#4267
carloea2 wants to merge 8 commits intoapache:mainfrom
carloea2:fix/encodable-string-annotation-path

Conversation

@carloea2
Copy link
Contributor

@carloea2 carloea2 commented Mar 7, 2026

What changes were proposed in this PR?

This PR adds method-level support for EncodableStringAnnotation in PyBuilder.

Changes

  • Added ElementType.METHOD to EncodableStringAnnotation.java
  • Updated EncodableInspector.scala to recognize annotated methods as UI-encodable strings
  • Updated the annotation FQN used in the inspector

Effect

Now PyBuilder correctly handles both:

  • Holder.uiText
  • Holder.uiText()

when the method is annotated with @EncodableStringAnnotation.

Closes #4266

How was this PR tested?

Added 2 tests to verify method annotation support:

  • annotated method without parentheses
  • annotated method with parentheses

Was this PR authored or co-authored using generative AI tooling?

No

@carloea2 carloea2 changed the title feature(backend): Add method support for EncodableStringAnnotation feat(backend): Add method support for EncodableStringAnnotation Mar 7, 2026
@carloea2
Copy link
Contributor Author

carloea2 commented Mar 7, 2026

@bobbai00 Can you please review this PR? Thanks.

@chenlica chenlica requested a review from bobbai00 March 7, 2026 16:04
@chenlica
Copy link
Contributor

chenlica commented Mar 7, 2026

@bobbai00 Please review it.

@carloea2
Copy link
Contributor Author

@bobbai00 Hi, can you review this PR please?

@carloea2 carloea2 changed the title feat(backend): Add method support for EncodableStringAnnotation feat(backend): Add 'method' type annotation support for PyBuilder Mar 16, 2026
@chenlica chenlica requested review from Xiao-zhen-Liu and removed request for bobbai00 March 17, 2026 06:12
@chenlica
Copy link
Contributor

I re-assigned the PR to @Xiao-zhen-Liu .

Copy link
Contributor

@Xiao-zhen-Liu Xiao-zhen-Liu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@carloea2
Copy link
Contributor Author

@chenlica Can you run the tests?

@chenlica chenlica self-requested a review March 18, 2026 16:02
@chenlica
Copy link
Contributor

@carloea2 Please add more details to the PR description.

@carloea2
Copy link
Contributor Author

@chenlica I updated the description.

@chenlica chenlica removed their request for review March 19, 2026 05:52
@chenlica
Copy link
Contributor

@Xiao-zhen-Liu Feel free to merge it when it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add @Method support for EncodableStringAnnotation

3 participants