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

Add message value to API-tools annotations #1133

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

HannesWell
Copy link
Member

@HannesWell HannesWell commented Feb 6, 2024

This allows users of the annotations to provide contextual information to clients about why the annotations is applied.
This is common for users of the javadoc-annotations, but at the moment not possible when using the java-annotations.

Later PDE's API-Tools could also provide that information to developers of clients.

Instead of

/**
 * The doc.
 * @noextend This class is not intended to be sub-classed by clients.
 */
public abstract class MyClass {

one can use

/**
 * The doc.
 */
@NoExtend("This class is not intended to be sub-classed by clients.")
public abstract class MyClass {

Copy link

github-actions bot commented Feb 6, 2024

Test Results

   290 files  ±0     290 suites  ±0   59m 13s ⏱️ + 4m 38s
 3 526 tests ±0   3 467 ✅ ±0   58 💤 ±0  1 ❌ ±0 
10 823 runs  ±0  10 658 ✅ ±0  164 💤 ±0  1 ❌ ±0 

For more details on these failures, see this check.

Results for commit 03bb60d. ± Comparison against base commit bc22b07.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

Looks good!

@laeubi
Copy link
Contributor

laeubi commented Feb 7, 2024

@HannesWell just one thing to note as we almost ever have the same "text" maybe the default should not be empty (even though I'm not sure if default text will showup in the javadoc?)

@HannesWell
Copy link
Member Author

@HannesWell just one thing to note as we almost ever have the same "text" maybe the default should not be empty (even though I'm not sure if default text will showup in the javadoc?)

That's a good suggestion.
I'll check later how this will render in Javadoc.

This allows users of the annotations to provide contextual information
to clients about why the annotations is applied.
This is common for users of the javadoc-annotations, but at the moment
not possible when using the java-annotations.

Later PDE's API-Tools could also provide that information to developers
of clients.
@HannesWell
Copy link
Member Author

@HannesWell just one thing to note as we almost ever have the same "text" maybe the default should not be empty (even though I'm not sure if default text will showup in the javadoc?)

Added a default value for all annotations based on the texts commonly used throughout the Eclipse SDK.
In case one of them is not suitable we can still improve the default later, but I would like to submit this as soon as the build is green so that it can be used in eclipse-platform/eclipse.platform.swt#1039 after tonight's I-build.

I also checked if default values/messages are displayed in the javadoc and at least the Eclipse built-in Javadoc view does not render the default of the value element. But if one clicks on the annotation the annotation-class documentation is shown that provides similar information and the annotation itself is already relatively clear.
Nevertheless API tools could also show the default message in its warnings if desired.

@HannesWell HannesWell merged commit 974cbf7 into eclipse-pde:master Feb 7, 2024
12 of 17 checks passed
@HannesWell HannesWell deleted the api-annotation-message branch February 7, 2024 21:06
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.

None yet

2 participants