Skip to content
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

Fix incorrect context being used for suggestions (MC-278771) #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

senseiwells
Copy link

This fixes MC-278771.

The overview of this issue is that CommandDispatcher#getCompletionSuggestions doesn't provide the correct CommandContext to the CommandNode for which it's listing suggestions from. This is an issue as some suggestions may be contextual and rely on previous arguments in the command tree. Currently the root CommandContext is provided, this means that any redirect causes the incorrect context to be provided and thus an IllegalStateException to be thrown as the argument cannot be found.

The solution to this is to provide the correct CommandContextBuilder in the CommandContextBuilder#findSuggestionContext method. This builder can then provide the correct CommandContext for the respective command node.

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.

1 participant