Skip to content

Generalize processing of doc-annotations in JsonRpcDataProcessor#941

Merged
pisv merged 1 commit into
eclipse-lsp4j:mainfrom
pisv:doc-annotations
Dec 11, 2025
Merged

Generalize processing of doc-annotations in JsonRpcDataProcessor#941
pisv merged 1 commit into
eclipse-lsp4j:mainfrom
pisv:doc-annotations

Conversation

@pisv

@pisv pisv commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Currently, JsonRpcDataProcessor copies the doc-comment and selected annotations such as @ProtocolDeprecated, @ProtocolDraft, @ProtocolSince, and @Deprecated from a field of a protocol class to the generated getter and setter for the field.

I think that this processing can and should be generalized to include all doc-annotations (i.e. all annotations annotated with @Documented), since by definition all doc-annotations are considered part of the element's public contract and, therefore, should be copied to the generated getter and setter along with the doc-comment they essentially part of.

If JsonRpcDataProcessor were implemented in this way, we would not need to modify it to add special processing for the @ProtocolDeprecated, @ProtocolDraft, and @ProtocolSince annotations introduced recently. It would just work.

@pisv pisv requested a review from jonahgraham December 11, 2025 14:29
@github-actions

Copy link
Copy Markdown

Test Results

  500 files  ±0    500 suites  ±0   39s ⏱️ -1s
  359 tests ±0    359 ✅ ±0  0 💤 ±0  0 ❌ ±0 
4 052 runs  ±0  4 052 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 1215680. ± Comparison against base commit 7e49732.

@jonahgraham jonahgraham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good - I very much like the fact that we wont forget next time to edit this if a new annotation is introduced.

@pisv

pisv commented Dec 11, 2025

Copy link
Copy Markdown
Contributor Author

This looks good

Great, thanks for the review! 👍

I very much like the fact that we wont forget next time to edit this if a new annotation is introduced.

That's it!

A nice side-effect is that the doc-annotations would appear on the generated getter and setter in exactly the same order as they do on the field declaration in the source.

@pisv pisv merged commit 53478c4 into eclipse-lsp4j:main Dec 11, 2025
7 checks passed
@pisv pisv deleted the doc-annotations branch December 11, 2025 15:45
@pisv pisv added this to the 1.0.0 milestone Dec 11, 2025
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.

2 participants