-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Tab completion for first argument does not work correctly using SimpleCommand #1319
Comments
I found a workaround, you can somehow trigger the first argument when it has a value. if (args.length == 0 || (args.length == 1 && args[0].isEmpty())) {
return TABCOMPLETEARRAYS;
} else if (args.length == 1) {
return TABCOMPLETEARRAYS;
} |
Line 49 in afd8b55
|
Yeah, that looks like it's the issue. In my opnion it has to return An alternativ workaround is to check |
Hello Velocity-Team,
I just migrated from waterfall to Velocity 3.3.0-SNAPSHOT-b389 and found that the first argument of an SimpleCommand isn't tab-completed correctly after I rewrote my plugins commands from waterfall to velocity.
In my command I used the following code to check what's the cause.
I got these outputs:
Input:
/mycommand
(note the space at the end)Output:
COMMAND | [connected player] EvilJavaSkill (/ip) | mycommand | | 0
Input:
/mycommand E
Output:
COMMAND | [connected player] EvilJavaSkill (/ip) | mycommand | E | 1
Input:
/mycommand
(note the 2 spaces at the end)Output:
COMMAND | [connected player] EvilJavaSkill (/ip) | mycommand | , | 2
Inputting two spaces sets the
args.length
to 2 (output nr. 3) but inputting only one does set it to 0 (output nr. 1). The player has to enter a character first before the args length says that the player is trying to tab-complete the first argument.In my code I check for an
args.length
equals 1 to make sure the player is tab-completing the first argument. But somehow when the player hasn't entered any letter no tab-completion will be done due toinvocation.arguments();
returning an empty array. I would say thatinvocation.arguments();
should return an array with an empty string in it.I consider this is a bug if there is no special reason why velocity does not provide an array length of 1.
If there are any questions, let me know and I will help as much as I can.
Kind regards
EvilJavaSkill
The text was updated successfully, but these errors were encountered: