-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Adds experimental annotation #7109
base: dev/feature
Are you sure you want to change the base?
Adds experimental annotation #7109
Conversation
- Updates the existing annotations - Updates SkriptEventInfo to include an experimental method
@@ -248,7 +215,7 @@ public <R> ClassInfo<T> math(final Class<R> relativeType, final Arithmetic<? sup | |||
/** | |||
* Only used for Skript's documentation. | |||
* | |||
* @param name | |||
* @param name The name of this ClassInfo | |||
* @return This ClassInfo object | |||
*/ | |||
public ClassInfo<T> name(final String name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ClassInfo<T> name(final String name) { | |
public ClassInfo<T> name(String name) { |
@@ -260,7 +227,7 @@ public ClassInfo<T> name(final String name) { | |||
/** | |||
* Only used for Skript's documentation. | |||
* | |||
* @param description | |||
* @param description The description(s) of this ClassInfo | |||
* @return This ClassInfo object | |||
*/ | |||
public ClassInfo<T> description(final String... description) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ClassInfo<T> description(final String... description) { | |
public ClassInfo<T> description(String... description) { |
@@ -272,7 +239,7 @@ public ClassInfo<T> description(final String... description) { | |||
/** | |||
* Only used for Skript's documentation. | |||
* | |||
* @param usage | |||
* @param usage The usage(s) of this ClassInfo | |||
* @return This ClassInfo object | |||
*/ | |||
public ClassInfo<T> usage(final String... usage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ClassInfo<T> usage(final String... usage) { | |
public ClassInfo<T> usage(String... usage) { |
@@ -284,7 +251,7 @@ public ClassInfo<T> usage(final String... usage) { | |||
/** | |||
* Only used for Skript's documentation. | |||
* | |||
* @param examples | |||
* @param examples The example(s) for this ClassInfo | |||
* @return This ClassInfo object | |||
*/ | |||
public ClassInfo<T> examples(final String... examples) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ClassInfo<T> examples(final String... examples) { | |
public ClassInfo<T> examples(String... examples) { |
@@ -296,7 +263,7 @@ public ClassInfo<T> examples(final String... examples) { | |||
/** | |||
* Only used for Skript's documentation. | |||
* | |||
* @param since | |||
* @param since The version of the plugin in which this ClassInfo was added | |||
* @return This ClassInfo object | |||
*/ | |||
public ClassInfo<T> since(final String since) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ClassInfo<T> since(final String since) { | |
public ClassInfo<T> since(String since) { |
@@ -310,14 +277,34 @@ public ClassInfo<T> since(final String since) { | |||
* | |||
* Only used for Skript's documentation. | |||
* | |||
* @param pluginNames | |||
* @param pluginNames The plugins, other than Skript, that this ClassInfo requires | |||
* @return This ClassInfo object | |||
*/ | |||
public ClassInfo<T> requiredPlugins(final String... pluginNames) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public ClassInfo<T> requiredPlugins(final String... pluginNames) { | |
public ClassInfo<T> requiredPlugins(String... pluginNames) { |
* @return This ClassInfo object | ||
*/ | ||
public ClassInfo<T> requiredPlugins(final String... pluginNames) { | ||
assert this.requiredPlugins == null; | ||
this.requiredPlugins = pluginNames; | ||
return this; | ||
} | ||
|
||
/** | ||
* Provides information regarding the experiment which this ClassInfo requires. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Provides information regarding the experiment which this ClassInfo requires. | |
* Provides information regarding the experimental feature in this ClassInfo. |
@@ -526,8 +504,7 @@ public String toString(final int flags) { | |||
} | |||
|
|||
@Override | |||
@NotNull | |||
public String toString(final @Nullable Event event, final boolean debug) { | |||
public @NotNull String toString(final @Nullable Event event, final boolean debug) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public @NotNull String toString(final @Nullable Event event, final boolean debug) { | |
public @NotNull String toString(@Nullable Event event, boolean debug) { |
@@ -136,6 +120,21 @@ public SkriptEventInfo<E> since(String since) { | |||
return this; | |||
} | |||
|
|||
/** | |||
* Only used for Skript's documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing explanation of what this is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good with efy's changes
String featureName(); | ||
LifeCycle phase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it might be better to require the actual experiment here? It seems tedious to have to update the phase whenever an experiment updates. The experiment itself can just be grabbed from the enum: https://github.com/SkriptLang/Skript/blob/ef3d3603c4aaedf519f2c1322c3a0f09f4b53a67/src/main/java/ch/njol/skript/registrations/Feature.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking this as well. Maybe it would be better to have the annotation be like, @Feature(String featureName, String feedbackLink)
, and then use smth like ExperimentRegistry#find(String name)
later to get the experiment and its phase and stuff?
Description
This PR adds a new experimental annotation, which can be used to provide information about an experiment on which a syntax element depends. The provided information is the experiment name, the associated life cycle, and the associated feedback line (as a string).
Also updates the existing doc annotations, and adds experimental stuff to SkriptEventInfo and ClassInfo,
Target Minecraft Versions: any
Requirements: none
Related Issues: