Skip to content

Conversation

@masmc05
Copy link
Contributor

@masmc05 masmc05 commented Jan 27, 2024

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)

@github-actions
Copy link

github-actions bot commented Feb 12, 2024

Test Results

 84 files  ±0   84 suites  ±0   10s ⏱️ -2s
415 tests ±0  415 ✅ ±0  0 💤 ±0  0 ❌ ±0 
459 runs  ±0  459 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2aab083. ± Comparison against base commit d56f03c.

♻️ This comment has been updated with latest results.

@jpenilla
Copy link
Member

Should probably update parseContainers to use the new method

@masmc05
Copy link
Contributor Author

masmc05 commented Feb 14, 2024

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 @CommandContainer(priority = 2)), it will be parsed as in older version

@jpenilla
Copy link
Member

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

@masmc05
Copy link
Contributor Author

masmc05 commented Feb 14, 2024

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
jpenilla previously approved these changes Feb 14, 2024
Copy link
Member

@jpenilla jpenilla left a comment

Choose a reason for hiding this comment

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

lgtm

@jpenilla jpenilla merged commit ad23f93 into Incendo:master Feb 16, 2024
@masmc05 masmc05 deleted the ann branch February 16, 2024 21:39
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