-
-
Notifications
You must be signed in to change notification settings - Fork 58
Allow parsing multiple instances #669
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
Conversation
cloud-annotations/src/main/java/org/incendo/cloud/annotations/AnnotationParser.java
Outdated
Show resolved
Hide resolved
cloud-annotations/src/main/java/org/incendo/cloud/annotations/AnnotationParser.java
Outdated
Show resolved
Hide resolved
|
Should probably update parseContainers to use the new method |
|
Updated the parseContainers, now if the priorities are the same, they will be parsed together in the new method. @CommandContainer
class Test1 {
@Command("test1 <arg>")
public void command(Object sender, @Argument(value = "arg", suggestions = "test2") String arg) {
}
@Suggestions("test1")
public List<String> suggestions(Object sender, CommandInput arg) {
return Collections.emptyList();
}
}
@CommandContainer
class Test2 {
@Command("test2 <arg>")
public void command(Object sender, @Argument(value = "arg", suggestions = "test1") String arg) {
}
@Suggestions("test2")
public List<String> suggestions(Object sender, CommandInput arg) {
return Collections.emptyList();
}
}By default now this works, but if one of the priorities will be higher or lower (for example |
|
I don't see the benefit to grouping the parsing by priority, I think sorting by priority for the collection passed to #parse should be enough |
Ok, changed that |
jpenilla
left a comment
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.
lgtm
This allows parsing multiple instances at once with better support of complex relations between instances (like if instance A uses suggestions from B and at the same time B uses suggestions from A)