Commit graph

284 commits

Author SHA1 Message Date
Citymonstret
89ec3fbf29 chore: make code style consistent 2022-06-18 22:52:58 -07:00
Alexander Söderberg
2572b73c4b feat(bukkit/paper): add root command deletion support (#371) 2022-06-18 22:52:58 -07:00
Alexander Söderberg
28ff5d3003 feat(core): support root command deletion & standardize capabilities (#369) 2022-06-18 22:52:58 -07:00
Brian
08a97b2c4f fix: make BooleanArgument suggestions lowercase (#336) 2022-06-18 22:52:58 -07:00
Brian
f0e9b80c77 docs: fix typos (#344) 2022-06-18 22:52:58 -07:00
Alexander Söderberg
4360847852 chore(core): add apiguardian @API annotations (#368) 2022-06-18 22:52:58 -07:00
Alexander Söderberg
d4ab593460 feat(core): flag yielding arguments (#367)
Implements https://github.com/Incendo/cloud/issues/218
Also confirmed to fix https://github.com/Incendo/cloud/issues/321.

Both `StringArgument` and `StringArrayArgument` now have flag-yielding modes. For annotated command method users, this can be activated using ´@FlagYielding`
2022-06-18 22:52:58 -07:00
Citymonstret
e889811380 chore(core): add @This annotations 2022-06-18 22:52:58 -07:00
Alexander Söderberg
d613fd0208 feat(core): add MulticastDelegateFutureCommandExecutionHandler (#363)
This PR also adds a `handler()` getter to the command builder class. This will allow for things along the line of https://github.com/Incendo/cloud/issues/189 to be achieved.
2022-06-18 22:52:58 -07:00
Citymonstret
c39e0517fa chore: add test for issue #281
cannot replicate the issue (anymore).
2022-06-18 22:52:58 -07:00
Citymonstret
0ee576657b chore: add tests for issue #262
Add tests in order to try to replicate #262. The issue cannot be replicated.
2022-06-18 22:52:58 -07:00
Alexander Söderberg
09044b9c1b feat(core): add unit tests for the standard parsers (#362)
* feat(core): add BooleanParser unit tests

* feat(core): add ByteParser unit tests

* feat(core): add IntegerParser, LongParser & ShortParser unit tests

* feat(core): add EnumParser unit tests

* feat(core): add CharacterParser unit tests

* feat(core): add DoubleParser & FloatParser unit tests

* feat(core): add UUIDParser & StringArrayParser unit tests
2022-06-18 22:52:58 -07:00
Alexander Söderberg
46a3f7129f build: add revapi to core api modules (#361)
this way we can detect API/ABI breaks between versions. it'll compare to the previous tag.
2022-06-18 22:52:58 -07:00
Citymonstret
ebb25e9d41 chore(core): improve (some) tests 2022-06-18 22:52:58 -07:00
Alexander Söderberg
f3e95070ce fix: #337 NPE thrown on empty command tree (#358)
Fixes #337 by making an empty command three throw NoSuchCommandException instead of NullPointerException.
2022-06-18 22:52:58 -07:00
Aldin
2277bf5ef8 feat: allow a custom CaptionVariableReplacementHandler (#352) 2022-06-18 22:52:58 -07:00
Alexander Söderberg
d681ba5840 feat: annotation string processors (#353)
adds a system for processing strings found in annotations before they're used by AnnotationParser

implements #347

Also, because we're using "-Werror", the code won't actually build (and thus tests won't work) using JDK18. To remedy this, a bunch of @SuppressWarnings("serial")s has been added to the exceptions. We don't serialize exceptions, and they're in fact non-serializable because of their members, so this is the appropriate solution (well, the better solution would be to make them serializable, but that's outside the scope of this PR).
2022-06-18 22:52:58 -07:00
zml
ed7b7569a8 build: switch to spotless (#355)
* build: switch to spotless

add in some other basic formatting steps that allow for easy
auto-correction

* build: lint text files as well

* chore: remove license headers from package-info files

spotless can't verify these
2022-06-18 22:52:58 -07:00
Aldin
cc7793925d Register missing regex failure caption (#351) 2022-06-18 22:52:58 -07:00
Jason Penilla
eae247954f build and publishing updates 2022-06-18 22:52:58 -07:00
Jason Penilla
b0289e8d01 DurationArgument cleanup 2022-06-18 22:52:58 -07:00
Aldin
c58248e35d Register the duration argument parser in the default parser registry (#333) 2022-06-18 22:52:58 -07:00
Tadhg Boyle
c2b3145d4d Add DurationArgument for parsing java.time.Duration (#330)
Co-authored-by: Frank van der Heijden <frank.boekanier@gmail.com>
2022-06-18 22:52:58 -07:00
Jason Penilla
c26fbcb6fc Fix incorrect inputQueue usage in some argument types 2022-02-28 13:57:35 -07:00
Jason Penilla
18fc685c70 Don't remove from queue on failure in quoted string parser 2021-12-18 04:12:42 -08:00
Irmo van den Berge
484c97ca98 Fix concurrent cause of execution exception not being wrapped right
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-12-18 04:12:42 -08:00
Jason Penilla
708d11854e Fix import order 2021-12-02 02:04:43 -08:00
alexander.soderberg
29abe82215 Chore: Improve the test setup for cloud-core and clean up some test cases. 2021-12-02 02:04:43 -08:00
Jason Penilla
9dc4e87fa8 Use typesafe dependency accessors 2021-12-02 02:04:43 -08:00
Jason Penilla
8ea7d59736 fix: deep nesting on permissions causing stack overflow errors 2021-12-02 02:04:43 -08:00
solo
8711d19703 Merge pull request #307 from solonovamax/fix/commands-completing-before-execution
Fix cloud swallowing exceptions in `suspend` methods.
2021-12-02 02:04:43 -08:00
Jason Penilla
83163c2a77 Replace more usages of TypeToken#toString 2021-12-02 02:04:43 -08:00
Jason Penilla
a92ff9d39a Make CommandExecutionHandler#executeFuture return CompletableFuture<Void> instead of CompletableFuture<Object>
The value of the completed future is never used, void makes this more obvious
2021-12-02 02:04:43 -08:00
Jason Penilla
9e39b0ca8e Don't catch NPE in AnnotatedElementAccessor
NPE is thrown when the annotation class param is null
2021-12-02 02:04:43 -08:00
Jason Penilla
1b52e8c3bd Update errorprone 2021-12-02 02:04:43 -08:00
Jason Penilla
8aa81b445e Rename CommandFlag#getCommandPermission 2021-12-02 02:04:43 -08:00
i0xHeX
b227032032 core: Fix single static argument not formatting properly (#294) 2021-12-02 02:04:43 -08:00
Jake Potrebic
9f0ff4e504 core: fix And/OrPermission losing conditional tree (#296) 2021-12-02 02:04:43 -08:00
Kezz
4037e8e393 core: Add @Liberal annotation to mark boolean arguments as liberal (#288) 2021-12-02 02:04:43 -08:00
Jason Penilla
be4cd4101f core: Don't parse empty input strings in FlagArgument parser 2021-12-02 02:04:43 -08:00
Frank van der Heijden
9c85db386f Fix raw input in command execution 2021-12-02 02:04:43 -08:00
Frank van der Heijden
3e28cc3191 Add @since and CHANGELOG.md entry for flag permissions 2021-12-02 02:04:43 -08:00
Frank van der Heijden
87a28b135b Fix multi-alias flag not checking permissions 2021-12-02 02:04:43 -08:00
Frank van der Heijden
d0beddf9eb No double space 2021-12-02 02:04:43 -08:00
Frank van der Heijden
1b7fb2f34c Implement flag permissions 2021-12-02 02:04:43 -08:00
Alexander Söderberg
6871341291 I hate the fact that we started using Checkstyle.
Whose decision was that anyway..?
2021-12-02 02:04:43 -08:00
Alexander Söderberg
5934c2fd3b Add changelog 2021-12-02 02:04:43 -08:00
Alexander Söderberg
7bb5e63dc7 Add support for suspending functions
This also changes CommandExecutionHandler to return futures instead. The old method is still supported, and the new future-returning method will delegate to the old non-returning method.
2021-12-02 02:04:43 -08:00
Jason Penilla
490bdfa3a4 Improve handling of non-quoted strings in quoted string parser 2021-07-05 02:56:06 -07:00
Jason Penilla
75e59c9fe6 Clean up StringParser 2021-07-05 02:56:06 -07:00